未验证 提交 6e57eecb 编写于 作者: T Tyler Mandry 提交者: GitHub

Rollup merge of #76728 - jyn514:rustdoc-extern-crate, r=ehuss

Add a comment why `extern crate` is necessary for rustdoc

r? @ehuss

From https://github.com/rust-lang/rust/pull/74293#discussion_r488335500.
......@@ -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;
......@@ -42,8 +52,6 @@
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册