about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Nelson <jyn514@gmail.com>2020-09-15 08:40:10 -0400
committerJoshua Nelson <jyn514@gmail.com>2020-09-15 08:40:10 -0400
commitb93a8315f2fcff479a99e0694309fe12dbe095d5 (patch)
tree0f47a21d7b6b7af006158aa6154aa2d4d86b77b4
parentf7f9a6c1356dbc79394fbf93d485d6d8b44db380 (diff)
downloadrust-b93a8315f2fcff479a99e0694309fe12dbe095d5.tar.gz
rust-b93a8315f2fcff479a99e0694309fe12dbe095d5.zip
Add a comment why rustdoc loads crates from the sysroot
-rw-r--r--src/librustdoc/lib.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs
index 94e51d91b54..7762e8f8d4f 100644
--- a/src/librustdoc/lib.rs
+++ b/src/librustdoc/lib.rs
@@ -21,7 +21,11 @@ extern crate tracing;
 
 // N.B. these need `extern crate` even in 2018 edition
 // because they're loaded implicitly from the sysroot.
-// Dependencies listed in Cargo.toml do not need extern crate.
+// The reason they're loaded from the sysroot is because
+// the rustdoc artifacts aren't stored in rustc's cargo target directory.
+// So if `rustc` was specified in Cargo.toml, this would spuriously rebuild crates.
+//
+// Dependencies listed in Cargo.toml do not need `extern crate`.
 extern crate rustc_ast;
 extern crate rustc_ast_pretty;
 extern crate rustc_attr;