Skip to content

Commit a63c039

Browse files
committed
Auto merge of rust-lang#143548 - Diggsey:db-limit-extern-crate-usage, r=oli-obk
Restrict sysroot crate imports to those defined in this repo. It's common to import dependencies from the sysroot via `extern crate` rather than use an explicit cargo dependency, when it's necessary to use the same dependency version as used by rustc itself. However, this is dangerous for crates.io crates, since rustc may not pull in the dependency on some targets, or may pull in multiple versions. In both cases, the `extern crate` fails to resolve. To address this, re-export all such dependencies from the appropriate `rustc_*` crates, and use this alias from crates which would otherwise need to use `extern crate`. See rust-lang#143492 for an example of the kind of issue that can occur.
2 parents 4629f31 + f3d5c10 commit a63c039

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,12 @@ extern crate rustc_fs_util;
2626
extern crate rustc_hir;
2727
extern crate rustc_incremental;
2828
extern crate rustc_index;
29+
extern crate rustc_log;
2930
extern crate rustc_metadata;
3031
extern crate rustc_session;
3132
extern crate rustc_span;
3233
extern crate rustc_symbol_mangling;
3334
extern crate rustc_target;
34-
#[macro_use]
35-
extern crate tracing;
3635

3736
// This prevents duplicating functions and statics that are already part of the host rustc process.
3837
#[allow(unused_extern_crates)]
@@ -46,6 +45,7 @@ use cranelift_codegen::isa::TargetIsa;
4645
use cranelift_codegen::settings::{self, Configurable};
4746
use rustc_codegen_ssa::traits::CodegenBackend;
4847
use rustc_codegen_ssa::{CodegenResults, TargetConfig};
48+
use rustc_log::tracing::info;
4949
use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
5050
use rustc_session::Session;
5151
use rustc_session::config::OutputFilenames;

0 commit comments

Comments
 (0)