Skip to content

Commit b93a831

Browse files
committed
Add a comment why rustdoc loads crates from the sysroot
1 parent f7f9a6c commit b93a831

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustdoc/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ extern crate tracing;
2121

2222
// N.B. these need `extern crate` even in 2018 edition
2323
// because they're loaded implicitly from the sysroot.
24-
// Dependencies listed in Cargo.toml do not need extern crate.
24+
// The reason they're loaded from the sysroot is because
25+
// the rustdoc artifacts aren't stored in rustc's cargo target directory.
26+
// So if `rustc` was specified in Cargo.toml, this would spuriously rebuild crates.
27+
//
28+
// Dependencies listed in Cargo.toml do not need `extern crate`.
2529
extern crate rustc_ast;
2630
extern crate rustc_ast_pretty;
2731
extern crate rustc_attr;

0 commit comments

Comments
 (0)