<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: pahlavaubivca</title>
    <description>The latest articles on DEV Community by pahlavaubivca (@pahlavaubivca).</description>
    <link>https://dev.to/pahlavaubivca</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2302343%2F83295132-6efe-4384-b600-6da1c734a04d.jpeg</url>
      <title>DEV Community: pahlavaubivca</title>
      <link>https://dev.to/pahlavaubivca</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pahlavaubivca"/>
    <language>en</language>
    <item>
      <title>Rust registry error "candidate versions found which didn't match"</title>
      <dc:creator>pahlavaubivca</dc:creator>
      <pubDate>Sat, 04 Jan 2025 20:08:57 +0000</pubDate>
      <link>https://dev.to/pahlavaubivca/rust-registry-error-candidate-versions-found-which-didnt-match-206p</link>
      <guid>https://dev.to/pahlavaubivca/rust-registry-error-candidate-versions-found-which-didnt-match-206p</guid>
      <description>&lt;h2&gt;
  
  
  Env
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;OS: WSL2 (Windows11)&lt;/li&gt;
&lt;li&gt;IDE: RustRover&lt;/li&gt;
&lt;li&gt;cargo version: 1.83.0 &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Description
&lt;/h2&gt;

&lt;p&gt;Rare but pretty annoying error like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;error: failed to &lt;span class="k"&gt;select &lt;/span&gt;a version &lt;span class="k"&gt;for &lt;/span&gt;the requirement &lt;span class="sb"&gt;`&lt;/span&gt;winit &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"^0.30.5"&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;
candidate versions found which didn&lt;span class="s1"&gt;'t match: 0.9.0, 0.8.3, 0.8.2, ...
location searched: crates.io index
required by package `eframe v0.29.1`
    ... which satisfies dependency `eframe = "^0.29.1"` of package `my_proj v0.1.0 (/home/user/my_proj)`
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Appears despite package &lt;code&gt;winit = "^0.30.5&lt;/code&gt; exist on crates.io&lt;/p&gt;

&lt;p&gt;I faced this error when tried update Cargo.toml during debug  my project, but possible can happen in other situation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Solution 1
&lt;/h2&gt;

&lt;p&gt;Remove registry folder and rerun &lt;code&gt;cargo build&lt;/code&gt; or &lt;code&gt;cargo update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;rm -R ~/.cargo/registry&lt;/code&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Caution: after remove - cargo will fetch full list of packages from Cargo.toml and for all projects - so its can take some time. Also not sure about any problem if you have custom packages installed on machine.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Solution 2
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Not tested by me&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Install &lt;code&gt;cargo-cache&lt;/code&gt; (&lt;a href="https://crates.io/crates/cargo-cache" rel="noopener noreferrer"&gt;https://crates.io/crates/cargo-cache&lt;/a&gt;) and use manual.&lt;/p&gt;

&lt;h2&gt;
  
  
  Source
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/rust-lang/cargo/issues/3289" rel="noopener noreferrer"&gt;https://github.com/rust-lang/cargo/issues/3289&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>rust</category>
    </item>
  </channel>
</rss>
