diff options
| author | bors <bors@rust-lang.org> | 2017-03-26 04:26:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-03-26 04:26:22 +0000 |
| commit | 7dd4e2db785c8ec360a989f69891b1e97dd4d369 (patch) | |
| tree | 223f7115ef30e9ec99983d7fad3bcf7ded5b9596 /src/librustc_driver | |
| parent | 0f5ddb953aafa8c63098dc1a32d3fdebaad82a5b (diff) | |
| parent | e341d603fe7c35ce174bd2e54e47ed6941ea4b03 (diff) | |
| download | rust-7dd4e2db785c8ec360a989f69891b1e97dd4d369.tar.gz rust-7dd4e2db785c8ec360a989f69891b1e97dd4d369.zip | |
Auto merge of #40347 - alexcrichton:rm-liblog, r=brson
Remove internal liblog
This commit deletes the internal liblog in favor of the implementation that
lives on crates.io. Similarly it's also setting a convention for adding crates
to the compiler. The main restriction right now is that we want compiler
implementation details to be unreachable from normal Rust code (e.g. requires a
feature), and by default everything in the sysroot is reachable via `extern
crate`.
The proposal here is to require that crates pulled in have these lines in their
`src/lib.rs`:
#![cfg_attr(rustbuild, feature(staged_api, rustc_private))]
#![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))]
This'll mean that by default they're not using these attributes but when
compiled as part of the compiler they do a few things:
* Mark themselves as entirely unstable via the `staged_api` feature and the
`#![unstable]` attribute.
* Allow usage of other unstable crates via `feature(rustc_private)` which is
required if the crate relies on any other crates to compile (other than std).
Diffstat (limited to 'src/librustc_driver')
| -rw-r--r-- | src/librustc_driver/Cargo.toml | 3 | ||||
| -rw-r--r-- | src/librustc_driver/driver.rs | 4 | ||||
| -rw-r--r-- | src/librustc_driver/lib.rs | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/librustc_driver/Cargo.toml b/src/librustc_driver/Cargo.toml index caa5c8b7e00..5b5113caa8e 100644 --- a/src/librustc_driver/Cargo.toml +++ b/src/librustc_driver/Cargo.toml @@ -11,7 +11,8 @@ crate-type = ["dylib"] [dependencies] arena = { path = "../libarena" } graphviz = { path = "../libgraphviz" } -log = { path = "../liblog" } +log = { version = "0.3", features = ["release_max_level_info"] } +env_logger = { version = "0.4", default-features = false } proc_macro_plugin = { path = "../libproc_macro_plugin" } rustc = { path = "../librustc" } rustc_back = { path = "../librustc_back" } diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index d37553d7d66..81095ad9f83 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -198,13 +198,13 @@ pub fn compile_input(sess: &Session, result?; - if log_enabled!(::log::INFO) { + if log_enabled!(::log::LogLevel::Info) { println!("Pre-trans"); tcx.print_debug_stats(); } let trans = phase_4_translate_to_llvm(tcx, analysis, &incremental_hashes_map); - if log_enabled!(::log::INFO) { + if log_enabled!(::log::LogLevel::Info) { println!("Post-trans"); tcx.print_debug_stats(); } diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 62d75126557..68b9f85721a 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -35,6 +35,7 @@ extern crate arena; extern crate getopts; extern crate graphviz; +extern crate env_logger; extern crate libc; extern crate rustc; extern crate rustc_back; @@ -1127,6 +1128,7 @@ pub fn diagnostics_registry() -> errors::registry::Registry { } pub fn main() { + env_logger::init().unwrap(); let result = run(|| run_compiler(&env::args().collect::<Vec<_>>(), &mut RustcDefaultCalls, None, |
