title: How do I compile a multi-file crate in Rust?
body: <p>I'm trying to figure out how to compile multi-file crates in Rust, but I keep getting a compile error.</p>
  
  <p>I have the file I want to import into the crate thing.rs:</p>
  
  <pre><code>mod asdf {
      pub enum stuff {
          One,
          Two,
          Three
      }
  }
  </code></pre>
  
  <p>And my crate file test.rc:</p>
  
  <pre><code>mod thing;
  
  use thing::asdf::*;
  
  fn main(){
  
  } 
  </code></pre>
  
  <p>When I run rust build test.rc I get:</p>
  
  <pre><code>test.rc:3:0: 3:19 error: `use` and `extern mod` declarations must precede items
  test.rc:3 use thing::asdf::*;
            ^~~~~~~~~~~~~~~~~~~
  error: aborting due to previous error
  </code></pre>
  
  <p>There's obviously something simple about how modules, crates and use work that I'm just not getting. My understanding was that mod something; for files in the same directory or extern mod something; for libraries on the library path caused the object file to be linked. Then use would allow you to import parts of the module into the current file, function or module. This seems to work for stuff in the core library.</p>
  
  <p>This is with version 0.6 of the rust compiler.</p>