Skip to content

Commit 6146eda

Browse files
committed
Rollup merge of #24508 - steveklabnik:gh24228, r=alexcrichton
Fixes #24228
2 parents ab51427 + c776d02 commit 6146eda

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/doc/trpl/documentation.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,10 @@ $ rustdoc --test path/to/my/crate/root.rs
380380
$ cargo test
381381
```
382382

383-
That's right, `cargo test` tests embedded documentation too.
383+
That's right, `cargo test` tests embedded documentation too. However,
384+
`cargo test` will not test binary crates, only library ones. This is
385+
due to the way `rustdoc` works: it links against the library to be tested,
386+
but with a binary, there’s nothing to link to.
384387

385388
There are a few more annotations that are useful to help `rustdoc` do the right
386389
thing when testing your code:

0 commit comments

Comments
 (0)