From 48b3b07099296825895e33dc0869f2c6d6f0482e Mon Sep 17 00:00:00 2001 From: Gurpreet Singh Date: Mon, 3 Aug 2020 00:29:36 -0700 Subject: [PATCH 1/3] renaming log to tracing --- src/librustc_session/Cargo.toml | 2 +- src/librustc_session/cgu_reuse_tracker.rs | 2 +- src/librustc_session/filesearch.rs | 14 +++++++++--- src/librustc_span/Cargo.toml | 2 +- src/librustc_span/hygiene.rs | 8 +++++-- src/librustc_span/source_map.rs | 8 +++++-- src/librustc_symbol_mangling/Cargo.toml | 2 +- src/librustc_symbol_mangling/legacy.rs | 2 +- src/librustc_symbol_mangling/lib.rs | 2 +- src/librustc_target/Cargo.toml | 2 +- src/librustc_target/lib.rs | 2 +- src/librustc_trait_selection/Cargo.toml | 2 +- src/librustc_trait_selection/lib.rs | 2 +- src/librustc_traits/Cargo.toml | 2 +- src/librustc_traits/lib.rs | 2 +- src/librustc_ty/Cargo.toml | 2 +- src/librustc_ty/instance.rs | 2 +- src/librustc_ty/lib.rs | 2 +- src/librustc_typeck/Cargo.toml | 2 +- src/librustc_typeck/lib.rs | 8 +++++-- src/tools/compiletest/Cargo.toml | 2 +- src/tools/compiletest/src/errors.rs | 2 +- src/tools/compiletest/src/header.rs | 8 +++++-- src/tools/compiletest/src/main.rs | 8 +++++-- src/tools/compiletest/src/runtest.rs | 26 ++++++++++++++++++----- src/tools/compiletest/src/util.rs | 8 +++++-- 26 files changed, 86 insertions(+), 38 deletions(-) diff --git a/src/librustc_session/Cargo.toml b/src/librustc_session/Cargo.toml index 35c227df8500a..2200f8bfbabf6 100644 --- a/src/librustc_session/Cargo.toml +++ b/src/librustc_session/Cargo.toml @@ -11,7 +11,7 @@ path = "lib.rs" [dependencies] bitflags = "1.2.1" getopts = "0.2" -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_errors = { path = "../librustc_errors" } rustc_feature = { path = "../librustc_feature" } rustc_target = { path = "../librustc_target" } diff --git a/src/librustc_session/cgu_reuse_tracker.rs b/src/librustc_session/cgu_reuse_tracker.rs index ace233611223c..0eec12aa03f2d 100644 --- a/src/librustc_session/cgu_reuse_tracker.rs +++ b/src/librustc_session/cgu_reuse_tracker.rs @@ -2,10 +2,10 @@ //! compilation. This is used for incremental compilation tests and debug //! output. -use log::debug; use rustc_data_structures::fx::FxHashMap; use rustc_span::{Span, Symbol}; use std::sync::{Arc, Mutex}; +use tracing::debug; #[derive(Copy, Clone, Debug, PartialEq, PartialOrd)] pub enum CguReuse { diff --git a/src/librustc_session/filesearch.rs b/src/librustc_session/filesearch.rs index 504490d938cfa..c5d1ed80070a3 100644 --- a/src/librustc_session/filesearch.rs +++ b/src/librustc_session/filesearch.rs @@ -8,8 +8,8 @@ use std::fs; use std::path::{Path, PathBuf}; use crate::search_paths::{PathKind, SearchPath, SearchPathFile}; -use log::debug; use rustc_fs_util::fix_windows_verbatim_for_gcc; +use tracing::debug; #[derive(Copy, Clone)] pub enum FileMatch { @@ -52,7 +52,11 @@ impl<'a> FileSearch<'a> { for search_path in self.search_paths() { debug!("searching {}", search_path.dir.display()); fn is_rlib(spf: &SearchPathFile) -> bool { - if let Some(f) = &spf.file_name_str { f.ends_with(".rlib") } else { false } + if let Some(f) = &spf.file_name_str { + f.ends_with(".rlib") + } else { + false + } } // Reading metadata out of rlibs is faster, and if we find both // an rlib and a dylib we only read one of the files of @@ -98,7 +102,11 @@ impl<'a> FileSearch<'a> { p.push(RUST_LIB_DIR); p.push(&self.triple); p.push("bin"); - if self_contained { vec![p.clone(), p.join("self-contained")] } else { vec![p.clone()] } + if self_contained { + vec![p.clone(), p.join("self-contained")] + } else { + vec![p.clone()] + } } } diff --git a/src/librustc_span/Cargo.toml b/src/librustc_span/Cargo.toml index 2db417ce0e129..dd4928d4e324b 100644 --- a/src/librustc_span/Cargo.toml +++ b/src/librustc_span/Cargo.toml @@ -18,6 +18,6 @@ rustc_arena = { path = "../librustc_arena" } scoped-tls = "1.0" unicode-width = "0.1.4" cfg-if = "0.1.2" -log = { package = "tracing", version = "0.1" } +tracing = "0.1" sha-1 = "0.8" md-5 = "0.8" diff --git a/src/librustc_span/hygiene.rs b/src/librustc_span/hygiene.rs index a03ac4e1fdba1..8d420ad625aaa 100644 --- a/src/librustc_span/hygiene.rs +++ b/src/librustc_span/hygiene.rs @@ -30,7 +30,6 @@ use crate::SESSION_GLOBALS; use crate::{Span, DUMMY_SP}; use crate::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; -use log::*; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::sync::{Lock, Lrc}; use rustc_macros::HashStable_Generic; @@ -38,6 +37,7 @@ use rustc_serialize::{ Decodable, Decoder, Encodable, Encoder, UseSpecializedDecodable, UseSpecializedEncodable, }; use std::fmt; +use tracing::*; /// A `SyntaxContext` represents a chain of pairs `(ExpnId, Transparency)` named "marks". #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -759,7 +759,11 @@ impl ExpnData { #[inline] pub fn is_root(&self) -> bool { - if let ExpnKind::Root = self.kind { true } else { false } + if let ExpnKind::Root = self.kind { + true + } else { + false + } } } diff --git a/src/librustc_span/source_map.rs b/src/librustc_span/source_map.rs index e062c7766e7dc..628cf6a904bd6 100644 --- a/src/librustc_span/source_map.rs +++ b/src/librustc_span/source_map.rs @@ -19,9 +19,9 @@ use std::hash::Hash; use std::path::{Path, PathBuf}; use std::sync::atomic::Ordering; -use log::debug; use std::fs; use std::io; +use tracing::debug; #[cfg(test)] mod tests; @@ -902,7 +902,11 @@ impl SourceMap { } debug!("find_width_of_character_at_span: final target=`{:?}`", target); - if forwards { (target - end_index) as u32 } else { (end_index - target) as u32 } + if forwards { + (target - end_index) as u32 + } else { + (end_index - target) as u32 + } } pub fn get_source_file(&self, filename: &FileName) -> Option> { diff --git a/src/librustc_symbol_mangling/Cargo.toml b/src/librustc_symbol_mangling/Cargo.toml index 757d86bd95afd..b44c0e4e027ce 100644 --- a/src/librustc_symbol_mangling/Cargo.toml +++ b/src/librustc_symbol_mangling/Cargo.toml @@ -10,7 +10,7 @@ path = "lib.rs" doctest = false [dependencies] -log = { package = "tracing", version = "0.1" } +tracing = "0.1" punycode = "0.4.0" rustc-demangle = "0.1.16" diff --git a/src/librustc_symbol_mangling/legacy.rs b/src/librustc_symbol_mangling/legacy.rs index 90c89ea6b0a86..2ae13b501e941 100644 --- a/src/librustc_symbol_mangling/legacy.rs +++ b/src/librustc_symbol_mangling/legacy.rs @@ -8,7 +8,7 @@ use rustc_middle::ty::subst::{GenericArg, GenericArgKind}; use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeFoldable}; use rustc_middle::util::common::record_time; -use log::debug; +use tracing::debug; use std::fmt::{self, Write}; use std::mem::{self, discriminant}; diff --git a/src/librustc_symbol_mangling/lib.rs b/src/librustc_symbol_mangling/lib.rs index 2579cf53d3d50..4276d04cdd0b4 100644 --- a/src/librustc_symbol_mangling/lib.rs +++ b/src/librustc_symbol_mangling/lib.rs @@ -106,7 +106,7 @@ use rustc_middle::ty::subst::SubstsRef; use rustc_middle::ty::{self, Instance, TyCtxt}; use rustc_session::config::SymbolManglingVersion; -use log::debug; +use tracing::debug; mod legacy; mod v0; diff --git a/src/librustc_target/Cargo.toml b/src/librustc_target/Cargo.toml index 21796e8498568..d2b50f44e43d9 100644 --- a/src/librustc_target/Cargo.toml +++ b/src/librustc_target/Cargo.toml @@ -10,7 +10,7 @@ path = "lib.rs" [dependencies] bitflags = "1.2.1" -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_data_structures = { path = "../librustc_data_structures" } rustc_macros = { path = "../librustc_macros" } rustc_serialize = { path = "../librustc_serialize" } diff --git a/src/librustc_target/lib.rs b/src/librustc_target/lib.rs index 1d0dc660ee616..0db675f7245d1 100644 --- a/src/librustc_target/lib.rs +++ b/src/librustc_target/lib.rs @@ -21,7 +21,7 @@ extern crate rustc_macros; #[macro_use] -extern crate log; +extern crate tracing; pub mod abi; pub mod asm; diff --git a/src/librustc_trait_selection/Cargo.toml b/src/librustc_trait_selection/Cargo.toml index c43fe3f2c0c89..444023baa695f 100644 --- a/src/librustc_trait_selection/Cargo.toml +++ b/src/librustc_trait_selection/Cargo.toml @@ -11,7 +11,7 @@ doctest = false [dependencies] rustc_parse_format = { path = "../librustc_parse_format" } -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_attr = { path = "../librustc_attr" } rustc_middle = { path = "../librustc_middle" } rustc_ast = { path = "../librustc_ast" } diff --git a/src/librustc_trait_selection/lib.rs b/src/librustc_trait_selection/lib.rs index 4692fa04ed587..b5882df47294e 100644 --- a/src/librustc_trait_selection/lib.rs +++ b/src/librustc_trait_selection/lib.rs @@ -24,7 +24,7 @@ extern crate rustc_macros; #[macro_use] extern crate rustc_data_structures; #[macro_use] -extern crate log; +extern crate tracing; #[macro_use] extern crate rustc_middle; diff --git a/src/librustc_traits/Cargo.toml b/src/librustc_traits/Cargo.toml index f8487982e3d49..f5545f562938f 100644 --- a/src/librustc_traits/Cargo.toml +++ b/src/librustc_traits/Cargo.toml @@ -9,7 +9,7 @@ name = "rustc_traits" path = "lib.rs" [dependencies] -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_middle = { path = "../librustc_middle" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_hir = { path = "../librustc_hir" } diff --git a/src/librustc_traits/lib.rs b/src/librustc_traits/lib.rs index b8e23760ba5d4..6fea4732dda3f 100644 --- a/src/librustc_traits/lib.rs +++ b/src/librustc_traits/lib.rs @@ -8,7 +8,7 @@ #![recursion_limit = "256"] #[macro_use] -extern crate log; +extern crate tracing; #[macro_use] extern crate rustc_middle; diff --git a/src/librustc_ty/Cargo.toml b/src/librustc_ty/Cargo.toml index 6cdb353000278..adc9740c2c173 100644 --- a/src/librustc_ty/Cargo.toml +++ b/src/librustc_ty/Cargo.toml @@ -9,7 +9,7 @@ name = "rustc_ty" path = "lib.rs" [dependencies] -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_middle = { path = "../librustc_middle" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_errors = { path = "../librustc_errors" } diff --git a/src/librustc_ty/instance.rs b/src/librustc_ty/instance.rs index 1e0c4055af3c5..d0bd88af1ffd1 100644 --- a/src/librustc_ty/instance.rs +++ b/src/librustc_ty/instance.rs @@ -8,7 +8,7 @@ use rustc_target::spec::abi::Abi; use rustc_trait_selection::traits; use traits::{translate_substs, Reveal}; -use log::debug; +use tracing::debug; fn resolve_instance<'tcx>( tcx: TyCtxt<'tcx>, diff --git a/src/librustc_ty/lib.rs b/src/librustc_ty/lib.rs index 8f3b20c7aaf40..6e9042d1ba7c8 100644 --- a/src/librustc_ty/lib.rs +++ b/src/librustc_ty/lib.rs @@ -12,7 +12,7 @@ #[macro_use] extern crate rustc_middle; #[macro_use] -extern crate log; +extern crate tracing; use rustc_middle::ty::query::Providers; diff --git a/src/librustc_typeck/Cargo.toml b/src/librustc_typeck/Cargo.toml index 963deda162d62..82c6ac7a0cd73 100644 --- a/src/librustc_typeck/Cargo.toml +++ b/src/librustc_typeck/Cargo.toml @@ -12,7 +12,7 @@ doctest = false [dependencies] rustc_arena = { path = "../librustc_arena" } -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_middle = { path = "../librustc_middle" } rustc_attr = { path = "../librustc_attr" } rustc_data_structures = { path = "../librustc_data_structures" } diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 9ba2545ba63cb..1f30f981235d1 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -69,7 +69,7 @@ This API is completely unstable and subject to change. #![recursion_limit = "256"] #[macro_use] -extern crate log; +extern crate tracing; #[macro_use] extern crate rustc_middle; @@ -367,7 +367,11 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorReported> { check_unused::check_crate(tcx); check_for_entry_fn(tcx); - if tcx.sess.err_count() == 0 { Ok(()) } else { Err(ErrorReported) } + if tcx.sess.err_count() == 0 { + Ok(()) + } else { + Err(ErrorReported) + } } /// A quasi-deprecated helper used in rustdoc and clippy to get diff --git a/src/tools/compiletest/Cargo.toml b/src/tools/compiletest/Cargo.toml index bd4c5949800f6..c601084d11917 100644 --- a/src/tools/compiletest/Cargo.toml +++ b/src/tools/compiletest/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" diff = "0.1.10" env_logger = { version = "0.7", default-features = false } getopts = "0.2" -log = { package = "tracing", version = "0.1" } +tracing = "0.1" regex = "1.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/src/tools/compiletest/src/errors.rs b/src/tools/compiletest/src/errors.rs index 8f685fb8559f5..8edc9c9cd038e 100644 --- a/src/tools/compiletest/src/errors.rs +++ b/src/tools/compiletest/src/errors.rs @@ -8,8 +8,8 @@ use std::path::Path; use std::str::FromStr; use lazy_static::lazy_static; -use log::*; use regex::Regex; +use tracing::*; #[derive(Clone, Debug, PartialEq)] pub enum ErrorKind { diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 047fbe9da14fe..1570ff5d67f26 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -5,7 +5,7 @@ use std::io::prelude::*; use std::io::BufReader; use std::path::{Path, PathBuf}; -use log::*; +use tracing::*; use crate::common::{CompareMode, Config, Debugger, FailMode, Mode, PassMode}; use crate::extract_gdb_version; @@ -842,7 +842,11 @@ impl Config { None => false, }; - if is_match { ParsedNameDirective::Match } else { ParsedNameDirective::NoMatch } + if is_match { + ParsedNameDirective::Match + } else { + ParsedNameDirective::NoMatch + } } fn has_cfg_prefix(&self, line: &str, prefix: &str) -> bool { diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index bf3510ea0894b..5a2c7e8e354d6 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -9,7 +9,6 @@ use crate::common::{expected_output_path, output_base_dir, output_relative_path, use crate::common::{CompareMode, Config, Debugger, Mode, PassMode, Pretty, TestPaths}; use crate::util::logv; use getopts::Options; -use log::*; use std::env; use std::ffi::OsString; use std::fs; @@ -18,6 +17,7 @@ use std::path::{Path, PathBuf}; use std::process::Command; use std::time::SystemTime; use test::ColorConfig; +use tracing::*; use walkdir::WalkDir; use self::header::EarlyProps; @@ -158,7 +158,11 @@ pub fn parse_config(args: Vec) -> Config { } fn make_absolute(path: PathBuf) -> PathBuf { - if path.is_relative() { env::current_dir().unwrap().join(path) } else { path } + if path.is_relative() { + env::current_dir().unwrap().join(path) + } else { + path + } } let target = opt_str2(matches.opt_str("target")); diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 940e16720f6a9..39252f08b046e 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -30,7 +30,7 @@ use std::str; use glob::glob; use lazy_static::lazy_static; -use log::*; +use tracing::*; use crate::extract_gdb_version; use crate::is_android_gdb_target; @@ -2098,7 +2098,11 @@ impl<'test> TestCx<'test> { Some(ref s) => s .split(' ') .filter_map(|s| { - if s.chars().all(|c| c.is_whitespace()) { None } else { Some(s.to_owned()) } + if s.chars().all(|c| c.is_whitespace()) { + None + } else { + Some(s.to_owned()) + } }) .collect(), None => Vec::new(), @@ -2157,7 +2161,11 @@ impl<'test> TestCx<'test> { /// The revision, ignored for incremental compilation since it wants all revisions in /// the same directory. fn safe_revision(&self) -> Option<&str> { - if self.config.mode == Incremental { None } else { self.revision } + if self.config.mode == Incremental { + None + } else { + self.revision + } } /// Gets the absolute path to the directory where all output for the given @@ -2294,7 +2302,11 @@ impl<'test> TestCx<'test> { fn charset() -> &'static str { // FreeBSD 10.1 defaults to GDB 6.1.1 which doesn't support "auto" charset - if cfg!(target_os = "freebsd") { "ISO-8859-1" } else { "UTF-8" } + if cfg!(target_os = "freebsd") { + "ISO-8859-1" + } else { + "UTF-8" + } } fn run_rustdoc_test(&self) { @@ -3497,7 +3509,11 @@ impl<'test> TestCx<'test> { for output_file in files { println!("Actual {} saved to {}", kind, output_file.display()); } - if self.config.bless { 0 } else { 1 } + if self.config.bless { + 0 + } else { + 1 + } } fn prune_duplicate_output(&self, mode: CompareMode, kind: &str, canon_content: &str) { diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs index 0437ff8c9440a..c03c2e8d4d8de 100644 --- a/src/tools/compiletest/src/util.rs +++ b/src/tools/compiletest/src/util.rs @@ -3,7 +3,7 @@ use std::env; use std::ffi::OsStr; use std::path::PathBuf; -use log::*; +use tracing::*; #[cfg(test)] mod tests; @@ -126,7 +126,11 @@ pub fn get_arch(triple: &str) -> &'static str { } pub fn matches_env(triple: &str, name: &str) -> bool { - if let Some(env) = triple.split('-').nth(3) { env.starts_with(name) } else { false } + if let Some(env) = triple.split('-').nth(3) { + env.starts_with(name) + } else { + false + } } pub fn get_pointer_width(triple: &str) -> &'static str { From 2a8e87e446b3cd0d885e96359a9b5cce1c891d23 Mon Sep 17 00:00:00 2001 From: Gurpreet Singh Date: Mon, 3 Aug 2020 12:01:34 -0700 Subject: [PATCH 2/3] fixed missing log reference : : --- src/librustc_session/config.rs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/librustc_session/config.rs b/src/librustc_session/config.rs index 9fcdd46539c46..01f8d683ded5f 100644 --- a/src/librustc_session/config.rs +++ b/src/librustc_session/config.rs @@ -716,7 +716,7 @@ pub fn default_configuration(sess: &Session) -> CrateConfig { let mut ret = FxHashSet::default(); ret.reserve(6); // the minimum number of insertions - // Target bindings. + // Target bindings. ret.insert((sym::target_os, Some(Symbol::intern(os)))); if let Some(ref fam) = sess.target.target.options.target_family { ret.insert((sym::target_family, Some(Symbol::intern(fam)))); @@ -875,7 +875,11 @@ mod opt { } fn longer(a: S, b: S) -> S { - if a.len() > b.len() { a } else { b } + if a.len() > b.len() { + a + } else { + b + } } pub fn opt_s(a: S, b: S, c: S, d: S) -> R { @@ -1410,7 +1414,11 @@ fn parse_opt_level( .into_iter() .flat_map( |(i, s)| { - if let Some("opt-level") = s.splitn(2, '=').next() { Some(i) } else { None } + if let Some("opt-level") = s.splitn(2, '=').next() { + Some(i) + } else { + None + } }, ) .max(); @@ -1449,7 +1457,11 @@ fn select_debuginfo( .into_iter() .flat_map( |(i, s)| { - if let Some("debuginfo") = s.splitn(2, '=').next() { Some(i) } else { None } + if let Some("debuginfo") = s.splitn(2, '=').next() { + Some(i) + } else { + None + } }, ) .max(); @@ -1876,7 +1888,7 @@ fn parse_pretty( } } }; - log::debug!("got unpretty option: {:?}", first); + tracing::debug!("got unpretty option: {:?}", first); first } } From 2a9b56710a0813cc405d2f46314d7ca8c862037b Mon Sep 17 00:00:00 2001 From: Gurpreet Singh Date: Tue, 11 Aug 2020 22:57:43 -0700 Subject: [PATCH 3/3] replace log with tracing, fixed fmt --- Cargo.lock | 415 ++++++++++++++---- src/librustc_ast/Cargo.toml | 2 +- src/librustc_ast/util/literal.rs | 2 +- src/librustc_driver/Cargo.toml | 2 +- src/librustc_driver/lib.rs | 6 +- src/librustc_errors/Cargo.toml | 2 +- src/librustc_errors/diagnostic_builder.rs | 2 +- src/librustc_errors/emitter.rs | 2 +- src/librustc_errors/lib.rs | 2 +- src/librustc_expand/Cargo.toml | 2 +- src/librustc_expand/mbe/macro_rules.rs | 2 +- src/librustc_hir/Cargo.toml | 2 +- src/librustc_hir/definitions.rs | 2 +- src/librustc_incremental/Cargo.toml | 2 +- src/librustc_incremental/lib.rs | 2 +- src/librustc_infer/Cargo.toml | 2 +- src/librustc_infer/lib.rs | 2 +- src/librustc_interface/Cargo.toml | 2 +- src/librustc_interface/interface.rs | 2 +- src/librustc_interface/passes.rs | 8 +- src/librustc_interface/queries.rs | 2 +- src/librustc_interface/util.rs | 2 +- src/librustc_lint/Cargo.toml | 2 +- src/librustc_lint/builtin.rs | 2 +- src/librustc_lint/early.rs | 2 +- src/librustc_lint/late.rs | 2 +- src/librustc_lint/types.rs | 2 +- src/librustc_lint/unused.rs | 2 +- src/librustc_metadata/Cargo.toml | 2 +- src/librustc_metadata/creader.rs | 2 +- src/librustc_metadata/dependency_format.rs | 6 +- src/librustc_metadata/locator.rs | 2 +- src/librustc_metadata/rmeta/decoder.rs | 2 +- src/librustc_metadata/rmeta/encoder.rs | 2 +- src/librustc_metadata/rmeta/table.rs | 2 +- src/librustc_middle/Cargo.toml | 2 +- src/librustc_middle/lib.rs | 2 +- src/librustc_mir/Cargo.toml | 2 +- .../diagnostics/outlives_suggestion.rs | 2 +- src/librustc_mir/lib.rs | 2 +- src/librustc_mir_build/Cargo.toml | 2 +- src/librustc_mir_build/lib.rs | 2 +- src/librustc_parse/Cargo.toml | 2 +- src/librustc_parse/lexer/mod.rs | 2 +- .../lexer/unescape_error_reporting.rs | 2 +- src/librustc_parse/lib.rs | 2 +- src/librustc_parse/parser/attr.rs | 2 +- src/librustc_parse/parser/diagnostics.rs | 2 +- src/librustc_parse/parser/expr.rs | 2 +- src/librustc_parse/parser/item.rs | 2 +- src/librustc_parse/parser/mod.rs | 2 +- src/librustc_parse/parser/path.rs | 2 +- src/librustc_passes/Cargo.toml | 2 +- src/librustc_passes/lib.rs | 2 +- src/librustc_privacy/Cargo.toml | 2 +- src/librustc_privacy/lib.rs | 2 +- src/librustc_query_system/Cargo.toml | 2 +- src/librustc_query_system/lib.rs | 2 +- src/librustc_resolve/Cargo.toml | 2 +- src/librustc_resolve/build_reduced_graph.rs | 2 +- src/librustc_resolve/def_collector.rs | 2 +- src/librustc_resolve/diagnostics.rs | 2 +- src/librustc_resolve/imports.rs | 2 +- src/librustc_resolve/late.rs | 9 +- src/librustc_resolve/late/diagnostics.rs | 2 +- src/librustc_resolve/late/lifetimes.rs | 2 +- src/librustc_resolve/lib.rs | 2 +- src/librustc_save_analysis/Cargo.toml | 2 +- src/librustc_save_analysis/dump_visitor.rs | 2 +- src/librustc_save_analysis/lib.rs | 2 +- src/librustc_session/config.rs | 20 +- src/librustc_session/filesearch.rs | 12 +- src/librustc_span/hygiene.rs | 6 +- src/librustc_span/source_map.rs | 6 +- src/librustc_typeck/lib.rs | 6 +- src/tools/compiletest/src/header.rs | 6 +- src/tools/compiletest/src/main.rs | 6 +- src/tools/compiletest/src/runtest.rs | 24 +- src/tools/compiletest/src/util.rs | 6 +- 79 files changed, 418 insertions(+), 248 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 87471451fa754..5378b1e5c8247 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2466,13 +2466,13 @@ dependencies = [ "lazy_static", "log", "rls-span", - "rustc-ap-rustc_ast", - "rustc-ap-rustc_ast_pretty", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_errors", - "rustc-ap-rustc_parse", - "rustc-ap-rustc_session", - "rustc-ap-rustc_span", + "rustc-ap-rustc_ast 671.0.0", + "rustc-ap-rustc_ast_pretty 671.0.0", + "rustc-ap-rustc_data_structures 671.0.0", + "rustc-ap-rustc_errors 671.0.0", + "rustc-ap-rustc_parse 671.0.0", + "rustc-ap-rustc_session 671.0.0", + "rustc-ap-rustc_span 671.0.0", ] [[package]] @@ -2802,13 +2802,41 @@ dependencies = [ "mdbook", ] +[[package]] +name = "rustc-ap-rustc_arena" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9cdd301e9dcb15ead384fc07196c850fd22829fae81d296b2ed6b4b10bf3278" +dependencies = [ + "rustc-ap-rustc_data_structures 669.0.0", + "smallvec 1.4.0", +] + [[package]] name = "rustc-ap-rustc_arena" version = "671.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a3941333c39ffa778611a34692244052fc9ba0f6b02dcf019c8d24925707dd6" dependencies = [ - "rustc-ap-rustc_data_structures", + "rustc-ap-rustc_data_structures 671.0.0", + "smallvec 1.4.0", +] + +[[package]] +name = "rustc-ap-rustc_ast" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f7c0d0537ca69dfe4a49212035295dfb37a235b5df01aa877d50b247f4775b8" +dependencies = [ + "bitflags", + "log", + "rustc-ap-rustc_data_structures 669.0.0", + "rustc-ap-rustc_index 669.0.0", + "rustc-ap-rustc_lexer 669.0.0", + "rustc-ap-rustc_macros 669.0.0", + "rustc-ap-rustc_serialize 669.0.0", + "rustc-ap-rustc_span 669.0.0", + "scoped-tls", "smallvec 1.4.0", ] @@ -2820,33 +2848,45 @@ checksum = "27c579f7d89e6fc971b433e92bb2b8c65b716d7c797b21de8685945be9455610" dependencies = [ "bitflags", "log", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_index", - "rustc-ap-rustc_lexer", - "rustc-ap-rustc_macros", - "rustc-ap-rustc_serialize", - "rustc-ap-rustc_span", + "rustc-ap-rustc_data_structures 671.0.0", + "rustc-ap-rustc_index 671.0.0", + "rustc-ap-rustc_lexer 671.0.0", + "rustc-ap-rustc_macros 671.0.0", + "rustc-ap-rustc_serialize 671.0.0", + "rustc-ap-rustc_span 671.0.0", "scoped-tls", "smallvec 1.4.0", ] [[package]] name = "rustc-ap-rustc_ast_passes" -version = "671.0.0" +version = "669.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9914fadee461568d19ca2ebaec8699ff898f8ffec9928154659a57ee018e5fd" +checksum = "d4cf4dca95f55f70eeb193fb08554026d79d0628de771fd726bb609e36887b82" dependencies = [ "itertools 0.8.0", "log", - "rustc-ap-rustc_ast", - "rustc-ap-rustc_ast_pretty", + "rustc-ap-rustc_ast 669.0.0", + "rustc-ap-rustc_ast_pretty 669.0.0", "rustc-ap-rustc_attr", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_errors", - "rustc-ap-rustc_feature", - "rustc-ap-rustc_parse", - "rustc-ap-rustc_session", - "rustc-ap-rustc_span", + "rustc-ap-rustc_data_structures 669.0.0", + "rustc-ap-rustc_errors 669.0.0", + "rustc-ap-rustc_feature 669.0.0", + "rustc-ap-rustc_parse 669.0.0", + "rustc-ap-rustc_session 669.0.0", + "rustc-ap-rustc_span 669.0.0", +] + +[[package]] +name = "rustc-ap-rustc_ast_pretty" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "202bd2886d0cfa48baa3711042c14843f1b4852555b7ee7e5376bf66b276cb8d" +dependencies = [ + "log", + "rustc-ap-rustc_ast 669.0.0", + "rustc-ap-rustc_span 669.0.0", + "rustc-ap-rustc_target 669.0.0", ] [[package]] @@ -2856,29 +2896,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a78c5cc50a2f294d3c4e9131a15676724c9f136d3ed54e9ba419850b6025cb3" dependencies = [ "log", - "rustc-ap-rustc_ast", - "rustc-ap-rustc_span", - "rustc-ap-rustc_target", + "rustc-ap-rustc_ast 671.0.0", + "rustc-ap-rustc_span 671.0.0", + "rustc-ap-rustc_target 671.0.0", ] [[package]] name = "rustc-ap-rustc_attr" -version = "671.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78ce08227d146949755175c0cf710280a4b5bf6ee504c0e3f7ccc30d66fbfd9" -dependencies = [ - "rustc-ap-rustc_ast", - "rustc-ap-rustc_ast_pretty", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_errors", - "rustc-ap-rustc_feature", - "rustc-ap-rustc_macros", - "rustc-ap-rustc_serialize", - "rustc-ap-rustc_session", - "rustc-ap-rustc_span", +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b11ee1d92b3214e8a8c7829eff84cc1b03925da0ea5c6900cefe05b99edb4682" +dependencies = [ + "rustc-ap-rustc_ast 669.0.0", + "rustc-ap-rustc_ast_pretty 669.0.0", + "rustc-ap-rustc_data_structures 669.0.0", + "rustc-ap-rustc_errors 669.0.0", + "rustc-ap-rustc_feature 669.0.0", + "rustc-ap-rustc_macros 669.0.0", + "rustc-ap-rustc_serialize 669.0.0", + "rustc-ap-rustc_session 669.0.0", + "rustc-ap-rustc_span 669.0.0", "version_check", ] +[[package]] +name = "rustc-ap-rustc_data_structures" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a45d43b974d4cb9e32e5a15119c5eb7672c306ef09b064f2125b6a0399f6656" +dependencies = [ + "bitflags", + "cfg-if", + "crossbeam-utils 0.7.2", + "ena", + "indexmap", + "jobserver", + "lazy_static", + "libc", + "log", + "measureme", + "once_cell", + "parking_lot 0.10.2", + "rustc-ap-rustc_graphviz 669.0.0", + "rustc-ap-rustc_index 669.0.0", + "rustc-ap-rustc_serialize 669.0.0", + "rustc-hash", + "rustc-rayon", + "rustc-rayon-core", + "smallvec 1.4.0", + "stable_deref_trait", + "stacker", + "winapi 0.3.8", +] + [[package]] name = "rustc-ap-rustc_data_structures" version = "671.0.0" @@ -2897,9 +2967,9 @@ dependencies = [ "measureme", "once_cell", "parking_lot 0.10.2", - "rustc-ap-rustc_graphviz", - "rustc-ap-rustc_index", - "rustc-ap-rustc_serialize", + "rustc-ap-rustc_graphviz 671.0.0", + "rustc-ap-rustc_index 671.0.0", + "rustc-ap-rustc_serialize 671.0.0", "rustc-hash", "rustc-rayon", "rustc-rayon-core", @@ -2909,6 +2979,24 @@ dependencies = [ "winapi 0.3.8", ] +[[package]] +name = "rustc-ap-rustc_errors" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd895d440820aaa04e6dc5486105494920a1e9779b9b051e8dba4ca5c182f94" +dependencies = [ + "annotate-snippets 0.8.0", + "atty", + "log", + "rustc-ap-rustc_data_structures 669.0.0", + "rustc-ap-rustc_serialize 669.0.0", + "rustc-ap-rustc_span 669.0.0", + "termcolor", + "termize", + "unicode-width", + "winapi 0.3.8", +] + [[package]] name = "rustc-ap-rustc_errors" version = "671.0.0" @@ -2918,9 +3006,9 @@ dependencies = [ "annotate-snippets 0.8.0", "atty", "log", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_serialize", - "rustc-ap-rustc_span", + "rustc-ap-rustc_data_structures 671.0.0", + "rustc-ap-rustc_serialize 671.0.0", + "rustc-ap-rustc_span 671.0.0", "termcolor", "termize", "unicode-width", @@ -2929,26 +3017,37 @@ dependencies = [ [[package]] name = "rustc-ap-rustc_expand" -version = "671.0.0" +version = "669.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a0586e83bdfe70eda8393429a8a38ecb529525dd252d787e479af075d3cab08" +checksum = "71a0cc7820860d6691bf0aa7a95cdbc60f6587b495c18e0fa15a888fdabbf171" dependencies = [ "log", - "rustc-ap-rustc_ast", + "rustc-ap-rustc_ast 669.0.0", "rustc-ap-rustc_ast_passes", - "rustc-ap-rustc_ast_pretty", + "rustc-ap-rustc_ast_pretty 669.0.0", "rustc-ap-rustc_attr", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_errors", - "rustc-ap-rustc_feature", - "rustc-ap-rustc_lexer", - "rustc-ap-rustc_parse", - "rustc-ap-rustc_serialize", - "rustc-ap-rustc_session", - "rustc-ap-rustc_span", + "rustc-ap-rustc_data_structures 669.0.0", + "rustc-ap-rustc_errors 669.0.0", + "rustc-ap-rustc_feature 669.0.0", + "rustc-ap-rustc_lexer 669.0.0", + "rustc-ap-rustc_parse 669.0.0", + "rustc-ap-rustc_serialize 669.0.0", + "rustc-ap-rustc_session 669.0.0", + "rustc-ap-rustc_span 669.0.0", "smallvec 1.4.0", ] +[[package]] +name = "rustc-ap-rustc_feature" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5473d5106401aa46f881eb91772f0a41fd5f28ae6134cf4b450eb1370ea6af22" +dependencies = [ + "lazy_static", + "rustc-ap-rustc_data_structures 669.0.0", + "rustc-ap-rustc_span 669.0.0", +] + [[package]] name = "rustc-ap-rustc_feature" version = "671.0.0" @@ -2956,22 +3055,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48fc3aa8de0737a8c5a4353e6948548f469150d2b5d3eac391843de32c6c6ca2" dependencies = [ "lazy_static", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_span", + "rustc-ap-rustc_data_structures 671.0.0", + "rustc-ap-rustc_span 671.0.0", ] +[[package]] +name = "rustc-ap-rustc_fs_util" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da1d57ee7a7ef55f31a97d99c7f919f02fc9a60ab96faa8cf45a7ae3ab1ccbf" + [[package]] name = "rustc-ap-rustc_fs_util" version = "671.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59fd3380f4029020b693bbfd5a14ec8c893ec33c5c0063ad2e68e46d3fbd6a1f" +[[package]] +name = "rustc-ap-rustc_graphviz" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3af62b20460908378cd1d354917acd9553376c5363bbb4e465f949bd82bdef9" + [[package]] name = "rustc-ap-rustc_graphviz" version = "671.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b54bd98f70e04291bf611151d1fcd4d7770b35f7ec603d301c4aee0d1979cca4" +[[package]] +name = "rustc-ap-rustc_index" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3af7d4c456fe7647453d3fcd58335c9d512d1ff9a239a370b7ebdd353d69f66f" +dependencies = [ + "rustc-ap-rustc_serialize 669.0.0", + "smallvec 1.4.0", +] + [[package]] name = "rustc-ap-rustc_index" version = "671.0.0" @@ -2979,7 +3100,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "335bfb187a2489a59ee8c67fcf5d1760e9dcdbe0f02025c199a74caa05096b15" dependencies = [ "arrayvec 0.5.1", - "rustc-ap-rustc_serialize", + "rustc-ap-rustc_serialize 671.0.0", +] + +[[package]] +name = "rustc-ap-rustc_lexer" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "456af5f09c006cf6c22c1a433ee0232c4bb74bdc6c647a010166a47c94ed2a63" +dependencies = [ + "unicode-xid", ] [[package]] @@ -2991,6 +3121,18 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "rustc-ap-rustc_macros" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f6acd192f313047759a346b892998b626466b93fe04f415da5f38906bb3b4c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "rustc-ap-rustc_macros" version = "671.0.0" @@ -3003,6 +3145,25 @@ dependencies = [ "synstructure", ] +[[package]] +name = "rustc-ap-rustc_parse" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006e8117c1c55e42bb56386c86ce6f7e4b47349e0bec7888c1d24784272e61b" +dependencies = [ + "bitflags", + "log", + "rustc-ap-rustc_ast 669.0.0", + "rustc-ap-rustc_ast_pretty 669.0.0", + "rustc-ap-rustc_data_structures 669.0.0", + "rustc-ap-rustc_errors 669.0.0", + "rustc-ap-rustc_feature 669.0.0", + "rustc-ap-rustc_lexer 669.0.0", + "rustc-ap-rustc_session 669.0.0", + "rustc-ap-rustc_span 669.0.0", + "unicode-normalization", +] + [[package]] name = "rustc-ap-rustc_parse" version = "671.0.0" @@ -3011,17 +3172,27 @@ checksum = "065e632101bdd57a271f38ee7a4d72b5a3d0467ec845104346c284b2c6c69960" dependencies = [ "bitflags", "log", - "rustc-ap-rustc_ast", - "rustc-ap-rustc_ast_pretty", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_errors", - "rustc-ap-rustc_feature", - "rustc-ap-rustc_lexer", - "rustc-ap-rustc_session", - "rustc-ap-rustc_span", + "rustc-ap-rustc_ast 671.0.0", + "rustc-ap-rustc_ast_pretty 671.0.0", + "rustc-ap-rustc_data_structures 671.0.0", + "rustc-ap-rustc_errors 671.0.0", + "rustc-ap-rustc_feature 671.0.0", + "rustc-ap-rustc_lexer 671.0.0", + "rustc-ap-rustc_session 671.0.0", + "rustc-ap-rustc_span 671.0.0", "unicode-normalization", ] +[[package]] +name = "rustc-ap-rustc_serialize" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "306ced69beaeebe4de9552ee751eb54ea25b5f34a73fe80f5f9cbbe15ccebc48" +dependencies = [ + "indexmap", + "smallvec 1.4.0", +] + [[package]] name = "rustc-ap-rustc_serialize" version = "671.0.0" @@ -3032,6 +3203,26 @@ dependencies = [ "smallvec 1.4.0", ] +[[package]] +name = "rustc-ap-rustc_session" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff48435f5a476365e3ab5f49e07f98715cecb2d8c5bbcafeaf3aec638407be" +dependencies = [ + "bitflags", + "getopts", + "log", + "num_cpus", + "rustc-ap-rustc_ast 669.0.0", + "rustc-ap-rustc_data_structures 669.0.0", + "rustc-ap-rustc_errors 669.0.0", + "rustc-ap-rustc_feature 669.0.0", + "rustc-ap-rustc_fs_util 669.0.0", + "rustc-ap-rustc_serialize 669.0.0", + "rustc-ap-rustc_span 669.0.0", + "rustc-ap-rustc_target 669.0.0", +] + [[package]] name = "rustc-ap-rustc_session" version = "671.0.0" @@ -3042,14 +3233,33 @@ dependencies = [ "getopts", "log", "num_cpus", - "rustc-ap-rustc_ast", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_errors", - "rustc-ap-rustc_feature", - "rustc-ap-rustc_fs_util", - "rustc-ap-rustc_serialize", - "rustc-ap-rustc_span", - "rustc-ap-rustc_target", + "rustc-ap-rustc_ast 671.0.0", + "rustc-ap-rustc_data_structures 671.0.0", + "rustc-ap-rustc_errors 671.0.0", + "rustc-ap-rustc_feature 671.0.0", + "rustc-ap-rustc_fs_util 671.0.0", + "rustc-ap-rustc_serialize 671.0.0", + "rustc-ap-rustc_span 671.0.0", + "rustc-ap-rustc_target 671.0.0", +] + +[[package]] +name = "rustc-ap-rustc_span" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec4273af0abbe78fc4585316ab193445c848c555e9203ddc28af02330918bf30" +dependencies = [ + "cfg-if", + "log", + "md-5", + "rustc-ap-rustc_arena 669.0.0", + "rustc-ap-rustc_data_structures 669.0.0", + "rustc-ap-rustc_index 669.0.0", + "rustc-ap-rustc_macros 669.0.0", + "rustc-ap-rustc_serialize 669.0.0", + "scoped-tls", + "sha-1", + "unicode-width", ] [[package]] @@ -3061,16 +3271,31 @@ dependencies = [ "cfg-if", "log", "md-5", - "rustc-ap-rustc_arena", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_index", - "rustc-ap-rustc_macros", - "rustc-ap-rustc_serialize", + "rustc-ap-rustc_arena 671.0.0", + "rustc-ap-rustc_data_structures 671.0.0", + "rustc-ap-rustc_index 671.0.0", + "rustc-ap-rustc_macros 671.0.0", + "rustc-ap-rustc_serialize 671.0.0", "scoped-tls", "sha-1", "unicode-width", ] +[[package]] +name = "rustc-ap-rustc_target" +version = "669.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f9a2d6004ce6ad492a8eeacc2569b1c008169434b8828996d8dade4e5c6b6ee" +dependencies = [ + "bitflags", + "log", + "rustc-ap-rustc_data_structures 669.0.0", + "rustc-ap-rustc_index 669.0.0", + "rustc-ap-rustc_macros 669.0.0", + "rustc-ap-rustc_serialize 669.0.0", + "rustc-ap-rustc_span 669.0.0", +] + [[package]] name = "rustc-ap-rustc_target" version = "671.0.0" @@ -3079,11 +3304,11 @@ checksum = "ac82006fdb31ef44e24e1623f8b72ac2b404ef15ba20b7ebec0df35e5d20bbef" dependencies = [ "bitflags", "log", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_index", - "rustc-ap-rustc_macros", - "rustc-ap-rustc_serialize", - "rustc-ap-rustc_span", + "rustc-ap-rustc_data_structures 671.0.0", + "rustc-ap-rustc_index 671.0.0", + "rustc-ap-rustc_macros 671.0.0", + "rustc-ap-rustc_serialize 671.0.0", + "rustc-ap-rustc_span 671.0.0", ] [[package]] @@ -4080,7 +4305,7 @@ dependencies = [ [[package]] name = "rustfmt-nightly" -version = "1.4.20" +version = "1.4.19" dependencies = [ "annotate-snippets 0.6.1", "anyhow", @@ -4096,15 +4321,15 @@ dependencies = [ "lazy_static", "log", "regex", - "rustc-ap-rustc_ast", - "rustc-ap-rustc_ast_pretty", + "rustc-ap-rustc_ast 669.0.0", + "rustc-ap-rustc_ast_pretty 669.0.0", "rustc-ap-rustc_attr", - "rustc-ap-rustc_data_structures", - "rustc-ap-rustc_errors", + "rustc-ap-rustc_data_structures 669.0.0", + "rustc-ap-rustc_errors 669.0.0", "rustc-ap-rustc_expand", - "rustc-ap-rustc_parse", - "rustc-ap-rustc_session", - "rustc-ap-rustc_span", + "rustc-ap-rustc_parse 669.0.0", + "rustc-ap-rustc_session 669.0.0", + "rustc-ap-rustc_span 669.0.0", "rustc-workspace-hack", "rustfmt-config_proc_macro", "serde", diff --git a/src/librustc_ast/Cargo.toml b/src/librustc_ast/Cargo.toml index ab0ab7244dbe4..73c5e33753f29 100644 --- a/src/librustc_ast/Cargo.toml +++ b/src/librustc_ast/Cargo.toml @@ -11,7 +11,7 @@ doctest = false [dependencies] rustc_serialize = { path = "../librustc_serialize" } -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_span = { path = "../librustc_span" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_index = { path = "../librustc_index" } diff --git a/src/librustc_ast/util/literal.rs b/src/librustc_ast/util/literal.rs index 4428d09902b92..597e5b437fcb1 100644 --- a/src/librustc_ast/util/literal.rs +++ b/src/librustc_ast/util/literal.rs @@ -10,8 +10,8 @@ use rustc_lexer::unescape::{unescape_byte_literal, unescape_literal, Mode}; use rustc_span::symbol::{kw, sym, Symbol}; use rustc_span::Span; -use log::debug; use std::ascii; +use tracing::debug; pub enum LitError { NotLiteral, diff --git a/src/librustc_driver/Cargo.toml b/src/librustc_driver/Cargo.toml index 6474a69b216a9..a9c95d1a8ab16 100644 --- a/src/librustc_driver/Cargo.toml +++ b/src/librustc_driver/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["dylib"] [dependencies] lazy_static = "1.0" libc = "0.2" -log = { package = "tracing", version = "0.1.18", features = ["release_max_level_info"] } +tracing = "0.1" tracing-subscriber = { version = "0.2.10", default-features = false, features = ["fmt", "env-filter", "smallvec", "parking_lot", "ansi"] } rustc_middle = { path = "../librustc_middle" } rustc_ast_pretty = { path = "../librustc_ast_pretty" } diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index cc954cee9077d..0897bb6bd5a9f 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -9,7 +9,7 @@ #![recursion_limit = "256"] #[macro_use] -extern crate log; +extern crate tracing; #[macro_use] extern crate lazy_static; @@ -1224,13 +1224,13 @@ pub fn install_ice_hook() { } /// This allows tools to enable rust logging without having to magically match rustc's -/// log crate version. +/// tracing crate version. pub fn init_rustc_env_logger() { init_env_logger("RUSTC_LOG") } /// This allows tools to enable rust logging without having to magically match rustc's -/// log crate version. In contrast to `init_rustc_env_logger` it allows you to choose an env var +/// tracing crate version. In contrast to `init_rustc_env_logger` it allows you to choose an env var /// other than `RUSTC_LOG`. pub fn init_env_logger(env: &str) { // Don't register a dispatcher if there's no filter to print anything diff --git a/src/librustc_errors/Cargo.toml b/src/librustc_errors/Cargo.toml index d0f04c3fe7647..fe6645748b1c7 100644 --- a/src/librustc_errors/Cargo.toml +++ b/src/librustc_errors/Cargo.toml @@ -10,7 +10,7 @@ path = "lib.rs" doctest = false [dependencies] -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_serialize = { path = "../librustc_serialize" } rustc_span = { path = "../librustc_span" } rustc_data_structures = { path = "../librustc_data_structures" } diff --git a/src/librustc_errors/diagnostic_builder.rs b/src/librustc_errors/diagnostic_builder.rs index 22bf8fe34aa15..dc52e29fa9bb9 100644 --- a/src/librustc_errors/diagnostic_builder.rs +++ b/src/librustc_errors/diagnostic_builder.rs @@ -1,11 +1,11 @@ use crate::{Applicability, Handler, Level, StashKey}; use crate::{Diagnostic, DiagnosticId, DiagnosticStyledString}; -use log::debug; use rustc_span::{MultiSpan, Span}; use std::fmt::{self, Debug}; use std::ops::{Deref, DerefMut}; use std::thread::panicking; +use tracing::debug; /// Used for emitting structured error messages and other diagnostic information. /// diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index cca8b47c78122..5a654e83aed8e 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -18,7 +18,6 @@ use crate::{ pluralize, CodeSuggestion, Diagnostic, DiagnosticId, Level, SubDiagnostic, SuggestionStyle, }; -use log::*; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::sync::Lrc; use rustc_span::hygiene::{ExpnKind, MacroKind}; @@ -30,6 +29,7 @@ use std::iter; use std::path::Path; use termcolor::{Ansi, BufferWriter, ColorChoice, ColorSpec, StandardStream}; use termcolor::{Buffer, Color, WriteColor}; +use tracing::*; /// Default column width, used in tests and when terminal dimensions cannot be determined. const DEFAULT_COLUMN_WIDTH: usize = 140; diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 73d71063b2362..12ec13cc9a878 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -8,7 +8,7 @@ pub use emitter::ColorConfig; -use log::debug; +use tracing::debug; use Level::*; use emitter::{is_case_difference, Emitter, EmitterWriter}; diff --git a/src/librustc_expand/Cargo.toml b/src/librustc_expand/Cargo.toml index bdf039c36abf6..dad7d6814c1fb 100644 --- a/src/librustc_expand/Cargo.toml +++ b/src/librustc_expand/Cargo.toml @@ -12,7 +12,7 @@ doctest = false [dependencies] rustc_serialize = { path = "../librustc_serialize" } -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_span = { path = "../librustc_span" } rustc_ast_pretty = { path = "../librustc_ast_pretty" } rustc_ast_passes = { path = "../librustc_ast_passes" } diff --git a/src/librustc_expand/mbe/macro_rules.rs b/src/librustc_expand/mbe/macro_rules.rs index 15b2c14a2576c..808d77842cb22 100644 --- a/src/librustc_expand/mbe/macro_rules.rs +++ b/src/librustc_expand/mbe/macro_rules.rs @@ -25,10 +25,10 @@ use rustc_span::hygiene::Transparency; use rustc_span::symbol::{kw, sym, Ident, MacroRulesNormalizedIdent}; use rustc_span::Span; -use log::debug; use std::borrow::Cow; use std::collections::hash_map::Entry; use std::{mem, slice}; +use tracing::debug; crate struct ParserAnyMacro<'a> { parser: Parser<'a>, diff --git a/src/librustc_hir/Cargo.toml b/src/librustc_hir/Cargo.toml index 4a404e176e148..a473a8edcdd5d 100644 --- a/src/librustc_hir/Cargo.toml +++ b/src/librustc_hir/Cargo.toml @@ -18,5 +18,5 @@ rustc_span = { path = "../librustc_span" } rustc_serialize = { path = "../librustc_serialize" } rustc_ast = { path = "../librustc_ast" } lazy_static = "1" -log = { package = "tracing", version = "0.1" } +tracing = "0.1" smallvec = { version = "1.0", features = ["union", "may_dangle"] } diff --git a/src/librustc_hir/definitions.rs b/src/librustc_hir/definitions.rs index 79b7068273932..945551502968e 100644 --- a/src/librustc_hir/definitions.rs +++ b/src/librustc_hir/definitions.rs @@ -15,9 +15,9 @@ use rustc_index::vec::IndexVec; use rustc_span::hygiene::ExpnId; use rustc_span::symbol::{sym, Symbol}; -use log::debug; use std::fmt::Write; use std::hash::Hash; +use tracing::debug; /// The `DefPathTable` maps `DefIndex`es to `DefKey`s and vice versa. /// Internally the `DefPathTable` holds a tree of `DefKey`s, where each `DefKey` diff --git a/src/librustc_incremental/Cargo.toml b/src/librustc_incremental/Cargo.toml index 60a87078d63cf..992015eb777c4 100644 --- a/src/librustc_incremental/Cargo.toml +++ b/src/librustc_incremental/Cargo.toml @@ -11,7 +11,7 @@ doctest = false [dependencies] rustc_graphviz = { path = "../librustc_graphviz" } -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rand = "0.7" rustc_middle = { path = "../librustc_middle" } rustc_data_structures = { path = "../librustc_data_structures" } diff --git a/src/librustc_incremental/lib.rs b/src/librustc_incremental/lib.rs index 7fd4b3c2554f3..ad18913805467 100644 --- a/src/librustc_incremental/lib.rs +++ b/src/librustc_incremental/lib.rs @@ -8,7 +8,7 @@ #[macro_use] extern crate rustc_middle; #[macro_use] -extern crate log; +extern crate tracing; mod assert_dep_graph; pub mod assert_module_sources; diff --git a/src/librustc_infer/Cargo.toml b/src/librustc_infer/Cargo.toml index 9d56fa223a9cb..e1698d66323c3 100644 --- a/src/librustc_infer/Cargo.toml +++ b/src/librustc_infer/Cargo.toml @@ -11,7 +11,7 @@ doctest = false [dependencies] rustc_graphviz = { path = "../librustc_graphviz" } -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_middle = { path = "../librustc_middle" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_errors = { path = "../librustc_errors" } diff --git a/src/librustc_infer/lib.rs b/src/librustc_infer/lib.rs index bacb7fa153e43..f135bde7f8337 100644 --- a/src/librustc_infer/lib.rs +++ b/src/librustc_infer/lib.rs @@ -33,7 +33,7 @@ extern crate rustc_macros; #[macro_use] extern crate rustc_data_structures; #[macro_use] -extern crate log; +extern crate tracing; #[macro_use] extern crate rustc_middle; diff --git a/src/librustc_interface/Cargo.toml b/src/librustc_interface/Cargo.toml index 5c7edc10dd5c7..b9837c6ade9a7 100644 --- a/src/librustc_interface/Cargo.toml +++ b/src/librustc_interface/Cargo.toml @@ -11,7 +11,7 @@ doctest = false [dependencies] libc = "0.2" -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rayon = { version = "0.3.0", package = "rustc-rayon" } smallvec = { version = "1.0", features = ["union", "may_dangle"] } rustc_ast = { path = "../librustc_ast" } diff --git a/src/librustc_interface/interface.rs b/src/librustc_interface/interface.rs index 4dccf273dd90f..122d6e3543cae 100644 --- a/src/librustc_interface/interface.rs +++ b/src/librustc_interface/interface.rs @@ -198,7 +198,7 @@ pub fn create_compiler_and_run(config: Config, f: impl FnOnce(&Compiler) -> R } pub fn run_compiler(mut config: Config, f: impl FnOnce(&Compiler) -> R + Send) -> R { - log::trace!("run_compiler"); + tracing::trace!("run_compiler"); let stderr = config.stderr.take(); util::setup_callbacks_and_run_in_thread_pool_with_globals( config.opts.edition, diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs index 701fca8e4b534..daa7444fb9edb 100644 --- a/src/librustc_interface/passes.rs +++ b/src/librustc_interface/passes.rs @@ -2,7 +2,6 @@ use crate::interface::{Compiler, Result}; use crate::proc_macro_decls; use crate::util; -use log::{info, warn}; use once_cell::sync::Lazy; use rustc_ast::mut_visit::MutVisitor; use rustc_ast::{self, ast, visit}; @@ -39,6 +38,7 @@ use rustc_span::symbol::Symbol; use rustc_span::{FileName, RealFileName}; use rustc_trait_selection::traits; use rustc_typeck as typeck; +use tracing::{info, warn}; use rustc_serialize::json; use tempfile::Builder as TempFileBuilder; @@ -104,7 +104,7 @@ pub fn configure_and_expand( krate: ast::Crate, crate_name: &str, ) -> Result<(ast::Crate, BoxedResolver)> { - log::trace!("configure_and_expand"); + tracing::trace!("configure_and_expand"); // Currently, we ignore the name resolution data structures for the purposes of dependency // tracking. Instead we will run name resolution and include its output in the hash of each // item, much like we do for macro expansion. In other words, the hash reflects not just @@ -229,7 +229,7 @@ fn configure_and_expand_inner<'a>( resolver_arenas: &'a ResolverArenas<'a>, metadata_loader: &'a MetadataLoaderDyn, ) -> Result<(ast::Crate, Resolver<'a>)> { - log::trace!("configure_and_expand_inner"); + tracing::trace!("configure_and_expand_inner"); pre_expansion_lint(sess, lint_store, &krate); let mut resolver = Resolver::new(sess, &krate, crate_name, metadata_loader, &resolver_arenas); @@ -342,7 +342,7 @@ fn configure_and_expand_inner<'a>( }); if let Some(PpMode::PpmSource(PpSourceMode::PpmEveryBodyLoops)) = sess.opts.pretty { - log::debug!("replacing bodies with loop {{}}"); + tracing::debug!("replacing bodies with loop {{}}"); util::ReplaceBodyWithLoop::new(&mut resolver).visit_crate(&mut krate); } diff --git a/src/librustc_interface/queries.rs b/src/librustc_interface/queries.rs index d1a22c69ee041..2f32737cca00a 100644 --- a/src/librustc_interface/queries.rs +++ b/src/librustc_interface/queries.rs @@ -168,7 +168,7 @@ impl<'tcx> Queries<'tcx> { pub fn expansion( &self, ) -> Result<&Query<(ast::Crate, Steal>>, Lrc)>> { - log::trace!("expansion"); + tracing::trace!("expansion"); self.expansion.compute(|| { let crate_name = self.crate_name()?.peek().clone(); let (krate, lint_store) = self.register_plugins()?.take(); diff --git a/src/librustc_interface/util.rs b/src/librustc_interface/util.rs index e403a60ff323b..36eaad16079b8 100644 --- a/src/librustc_interface/util.rs +++ b/src/librustc_interface/util.rs @@ -1,4 +1,3 @@ -use log::info; use rustc_ast::ast::{AttrVec, BlockCheckMode}; use rustc_ast::mut_visit::{visit_clobber, MutVisitor, *}; use rustc_ast::ptr::P; @@ -33,6 +32,7 @@ use std::path::{Path, PathBuf}; use std::sync::{Arc, Mutex, Once}; #[cfg(not(parallel_compiler))] use std::{panic, thread}; +use tracing::info; /// Adds `target_feature = "..."` cfgs for a variety of platform /// specific features (SSE, NEON etc.). diff --git a/src/librustc_lint/Cargo.toml b/src/librustc_lint/Cargo.toml index 3ba1566023d28..d779f15f19aab 100644 --- a/src/librustc_lint/Cargo.toml +++ b/src/librustc_lint/Cargo.toml @@ -9,7 +9,7 @@ name = "rustc_lint" path = "lib.rs" [dependencies] -log = { package = "tracing", version = "0.1" } +tracing = "0.1" unicode-security = "0.0.5" rustc_middle = { path = "../librustc_middle" } rustc_ast_pretty = { path = "../librustc_ast_pretty" } diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index c42794e00b41e..b7a6ad83c84ba 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -51,8 +51,8 @@ use rustc_trait_selection::traits::misc::can_type_implement_copy; use crate::nonstandard_style::{method_context, MethodLateContext}; -use log::{debug, trace}; use std::fmt::Write; +use tracing::{debug, trace}; // hardwired lints from librustc_middle pub use rustc_session::lint::builtin::*; diff --git a/src/librustc_lint/early.rs b/src/librustc_lint/early.rs index d891466611ad3..017d4e31e4a71 100644 --- a/src/librustc_lint/early.rs +++ b/src/librustc_lint/early.rs @@ -23,8 +23,8 @@ use rustc_session::Session; use rustc_span::symbol::Ident; use rustc_span::Span; -use log::debug; use std::slice; +use tracing::debug; macro_rules! run_early_pass { ($cx:expr, $f:ident, $($args:expr),*) => ({ $cx.pass.$f(&$cx.context, $($args),*); diff --git a/src/librustc_lint/late.rs b/src/librustc_lint/late.rs index f43c197d2d201..3f9e1756168fa 100644 --- a/src/librustc_lint/late.rs +++ b/src/librustc_lint/late.rs @@ -28,10 +28,10 @@ use rustc_session::lint::LintPass; use rustc_span::symbol::Symbol; use rustc_span::Span; -use log::debug; use std::any::Any; use std::cell::Cell; use std::slice; +use tracing::debug; /// Extract the `LintStore` from the query context. /// This function exists because we've erased `LintStore` as `dyn Any` in the context. diff --git a/src/librustc_lint/types.rs b/src/librustc_lint/types.rs index 5c53e435fd76c..5891abcfd9cd1 100644 --- a/src/librustc_lint/types.rs +++ b/src/librustc_lint/types.rs @@ -19,8 +19,8 @@ use rustc_target::abi::Abi; use rustc_target::abi::{Integer, LayoutOf, TagEncoding, VariantIdx, Variants}; use rustc_target::spec::abi::Abi as SpecAbi; -use log::debug; use std::cmp; +use tracing::debug; declare_lint! { UNUSED_COMPARISONS, diff --git a/src/librustc_lint/unused.rs b/src/librustc_lint/unused.rs index ecc8a192f18ea..95e51b47be34b 100644 --- a/src/librustc_lint/unused.rs +++ b/src/librustc_lint/unused.rs @@ -17,7 +17,7 @@ use rustc_span::symbol::Symbol; use rustc_span::symbol::{kw, sym}; use rustc_span::{BytePos, Span, DUMMY_SP}; -use log::debug; +use tracing::debug; declare_lint! { pub UNUSED_MUST_USE, diff --git a/src/librustc_metadata/Cargo.toml b/src/librustc_metadata/Cargo.toml index 2c0e2aa39fd59..215f1ad590b7c 100644 --- a/src/librustc_metadata/Cargo.toml +++ b/src/librustc_metadata/Cargo.toml @@ -12,7 +12,7 @@ doctest = false [dependencies] flate2 = "1.0" libc = "0.2" -log = { package = "tracing", version = "0.1" } +tracing = "0.1" memmap = "0.7" smallvec = { version = "1.0", features = ["union", "may_dangle"] } rustc_middle = { path = "../librustc_middle" } diff --git a/src/librustc_metadata/creader.rs b/src/librustc_metadata/creader.rs index e15655e3794f5..9827b22233137 100644 --- a/src/librustc_metadata/creader.rs +++ b/src/librustc_metadata/creader.rs @@ -26,10 +26,10 @@ use rustc_span::symbol::{sym, Symbol}; use rustc_span::{Span, DUMMY_SP}; use rustc_target::spec::{PanicStrategy, TargetTriple}; -use log::{debug, info}; use proc_macro::bridge::client::ProcMacro; use std::path::Path; use std::{cmp, env, fs}; +use tracing::{debug, info}; #[derive(Clone)] pub struct CStore { diff --git a/src/librustc_metadata/dependency_format.rs b/src/librustc_metadata/dependency_format.rs index bb5ae4d0557c9..f7454da90a396 100644 --- a/src/librustc_metadata/dependency_format.rs +++ b/src/librustc_metadata/dependency_format.rs @@ -159,11 +159,11 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList { let name = tcx.crate_name(cnum); let src = tcx.used_crate_source(cnum); if src.dylib.is_some() { - log::info!("adding dylib: {}", name); + tracing::info!("adding dylib: {}", name); add_library(tcx, cnum, RequireDynamic, &mut formats); let deps = tcx.dylib_dependency_formats(cnum); for &(depnum, style) in deps.iter() { - log::info!("adding {:?}: {}", style, tcx.crate_name(depnum)); + tracing::info!("adding {:?}: {}", style, tcx.crate_name(depnum)); add_library(tcx, depnum, style, &mut formats); } } @@ -191,7 +191,7 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList { && tcx.dep_kind(cnum) == CrateDepKind::Explicit { assert!(src.rlib.is_some() || src.rmeta.is_some()); - log::info!("adding staticlib: {}", tcx.crate_name(cnum)); + tracing::info!("adding staticlib: {}", tcx.crate_name(cnum)); add_library(tcx, cnum, RequireStatic, &mut formats); ret[cnum.as_usize() - 1] = Linkage::Static; } diff --git a/src/librustc_metadata/locator.rs b/src/librustc_metadata/locator.rs index 8828b318d1ea6..bdd20a4bf6faf 100644 --- a/src/librustc_metadata/locator.rs +++ b/src/librustc_metadata/locator.rs @@ -230,11 +230,11 @@ use rustc_span::Span; use rustc_target::spec::{Target, TargetTriple}; use flate2::read::DeflateDecoder; -use log::{debug, info, warn}; use std::io::{Read, Result as IoResult, Write}; use std::ops::Deref; use std::path::{Path, PathBuf}; use std::{cmp, fmt, fs}; +use tracing::{debug, info, warn}; #[derive(Clone)] crate struct CrateLocator<'a> { diff --git a/src/librustc_metadata/rmeta/decoder.rs b/src/librustc_metadata/rmeta/decoder.rs index 8aea9a9f58850..e5aac4e371c56 100644 --- a/src/librustc_metadata/rmeta/decoder.rs +++ b/src/librustc_metadata/rmeta/decoder.rs @@ -37,13 +37,13 @@ use rustc_span::source_map::{respan, Spanned}; use rustc_span::symbol::{sym, Ident, Symbol}; use rustc_span::{self, hygiene::MacroKind, BytePos, ExpnId, Pos, Span, SyntaxContext, DUMMY_SP}; -use log::debug; use proc_macro::bridge::client::ProcMacro; use std::cell::Cell; use std::io; use std::mem; use std::num::NonZeroUsize; use std::path::Path; +use tracing::debug; pub use cstore_impl::{provide, provide_extern}; use rustc_span::hygiene::HygieneDecodeContext; diff --git a/src/librustc_metadata/rmeta/encoder.rs b/src/librustc_metadata/rmeta/encoder.rs index 6723e236a1fe9..7e2f4277306a7 100644 --- a/src/librustc_metadata/rmeta/encoder.rs +++ b/src/librustc_metadata/rmeta/encoder.rs @@ -1,7 +1,6 @@ use crate::rmeta::table::{FixedSizeEncoding, TableBuilder}; use crate::rmeta::*; -use log::{debug, trace}; use rustc_ast::ast; use rustc_data_structures::fingerprint::Fingerprint; use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet}; @@ -37,6 +36,7 @@ use rustc_target::abi::VariantIdx; use std::hash::Hash; use std::num::NonZeroUsize; use std::path::Path; +use tracing::{debug, trace}; struct EncodeContext<'a, 'tcx> { opaque: opaque::Encoder, diff --git a/src/librustc_metadata/rmeta/table.rs b/src/librustc_metadata/rmeta/table.rs index e1d0a0dbf2ffa..91d32d38cfffa 100644 --- a/src/librustc_metadata/rmeta/table.rs +++ b/src/librustc_metadata/rmeta/table.rs @@ -1,11 +1,11 @@ use crate::rmeta::*; -use log::debug; use rustc_index::vec::Idx; use rustc_serialize::{opaque::Encoder, Encodable}; use std::convert::TryInto; use std::marker::PhantomData; use std::num::NonZeroUsize; +use tracing::debug; /// Helper trait, for encoding to, and decoding from, a fixed number of bytes. /// Used mainly for Lazy positions and lengths. diff --git a/src/librustc_middle/Cargo.toml b/src/librustc_middle/Cargo.toml index 03431cb5a885e..311126361bc5b 100644 --- a/src/librustc_middle/Cargo.toml +++ b/src/librustc_middle/Cargo.toml @@ -12,7 +12,7 @@ doctest = false [dependencies] rustc_arena = { path = "../librustc_arena" } bitflags = "1.2.1" -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc-rayon-core = "0.3.0" polonius-engine = "0.12.0" rustc_apfloat = { path = "../librustc_apfloat" } diff --git a/src/librustc_middle/lib.rs b/src/librustc_middle/lib.rs index 4c06472ceb873..ec1dcd29ef2d8 100644 --- a/src/librustc_middle/lib.rs +++ b/src/librustc_middle/lib.rs @@ -60,7 +60,7 @@ extern crate rustc_macros; #[macro_use] extern crate rustc_data_structures; #[macro_use] -extern crate log; +extern crate tracing; #[macro_use] extern crate smallvec; diff --git a/src/librustc_mir/Cargo.toml b/src/librustc_mir/Cargo.toml index f05c47e0ed626..2693d29e41c4c 100644 --- a/src/librustc_mir/Cargo.toml +++ b/src/librustc_mir/Cargo.toml @@ -13,7 +13,7 @@ doctest = false either = "1.5.0" rustc_graphviz = { path = "../librustc_graphviz" } itertools = "0.8" -log = { package = "tracing", version = "0.1" } +tracing = "0.1" log_settings = "0.1.1" polonius-engine = "0.12.0" rustc_middle = { path = "../librustc_middle" } diff --git a/src/librustc_mir/borrow_check/diagnostics/outlives_suggestion.rs b/src/librustc_mir/borrow_check/diagnostics/outlives_suggestion.rs index 8521f900988e4..9197a83cdd07a 100644 --- a/src/librustc_mir/borrow_check/diagnostics/outlives_suggestion.rs +++ b/src/librustc_mir/borrow_check/diagnostics/outlives_suggestion.rs @@ -3,10 +3,10 @@ use std::collections::BTreeMap; -use log::debug; use rustc_data_structures::fx::FxHashSet; use rustc_errors::DiagnosticBuilder; use rustc_middle::ty::RegionVid; +use tracing::debug; use smallvec::SmallVec; diff --git a/src/librustc_mir/lib.rs b/src/librustc_mir/lib.rs index 4e7142a93aedc..3118e7ac3ab17 100644 --- a/src/librustc_mir/lib.rs +++ b/src/librustc_mir/lib.rs @@ -30,7 +30,7 @@ Rust MIR: a lowered representation of Rust. #![recursion_limit = "256"] #[macro_use] -extern crate log; +extern crate tracing; #[macro_use] extern crate rustc_middle; diff --git a/src/librustc_mir_build/Cargo.toml b/src/librustc_mir_build/Cargo.toml index 96059fa43e521..97621f205fbb7 100644 --- a/src/librustc_mir_build/Cargo.toml +++ b/src/librustc_mir_build/Cargo.toml @@ -11,7 +11,7 @@ doctest = false [dependencies] rustc_arena = { path = "../librustc_arena" } -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_middle = { path = "../librustc_middle" } rustc_apfloat = { path = "../librustc_apfloat" } rustc_attr = { path = "../librustc_attr" } diff --git a/src/librustc_mir_build/lib.rs b/src/librustc_mir_build/lib.rs index 30545558933f7..313bb979a5161 100644 --- a/src/librustc_mir_build/lib.rs +++ b/src/librustc_mir_build/lib.rs @@ -12,7 +12,7 @@ #![recursion_limit = "256"] #[macro_use] -extern crate log; +extern crate tracing; #[macro_use] extern crate rustc_middle; diff --git a/src/librustc_parse/Cargo.toml b/src/librustc_parse/Cargo.toml index 25144bd610d3e..31d858849af48 100644 --- a/src/librustc_parse/Cargo.toml +++ b/src/librustc_parse/Cargo.toml @@ -11,7 +11,7 @@ doctest = false [dependencies] bitflags = "1.0" -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_ast_pretty = { path = "../librustc_ast_pretty" } rustc_data_structures = { path = "../librustc_data_structures" } rustc_feature = { path = "../librustc_feature" } diff --git a/src/librustc_parse/lexer/mod.rs b/src/librustc_parse/lexer/mod.rs index c3a79660eb9b9..675cfa41f1048 100644 --- a/src/librustc_parse/lexer/mod.rs +++ b/src/librustc_parse/lexer/mod.rs @@ -8,8 +8,8 @@ use rustc_session::parse::ParseSess; use rustc_span::symbol::{sym, Symbol}; use rustc_span::{BytePos, Pos, Span}; -use log::debug; use std::char; +use tracing::debug; mod tokentrees; mod unescape_error_reporting; diff --git a/src/librustc_parse/lexer/unescape_error_reporting.rs b/src/librustc_parse/lexer/unescape_error_reporting.rs index d41775a143ad6..6f249f491a647 100644 --- a/src/librustc_parse/lexer/unescape_error_reporting.rs +++ b/src/librustc_parse/lexer/unescape_error_reporting.rs @@ -18,7 +18,7 @@ pub(crate) fn emit_unescape_error( range: Range, error: EscapeError, ) { - log::debug!( + tracing::debug!( "emit_unescape_error: {:?}, {:?}, {:?}, {:?}, {:?}", lit, span_with_quotes, diff --git a/src/librustc_parse/lib.rs b/src/librustc_parse/lib.rs index 723e4333790ae..829e1a97b100d 100644 --- a/src/librustc_parse/lib.rs +++ b/src/librustc_parse/lib.rs @@ -20,7 +20,7 @@ use std::mem; use std::path::Path; use std::str; -use log::{debug, info}; +use tracing::{debug, info}; pub const MACRO_ARGUMENTS: Option<&'static str> = Some("macro arguments"); diff --git a/src/librustc_parse/parser/attr.rs b/src/librustc_parse/parser/attr.rs index b6a8ee71beb0c..c942394fa7ccb 100644 --- a/src/librustc_parse/parser/attr.rs +++ b/src/librustc_parse/parser/attr.rs @@ -6,7 +6,7 @@ use rustc_ast_pretty::pprust; use rustc_errors::{error_code, PResult}; use rustc_span::Span; -use log::debug; +use tracing::debug; #[derive(Debug)] pub(super) enum InnerAttrPolicy<'a> { diff --git a/src/librustc_parse/parser/diagnostics.rs b/src/librustc_parse/parser/diagnostics.rs index 2854356ab0fc6..27e1bb01d5284 100644 --- a/src/librustc_parse/parser/diagnostics.rs +++ b/src/librustc_parse/parser/diagnostics.rs @@ -16,7 +16,7 @@ use rustc_span::source_map::Spanned; use rustc_span::symbol::{kw, Ident}; use rustc_span::{MultiSpan, Span, SpanSnippetError, DUMMY_SP}; -use log::{debug, trace}; +use tracing::{debug, trace}; const TURBOFISH: &str = "use `::<...>` instead of `<...>` to specify type arguments"; diff --git a/src/librustc_parse/parser/expr.rs b/src/librustc_parse/parser/expr.rs index 55a134ae09115..4af542642f395 100644 --- a/src/librustc_parse/parser/expr.rs +++ b/src/librustc_parse/parser/expr.rs @@ -4,7 +4,6 @@ use super::{BlockMode, Parser, PathStyle, Restrictions, TokenType}; use super::{SemiColonMode, SeqSep, TokenExpectType}; use crate::maybe_recover_from_interpolated_ty_qpath; -use log::debug; use rustc_ast::ast::{self, AttrStyle, AttrVec, CaptureBy, Field, Lit, UnOp, DUMMY_NODE_ID}; use rustc_ast::ast::{AnonConst, BinOp, BinOpKind, FnDecl, FnRetTy, MacCall, Param, Ty, TyKind}; use rustc_ast::ast::{Arm, Async, BlockCheckMode, Expr, ExprKind, Label, Movability, RangeLimits}; @@ -18,6 +17,7 @@ use rustc_errors::{Applicability, DiagnosticBuilder, PResult}; use rustc_span::source_map::{self, Span, Spanned}; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use std::mem; +use tracing::debug; /// Possibly accepts an `token::Interpolated` expression (a pre-parsed expression /// dropped into the token stream, which happens while parsing the result of diff --git a/src/librustc_parse/parser/item.rs b/src/librustc_parse/parser/item.rs index 10d214e52abdb..e9ad8dd26435e 100644 --- a/src/librustc_parse/parser/item.rs +++ b/src/librustc_parse/parser/item.rs @@ -20,9 +20,9 @@ use rustc_span::edition::Edition; use rustc_span::source_map::{self, Span}; use rustc_span::symbol::{kw, sym, Ident, Symbol}; -use log::debug; use std::convert::TryFrom; use std::mem; +use tracing::debug; impl<'a> Parser<'a> { /// Parses a source module as a crate. This is the main entry point for the parser. diff --git a/src/librustc_parse/parser/mod.rs b/src/librustc_parse/parser/mod.rs index b33ae4bed828b..a30131e4f7af4 100644 --- a/src/librustc_parse/parser/mod.rs +++ b/src/librustc_parse/parser/mod.rs @@ -13,7 +13,6 @@ use crate::lexer::UnmatchedBrace; use diagnostics::Error; pub use path::PathStyle; -use log::debug; use rustc_ast::ast::DUMMY_NODE_ID; use rustc_ast::ast::{self, AttrStyle, AttrVec, Const, CrateSugar, Extern, Unsafe}; use rustc_ast::ast::{ @@ -27,6 +26,7 @@ use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder, FatalError use rustc_session::parse::ParseSess; use rustc_span::source_map::{respan, Span, DUMMY_SP}; use rustc_span::symbol::{kw, sym, Ident, Symbol}; +use tracing::debug; use std::{cmp, mem, slice}; diff --git a/src/librustc_parse/parser/path.rs b/src/librustc_parse/parser/path.rs index d4e44c54b1274..0f2b46f7e1630 100644 --- a/src/librustc_parse/parser/path.rs +++ b/src/librustc_parse/parser/path.rs @@ -10,8 +10,8 @@ use rustc_errors::{pluralize, Applicability, PResult}; use rustc_span::source_map::{BytePos, Span}; use rustc_span::symbol::{kw, sym, Ident}; -use log::debug; use std::mem; +use tracing::debug; /// Specifies how to parse a path. #[derive(Copy, Clone, PartialEq)] diff --git a/src/librustc_passes/Cargo.toml b/src/librustc_passes/Cargo.toml index d9fa435e3ad68..db481c0d0d4c2 100644 --- a/src/librustc_passes/Cargo.toml +++ b/src/librustc_passes/Cargo.toml @@ -9,7 +9,7 @@ name = "rustc_passes" path = "lib.rs" [dependencies] -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_middle = { path = "../librustc_middle" } rustc_attr = { path = "../librustc_attr" } rustc_data_structures = { path = "../librustc_data_structures" } diff --git a/src/librustc_passes/lib.rs b/src/librustc_passes/lib.rs index 95b236ba1c9e4..be4c542ec3a1d 100644 --- a/src/librustc_passes/lib.rs +++ b/src/librustc_passes/lib.rs @@ -13,7 +13,7 @@ #[macro_use] extern crate rustc_middle; #[macro_use] -extern crate log; +extern crate tracing; use rustc_middle::ty::query::Providers; diff --git a/src/librustc_privacy/Cargo.toml b/src/librustc_privacy/Cargo.toml index 6f543e71b4281..3641f0f8a3117 100644 --- a/src/librustc_privacy/Cargo.toml +++ b/src/librustc_privacy/Cargo.toml @@ -17,4 +17,4 @@ rustc_typeck = { path = "../librustc_typeck" } rustc_session = { path = "../librustc_session" } rustc_span = { path = "../librustc_span" } rustc_data_structures = { path = "../librustc_data_structures" } -log = { package = "tracing", version = "0.1" } +tracing = "0.1" diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 3ba5acd00a09a..9d142e45d2280 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -1853,7 +1853,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'tcx> { let ret = self.required_visibility == ty::Visibility::Public && self.tcx.is_private_dep(item_id.krate); - log::debug!("leaks_private_dep(item_id={:?})={}", item_id, ret); + tracing::debug!("leaks_private_dep(item_id={:?})={}", item_id, ret); ret } } diff --git a/src/librustc_query_system/Cargo.toml b/src/librustc_query_system/Cargo.toml index 64af9c5f1a152..9194ea6d30b4c 100644 --- a/src/librustc_query_system/Cargo.toml +++ b/src/librustc_query_system/Cargo.toml @@ -11,7 +11,7 @@ doctest = false [dependencies] rustc_arena = { path = "../librustc_arena" } -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc-rayon-core = "0.3.0" rustc_data_structures = { path = "../librustc_data_structures" } rustc_errors = { path = "../librustc_errors" } diff --git a/src/librustc_query_system/lib.rs b/src/librustc_query_system/lib.rs index 4bbba7befe93f..9c57dec94ec7f 100644 --- a/src/librustc_query_system/lib.rs +++ b/src/librustc_query_system/lib.rs @@ -7,7 +7,7 @@ #![feature(stmt_expr_attributes)] #[macro_use] -extern crate log; +extern crate tracing; #[macro_use] extern crate rustc_data_structures; diff --git a/src/librustc_resolve/Cargo.toml b/src/librustc_resolve/Cargo.toml index 1cb49132ead9c..e5260866f29e7 100644 --- a/src/librustc_resolve/Cargo.toml +++ b/src/librustc_resolve/Cargo.toml @@ -12,7 +12,7 @@ doctest = false [dependencies] bitflags = "1.2.1" -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_ast = { path = "../librustc_ast" } rustc_arena = { path = "../librustc_arena" } rustc_middle = { path = "../librustc_middle" } diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 11c7793b3ad9a..ddc16d18952ad 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -37,9 +37,9 @@ use rustc_span::source_map::{respan, Spanned}; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::Span; -use log::debug; use std::cell::Cell; use std::ptr; +use tracing::debug; type Res = def::Res; diff --git a/src/librustc_resolve/def_collector.rs b/src/librustc_resolve/def_collector.rs index 32af920020ce6..7dbf51aab28f1 100644 --- a/src/librustc_resolve/def_collector.rs +++ b/src/librustc_resolve/def_collector.rs @@ -1,5 +1,4 @@ use crate::Resolver; -use log::debug; use rustc_ast::ast::*; use rustc_ast::token::{self, Token}; use rustc_ast::visit::{self, FnKind}; @@ -11,6 +10,7 @@ use rustc_hir::definitions::*; use rustc_span::hygiene::ExpnId; use rustc_span::symbol::{kw, sym}; use rustc_span::Span; +use tracing::debug; crate fn collect_definitions( resolver: &mut Resolver<'_>, diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index de92204a7c2f0..1e5e937db663d 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -1,7 +1,6 @@ use std::cmp::Reverse; use std::ptr; -use log::debug; use rustc_ast::ast::{self, Path}; use rustc_ast::util::lev_distance::find_best_match_for_name; use rustc_ast_pretty::pprust; @@ -18,6 +17,7 @@ use rustc_span::hygiene::MacroKind; use rustc_span::source_map::SourceMap; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::{BytePos, MultiSpan, Span}; +use tracing::debug; use crate::imports::{Import, ImportKind, ImportResolver}; use crate::path_names_to_string; diff --git a/src/librustc_resolve/imports.rs b/src/librustc_resolve/imports.rs index d3f45f962a025..ef51a1c73afdf 100644 --- a/src/librustc_resolve/imports.rs +++ b/src/librustc_resolve/imports.rs @@ -28,7 +28,7 @@ use rustc_span::hygiene::ExpnId; use rustc_span::symbol::{kw, Ident, Symbol}; use rustc_span::{MultiSpan, Span}; -use log::*; +use tracing::*; use std::cell::Cell; use std::{mem, ptr}; diff --git a/src/librustc_resolve/late.rs b/src/librustc_resolve/late.rs index 7ecfe2554ec8a..2f63257a98214 100644 --- a/src/librustc_resolve/late.rs +++ b/src/librustc_resolve/late.rs @@ -29,10 +29,10 @@ use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::Span; use smallvec::{smallvec, SmallVec}; -use log::debug; use rustc_span::source_map::{respan, Spanned}; use std::collections::BTreeSet; use std::mem::{replace, take}; +use tracing::debug; mod diagnostics; crate mod lifetimes; @@ -1732,7 +1732,12 @@ impl<'a, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> { source: PathSource<'ast>, crate_lint: CrateLint, ) -> PartialRes { - log::debug!("smart_resolve_path_fragment(id={:?},qself={:?},path={:?}", id, qself, path); + tracing::debug!( + "smart_resolve_path_fragment(id={:?},qself={:?},path={:?}", + id, + qself, + path + ); let ns = source.namespace(); let is_expected = &|res| source.is_expected(res); diff --git a/src/librustc_resolve/late/diagnostics.rs b/src/librustc_resolve/late/diagnostics.rs index c57c0e5194185..173cf99e600bd 100644 --- a/src/librustc_resolve/late/diagnostics.rs +++ b/src/librustc_resolve/late/diagnostics.rs @@ -19,7 +19,7 @@ use rustc_span::hygiene::MacroKind; use rustc_span::symbol::{kw, sym, Ident}; use rustc_span::{BytePos, Span}; -use log::debug; +use tracing::debug; type Res = def::Res; diff --git a/src/librustc_resolve/late/lifetimes.rs b/src/librustc_resolve/late/lifetimes.rs index 0b881b089deaa..62186b359860a 100644 --- a/src/librustc_resolve/late/lifetimes.rs +++ b/src/librustc_resolve/late/lifetimes.rs @@ -26,7 +26,7 @@ use std::borrow::Cow; use std::cell::Cell; use std::mem::take; -use log::debug; +use tracing::debug; // This counts the no of times a lifetime is used #[derive(Clone, Copy, Debug)] diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index 79f5a27bb28ed..339a5ae6675e7 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -54,10 +54,10 @@ use rustc_span::source_map::Spanned; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::{Span, DUMMY_SP}; -use log::debug; use std::cell::{Cell, RefCell}; use std::collections::BTreeSet; use std::{cmp, fmt, iter, ptr}; +use tracing::debug; use diagnostics::{extend_span_to_previous_binding, find_span_of_binding_until_next_binding}; use diagnostics::{ImportSuggestion, LabelSuggestion, Suggestion}; diff --git a/src/librustc_save_analysis/Cargo.toml b/src/librustc_save_analysis/Cargo.toml index 7a5ae0ace3ae6..3c2edc1fa5571 100644 --- a/src/librustc_save_analysis/Cargo.toml +++ b/src/librustc_save_analysis/Cargo.toml @@ -9,7 +9,7 @@ name = "rustc_save_analysis" path = "lib.rs" [dependencies] -log = { package = "tracing", version = "0.1" } +tracing = "0.1" rustc_middle = { path = "../librustc_middle" } rustc_ast = { path = "../librustc_ast" } rustc_ast_pretty = { path = "../librustc_ast_pretty" } diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index 5aa676e3fce8e..f33d2f46aa269 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -45,7 +45,7 @@ use rls_data::{ RefKind, Relation, RelationKind, SpanData, }; -use log::{debug, error}; +use tracing::{debug, error}; macro_rules! down_cast_data { ($id:ident, $kind:ident, $sp:expr) => { diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 6469971fce830..ca98ada4e5729 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -45,7 +45,7 @@ use rls_data::{ RefKind, Relation, RelationKind, SpanData, }; -use log::{debug, error, info}; +use tracing::{debug, error, info}; pub struct SaveContext<'tcx> { tcx: TyCtxt<'tcx>, diff --git a/src/librustc_session/config.rs b/src/librustc_session/config.rs index 01f8d683ded5f..e05f6a5c7309d 100644 --- a/src/librustc_session/config.rs +++ b/src/librustc_session/config.rs @@ -716,7 +716,7 @@ pub fn default_configuration(sess: &Session) -> CrateConfig { let mut ret = FxHashSet::default(); ret.reserve(6); // the minimum number of insertions - // Target bindings. + // Target bindings. ret.insert((sym::target_os, Some(Symbol::intern(os)))); if let Some(ref fam) = sess.target.target.options.target_family { ret.insert((sym::target_family, Some(Symbol::intern(fam)))); @@ -875,11 +875,7 @@ mod opt { } fn longer(a: S, b: S) -> S { - if a.len() > b.len() { - a - } else { - b - } + if a.len() > b.len() { a } else { b } } pub fn opt_s(a: S, b: S, c: S, d: S) -> R { @@ -1414,11 +1410,7 @@ fn parse_opt_level( .into_iter() .flat_map( |(i, s)| { - if let Some("opt-level") = s.splitn(2, '=').next() { - Some(i) - } else { - None - } + if let Some("opt-level") = s.splitn(2, '=').next() { Some(i) } else { None } }, ) .max(); @@ -1457,11 +1449,7 @@ fn select_debuginfo( .into_iter() .flat_map( |(i, s)| { - if let Some("debuginfo") = s.splitn(2, '=').next() { - Some(i) - } else { - None - } + if let Some("debuginfo") = s.splitn(2, '=').next() { Some(i) } else { None } }, ) .max(); diff --git a/src/librustc_session/filesearch.rs b/src/librustc_session/filesearch.rs index c68e6c24400cc..284fca652ece7 100644 --- a/src/librustc_session/filesearch.rs +++ b/src/librustc_session/filesearch.rs @@ -52,11 +52,7 @@ impl<'a> FileSearch<'a> { for search_path in self.search_paths() { debug!("searching {}", search_path.dir.display()); fn is_rlib(spf: &SearchPathFile) -> bool { - if let Some(f) = &spf.file_name_str { - f.ends_with(".rlib") - } else { - false - } + if let Some(f) = &spf.file_name_str { f.ends_with(".rlib") } else { false } } // Reading metadata out of rlibs is faster, and if we find both // an rlib and a dylib we only read one of the files of @@ -102,11 +98,7 @@ impl<'a> FileSearch<'a> { p.push(RUST_LIB_DIR); p.push(&self.triple); p.push("bin"); - if self_contained { - vec![p.clone(), p.join("self-contained")] - } else { - vec![p] - } + if self_contained { vec![p.clone(), p.join("self-contained")] } else { vec![p] } } } diff --git a/src/librustc_span/hygiene.rs b/src/librustc_span/hygiene.rs index 2c2e7c0b63cc3..10de701c9fa1b 100644 --- a/src/librustc_span/hygiene.rs +++ b/src/librustc_span/hygiene.rs @@ -761,11 +761,7 @@ impl ExpnData { #[inline] pub fn is_root(&self) -> bool { - if let ExpnKind::Root = self.kind { - true - } else { - false - } + if let ExpnKind::Root = self.kind { true } else { false } } } diff --git a/src/librustc_span/source_map.rs b/src/librustc_span/source_map.rs index 628cf6a904bd6..ff56419797d51 100644 --- a/src/librustc_span/source_map.rs +++ b/src/librustc_span/source_map.rs @@ -902,11 +902,7 @@ impl SourceMap { } debug!("find_width_of_character_at_span: final target=`{:?}`", target); - if forwards { - (target - end_index) as u32 - } else { - (end_index - target) as u32 - } + if forwards { (target - end_index) as u32 } else { (end_index - target) as u32 } } pub fn get_source_file(&self, filename: &FileName) -> Option> { diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index f6bd25aa4665b..1506be8ae1ad2 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -402,11 +402,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorReported> { check_unused::check_crate(tcx); check_for_entry_fn(tcx); - if tcx.sess.err_count() == 0 { - Ok(()) - } else { - Err(ErrorReported) - } + if tcx.sess.err_count() == 0 { Ok(()) } else { Err(ErrorReported) } } /// A quasi-deprecated helper used in rustdoc and clippy to get diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 007ac13764e62..90a0d8926ad94 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -843,11 +843,7 @@ impl Config { None => false, }; - if is_match { - ParsedNameDirective::Match - } else { - ParsedNameDirective::NoMatch - } + if is_match { ParsedNameDirective::Match } else { ParsedNameDirective::NoMatch } } fn has_cfg_prefix(&self, line: &str, prefix: &str) -> bool { diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index 5a2c7e8e354d6..46e16393a24c1 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -158,11 +158,7 @@ pub fn parse_config(args: Vec) -> Config { } fn make_absolute(path: PathBuf) -> PathBuf { - if path.is_relative() { - env::current_dir().unwrap().join(path) - } else { - path - } + if path.is_relative() { env::current_dir().unwrap().join(path) } else { path } } let target = opt_str2(matches.opt_str("target")); diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 622923b2ad8c1..03136921ad626 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2099,11 +2099,7 @@ impl<'test> TestCx<'test> { Some(ref s) => s .split(' ') .filter_map(|s| { - if s.chars().all(|c| c.is_whitespace()) { - None - } else { - Some(s.to_owned()) - } + if s.chars().all(|c| c.is_whitespace()) { None } else { Some(s.to_owned()) } }) .collect(), None => Vec::new(), @@ -2162,11 +2158,7 @@ impl<'test> TestCx<'test> { /// The revision, ignored for incremental compilation since it wants all revisions in /// the same directory. fn safe_revision(&self) -> Option<&str> { - if self.config.mode == Incremental { - None - } else { - self.revision - } + if self.config.mode == Incremental { None } else { self.revision } } /// Gets the absolute path to the directory where all output for the given @@ -2303,11 +2295,7 @@ impl<'test> TestCx<'test> { fn charset() -> &'static str { // FreeBSD 10.1 defaults to GDB 6.1.1 which doesn't support "auto" charset - if cfg!(target_os = "freebsd") { - "ISO-8859-1" - } else { - "UTF-8" - } + if cfg!(target_os = "freebsd") { "ISO-8859-1" } else { "UTF-8" } } fn run_rustdoc_test(&self) { @@ -3521,11 +3509,7 @@ impl<'test> TestCx<'test> { for output_file in files { println!("Actual {} saved to {}", kind, output_file.display()); } - if self.config.bless { - 0 - } else { - 1 - } + if self.config.bless { 0 } else { 1 } } fn prune_duplicate_output(&self, mode: CompareMode, kind: &str, canon_content: &str) { diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs index 20965f348c600..908d46f945c5d 100644 --- a/src/tools/compiletest/src/util.rs +++ b/src/tools/compiletest/src/util.rs @@ -146,11 +146,7 @@ pub fn is_big_endian(triple: &str) -> bool { } pub fn matches_env(triple: &str, name: &str) -> bool { - if let Some(env) = triple.split('-').nth(3) { - env.starts_with(name) - } else { - false - } + if let Some(env) = triple.split('-').nth(3) { env.starts_with(name) } else { false } } pub fn get_pointer_width(triple: &str) -> &'static str {