title: Unresolved import in documentation example
body: <p>I'm having difficulty fixing an error inside my documentation example for my library. I have the file structure like for my crate <code>bignum</code></p>
  
  <pre><code>.
  |-- Cargo.lock
  |-- Cargo.toml
  |-- examples
  |   |-- dat
  |   |   `-- euler_13.dat
  |   |-- debug.rs
  |   `-- euler_13.rs
  |-- README.md
  |-- src
  |   |-- error.rs
  |   |-- inits.rs
  |   `-- lib.rs
  </code></pre>
  
  <p>In my examples, my headers will look something like </p>
  
  <pre><code>// euler_13.rs 
  extern crate bignum;
  use bignum::inits::Zero;
  
  // ...
  </code></pre>
  
  <p>This compiles and works great, but now when I'm writing an example inside my documentation at <code>lib.rs</code>, I can't seem to import <code>bignum::inits::Zero</code></p>
  
  <pre><code>//lib.rs
  //...
  
  impl BigNum {
  
      //...
  
  
      /// Constructs a ...
      ///
      /// # Examples
      ///
      /// ```
      /// extern crate bignum;
      /// use bignum::inits::Zero;
      ///
      /// let a = bignum::BigNum::new(Zero::zero());
      /// ```
      ///
      pub fn new(base: BigNum) -&gt; BigNum {
          // ...
      }
  </code></pre>
  
  <p>When I run <code>cargo test</code>, I receive this error</p>
  
  <pre><code>     Running target/debug/lib-fe3dd7a75a504b04
  
  running 3 tests
  test crate_from_u32 ... ok
  test create_from_string ... ok
  test adding_no_carry ... ok
  
  test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured
  
     Doc-tests bignum
  
  running 1 test
  test new_0 ... FAILED
  
  failures:
  
  ---- new_0 stdout ----
      &lt;anon&gt;:3:9: 3:15 error: unresolved import `self::bignum::inits::Zero`. Did you mean `self::self::bignum::inits`?
  &lt;anon&gt;:3     use self::bignum::inits::Zero;
                   ^~~~~~
  error: aborting due to previous error
  thread 'new_0' panicked at 'Box&lt;Any&gt;', /home/rustbuild/src/rust-buildbot/slave/stable-dist-rustc-linux/build/src/libsyntax/diagnostic.rs:192
  
  
  
  failures:
      new_0
  </code></pre>
  
  <p>I've seen <a href="https://stackoverflow.com/questions/31035491/error-using-local-modules-in-documentation-tests">this</a> question, but this deals with importing modules from the same file which still require toplevel scope. However here i'm still specifying top level scope with <code>bignum::</code>.</p>
  
  <p>So while importing <code>bignum::inits::Zero</code> works for all of my tests and examples, it doesn't work for my docs. Why is that? I've tried appending <code>self::</code> in front and receive the same error. If i change the doc examples to</p>
  
  <pre><code>extern crate bignum;
  
  let a = bignum::BigNum::new(bignum::inits::Zero::zero());
  </code></pre>
  
  <p>it compiles fine however. How can I correctly import my modules?</p>