title: "unresolved import -- maybe a missing extern" When extern declaration exists
body: <p>I have a small project which built with no issues when it was all in one big .rs file. I wanted to make it easier to work with, so I broke it up into modules, and the project is now structured like this:</p>
  
  <pre><code>├── GameState
  │   ├── ballstate.rs
  │   ├── collidable.rs
  │   ├── gamestate.rs
  │   ├── mod.rs
  │   └── playerstate.rs
  ├── lib.rs
  └── main.rs
  </code></pre>
  
  <p>In <code>ballstate.rs</code>, I need to use the <code>rand</code> crate. Here's an abbreviated version of the file:</p>
  
  <pre><code>extern crate rand;
  
  pub struct BallState {
      dir: Point,         
      frame: BoundingBox  
  }                     
  
  impl BallState {
      fn update_dir(&amp;mut self) {
          use rand::*;                                                                                                                                                                    
          let mut rng = rand::thread_rng();                                                                      
          self.dir.x = if rng.gen() { Direction::Forwards.as_float() } else { Direction::Backwards.as_float()  };
          self.dir.y = if rng.gen()  { Direction::Forwards.as_float() } else { Direction::Backwards.as_float() };
      }                                                                                                        
  }
  </code></pre>
  
  <p>However, when I run <code>cargo build</code> from the top level directory, I get the following error: </p>
  
  <blockquote>
    <p>GameState/ballstate.rs:42:9: 42:13 error: unresolved import <code>rand::*</code>. Maybe a missing <code>extern crate rand</code>?</p>
  </blockquote>
  
  <p>When I just had the extern crate declaration in my main.rs file, this worked. What's changed now that it's in a separate module? </p>