]> git.lizzy.rs Git - rust.git/commitdiff
Make note of documentation tests and binaries
authorSteve Klabnik <steve@steveklabnik.com>
Thu, 16 Apr 2015 19:55:10 +0000 (15:55 -0400)
committerSteve Klabnik <steve@steveklabnik.com>
Thu, 16 Apr 2015 19:55:10 +0000 (15:55 -0400)
Fixes #24228

src/doc/trpl/documentation.md

index 06071a8f15fa4e83b564bd27730cc204587b8267..06db63853698d48d486721028f1b1c8b42284188 100644 (file)
@@ -380,7 +380,10 @@ $ rustdoc --test path/to/my/crate/root.rs
 $ cargo test
 ```
 
-That's right, `cargo test` tests embedded documentation too.
+That's right, `cargo test` tests embedded documentation too. However, 
+`cargo test` will not test binary crates, only library ones. This is
+due to the way `rustdoc` works: it links against the library to be tested,
+but with a binary, there’s nothing to link to.
 
 There are a few more annotations that are useful to help `rustdoc` do the right
 thing when testing your code: