Skip to content

Commit

Permalink
Rollup merge of rust-lang#76728 - jyn514:rustdoc-extern-crate, r=ehuss
Browse files Browse the repository at this point in the history
Add a comment why `extern crate` is necessary for rustdoc

r? @ehuss

From rust-lang#74293 (comment).
  • Loading branch information
tmandry authored Sep 16, 2020
2 parents 153fb91 + b93a831 commit 6e57eec
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/librustdoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@

#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate tracing;

// N.B. these need `extern crate` even in 2018 edition
// because they're loaded implicitly from the sysroot.
// 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;
Expand All @@ -42,8 +52,6 @@ extern crate rustc_target;
extern crate rustc_trait_selection;
extern crate rustc_typeck;
extern crate test as testing;
#[macro_use]
extern crate tracing;

use std::default::Default;
use std::env;
Expand Down

0 comments on commit 6e57eec

Please sign in to comment.