title: Using a crate in a Cargo project errors with "maybe a missing extern crate"
body: <p>I started learning Rust today, but I am stuck at <a href="https://doc.rust-lang.org/book/ch02-00-guessing-game-tutorial.html" rel="noreferrer">this step</a>. I want use the rand crate in my project, so I updated my <code>Cargo.toml</code> as suggested in the tutorial:</p>
  
  <pre><code>[package]
  name = "guessing_game"
  version = "0.1.0"
  authors = ["Novice &lt;novice.coder@gmail.com&gt;"]
  
  [dependencies]
  rand = "0.3.14"
  </code></pre>
  
  <p>Importing it in my code as:</p>
  
  <pre><code>use rand::Rng;
  </code></pre>
  
  <p>It gives this error:</p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0432]: unresolved import `rand`
   --&gt; src/main.rs:1:5
    |
  1 | use rand::Rng;
    |     ^^^^ maybe a missing `extern crate rand;`?
  </code></pre>
  
  <p>Am I missing something?</p>
  
  <hr>
  
  <p>I added <code>edition = "2018"</code> as suggested:</p>
  
  <p>Cargo.toml:</p>
  
  <pre><code>[package]
  name = "guessing_game"
  version = "0.1.0"
  authors = ["Novice &lt;novice.coder@gmail.com&gt;"]
  edition = "2018"
  
  [dependencies]
  rand = "0.3.14"
  </code></pre>
  
  <p>Cargo build now gives:</p>
  
  <pre class="lang-none prettyprint-override"><code>$ cargo build --verbose
     Fresh libc v0.2.45
     Fresh rand v0.4.3
     Fresh rand v0.3.22
   Compiling guessing_game v0.1.0 (/home/bappaditya/projects/guessing_game)
   Running `rustc --edition=2018 --crate-name guessing_game src/main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=4d1c2d587c45b4
  c6 -C extra-filename=-4d1c2d587c45b4c6 --out-dir 
  /home/bappaditya/projects/guessing_game/target/debug/deps -C 
  incremental=/home/bappaditya/projects/guessing_game/target
  /debug/incremental -L 
  dependency=/home/bappaditya/projects/guessing_game/target/debug/deps -- 
  extern rand=/home/bappaditya/projects/guessing_game/target/debug/deps/libra
  nd-78fc4b142cc921d4.rlib`
  error: Edition 2018 is unstable and only available for nightly builds of rustc.
  </code></pre>
  
  <hr>
  
  <p>I updated rust using <code>rustup update</code> and then added <code>extern crate rand;</code> to my main.rs. Now it's working as expected. </p>
  
  <p>The program <strong>runs</strong> but in my vscode problems tab its still showing the error - </p>
  
  <pre class="lang-none prettyprint-override"><code>error[E0432]: unresolved import `rand`
   --&gt; src/main.rs:1:5
    |
  1 | use rand::Rng;
    |     ^^^^ maybe a missing `extern crate rand;`?
  </code></pre>