title: How do I prevent `rust doc` from adding dependencies to documentation?
body: <p>I've just started playing with Rust and was trying to generate docs for the code I've written. When I issued <code>cargo doc</code>, I saw something a little weird.</p>
  
  <pre><code>21:53 $ cargo doc
     Compiling regex-syntax v0.2.2
     Compiling libc v0.2.2
     Compiling memchr v0.1.7
     Compiling aho-corasick v0.3.4
     Compiling regex v0.1.41
     Compiling my_project v0.0.1 (path/to/my_project)
  </code></pre>
  
  <p>When I opened <code>my_project/target/doc/my_project/index.html</code>, I noticed that all of the dependencies were included in my docs:</p>
  
  <blockquote>
    <p><a href="https://i.stack.imgur.com/Prdun.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Prdun.png" alt="Those damn crates"></a></p>
  </blockquote>
  
  <p>I'd like these dependencies' documentations to be hidden from the user so my documentation only shows how to use <em>my</em> code.</p>
  
  <p>How can I do this? </p>
  
  <h1>Cargo.lock</h1>
  
  <pre><code>[root]
  name = "my_project"
  version = "0.0.1"
  dependencies = [
   "regex 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)",
  ]
  
  [[package]]
  name = "aho-corasick"
  version = "0.3.4"
  source = "registry+https://github.com/rust-lang/crates.io-index"
  dependencies = [
   "memchr 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
  ]
  
  [[package]]
  name = "libc"
  version = "0.2.2"
  source = "registry+https://github.com/rust-lang/crates.io-index"
  
  [[package]]
  name = "memchr"
  version = "0.1.7"
  source = "registry+https://github.com/rust-lang/crates.io-index"
  dependencies = [
   "libc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  ]
  
  [[package]]
  name = "regex"
  version = "0.1.41"
  source = "registry+https://github.com/rust-lang/crates.io-index"
  dependencies = [
   "aho-corasick 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
   "memchr 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
   "regex-syntax 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  ]
  
  [[package]]
  name = "regex-syntax"
  version = "0.2.2"
  source = "registry+https://github.com/rust-lang/crates.io-index"
  </code></pre>