Remove extern crate tracing from numerous crates.

This commit is contained in:
Nicholas Nethercote 2024-04-29 16:24:06 +10:00
parent 52e9a23bdc
commit 6341935a13
47 changed files with 47 additions and 70 deletions

View File

@ -20,9 +20,6 @@
#![feature(negative_impls)]
#![feature(stmt_expr_attributes)]
#[macro_use]
extern crate tracing;
pub mod util {
pub mod case;
pub mod classify;

View File

@ -8,6 +8,7 @@
use rustc_span::symbol::{kw, sym, Symbol};
use rustc_span::Span;
use std::{ascii, fmt, str};
use tracing::debug;
// Escapes a string, represented as a symbol. Reuses the original symbol,
// avoiding interning, if no changes are required.

View File

@ -7,6 +7,7 @@
use rustc_middle::span_bug;
use rustc_middle::ty::TyCtxt;
use rustc_span::{Span, DUMMY_SP};
use tracing::{debug, instrument};
/// A visitor that walks over the HIR and collects `Node`s into a HIR map.
struct NodeCollector<'a, 'hir> {

View File

@ -20,6 +20,7 @@
use rustc_target::spec::abi;
use smallvec::{smallvec, SmallVec};
use thin_vec::ThinVec;
use tracing::instrument;
pub(super) struct ItemLowerer<'a, 'hir> {
pub(super) tcx: TyCtxt<'hir>,

View File

@ -37,11 +37,7 @@
#![feature(box_patterns)]
#![feature(let_chains)]
#[macro_use]
extern crate tracing;
use crate::errors::{AssocTyParentheses, AssocTyParenthesesSub, MisplacedImplTrait};
use rustc_ast::node_id::NodeMap;
use rustc_ast::ptr::P;
use rustc_ast::{self as ast, *};
@ -69,6 +65,7 @@
use smallvec::{smallvec, SmallVec};
use std::collections::hash_map::Entry;
use thin_vec::ThinVec;
use tracing::{debug, instrument, trace};
macro_rules! arena_vec {
($this:expr; $($x:expr),*) => (

View File

@ -18,6 +18,7 @@
use rustc_span::{BytePos, DesugaringKind, Span, Symbol, DUMMY_SP};
use smallvec::{smallvec, SmallVec};
use tracing::{debug, instrument};
impl<'a, 'hir> LoweringContext<'a, 'hir> {
#[instrument(level = "trace", skip(self))]

View File

@ -18,6 +18,7 @@
use rustc_span::symbol::sym;
use rustc_span::Span;
use smallvec::SmallVec;
use tracing::instrument;
pub(crate) fn expand(
ecx: &mut ExtCtxt<'_>,

View File

@ -19,11 +19,7 @@
extern crate proc_macro;
#[macro_use]
extern crate tracing;
use crate::deriving::*;
use rustc_expand::base::{MacroExpanderFn, ResolverExpand, SyntaxExtensionKind};
use rustc_expand::proc_macro::BangProcMacro;
use rustc_span::symbol::sym;

View File

@ -12,6 +12,7 @@
use std::assert_matches::assert_matches;
use std::iter;
use thin_vec::{thin_vec, ThinVec};
use tracing::debug;
/// #[test_case] is used by custom test authors to mark tests
/// When building for test, it needs to make the item public and gensym the name

View File

@ -14,9 +14,6 @@
#![feature(panic_update_hook)]
#![feature(result_flattening)]
#[macro_use]
extern crate tracing;
use rustc_ast as ast;
use rustc_codegen_ssa::{traits::CodegenBackend, CodegenErrors, CodegenResults};
use rustc_const_eval::CTRL_C_RECEIVED;
@ -46,7 +43,6 @@
use rustc_span::FileName;
use rustc_target::json::ToJson;
use rustc_target::spec::{Target, TargetTriple};
use std::cmp::max;
use std::collections::BTreeMap;
use std::env;
@ -62,6 +58,7 @@
use std::sync::{Arc, OnceLock};
use std::time::{Instant, SystemTime};
use time::OffsetDateTime;
use tracing::trace;
#[allow(unused_macros)]
macro do_not_use_print($($t:tt)*) {

View File

@ -13,9 +13,9 @@
use rustc_smir::rustc_internal::pretty::write_smir_pretty;
use rustc_span::symbol::Ident;
use rustc_span::FileName;
use std::cell::Cell;
use std::fmt::Write;
use tracing::debug;
pub use self::PpMode::*;
pub use self::PpSourceMode::*;

View File

@ -18,6 +18,7 @@
use std::ops::{Deref, DerefMut};
use std::panic;
use std::thread::panicking;
use tracing::debug;
/// Error type for `DiagInner`'s `suggestions` field, indicating that
/// `.disable_suggestions()` was called on the `DiagInner`.

View File

@ -35,6 +35,7 @@
use std::path::Path;
use termcolor::{Buffer, BufferWriter, ColorChoice, ColorSpec, StandardStream};
use termcolor::{Color, WriteColor};
use tracing::{debug, instrument, trace, warn};
/// Default column width, used in tests and when terminal dimensions cannot be determined.
const DEFAULT_COLUMN_WIDTH: usize = 140;

View File

@ -25,9 +25,6 @@
#![feature(yeet_expr)]
// tidy-alphabetical-end
#[macro_use]
extern crate tracing;
extern crate self as rustc_errors;
pub use codes::*;
@ -74,6 +71,7 @@
use std::ops::DerefMut;
use std::panic;
use std::path::{Path, PathBuf};
use tracing::debug;
use Level::*;

View File

@ -6,6 +6,7 @@
use std::borrow::Cow;
use std::env;
use std::error::Report;
use tracing::{debug, trace};
/// Convert diagnostic arguments (a rustc internal type that exists to implement
/// `Encodable`/`Decodable`) into `FluentArgs` which is necessary to perform translation.

View File

@ -20,6 +20,7 @@
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use thin_vec::ThinVec;
use tracing::instrument;
/// A folder that strips out items that do not belong in the current configuration.
pub struct StripUnconfigured<'a> {

View File

@ -16,9 +16,6 @@
#![allow(rustc::diagnostic_outside_of_impl)]
#![allow(internal_features)]
#[macro_use]
extern crate tracing;
extern crate proc_macro as pm;
mod placeholders;

View File

@ -14,6 +14,7 @@
use rustc_span::symbol::Ident;
use rustc_span::{ErrorGuaranteed, Span};
use std::borrow::Cow;
use tracing::debug;
use super::macro_rules::{parser_from_cx, NoopTracker};

View File

@ -29,6 +29,7 @@
use rustc_span::hygiene::Transparency;
use rustc_span::symbol::{kw, sym, Ident, MacroRulesNormalizedIdent};
use rustc_span::Span;
use tracing::{debug, instrument, trace, trace_span};
use std::borrow::Cow;
use std::collections::hash_map::Entry;

View File

@ -7,15 +7,14 @@
pub use crate::def_id::DefPathHash;
use crate::def_id::{CrateNum, DefIndex, LocalDefId, StableCrateId, CRATE_DEF_INDEX, LOCAL_CRATE};
use crate::def_path_hash_map::DefPathHashMap;
use rustc_data_structures::stable_hasher::{Hash64, StableHasher};
use rustc_data_structures::unord::UnordMap;
use rustc_index::IndexVec;
use rustc_macros::{Decodable, Encodable};
use rustc_span::symbol::{kw, sym, Symbol};
use std::fmt::{self, Write};
use std::hash::Hash;
use tracing::{debug, instrument};
/// The `DefPathTable` maps `DefIndex`es to `DefKey`s and vice versa.
/// Internally the `DefPathTable` holds a tree of `DefKey`s, where each `DefKey`

View File

@ -3,7 +3,6 @@
pub(crate) use crate::hir_id::{HirId, ItemLocalId, ItemLocalMap, OwnerId};
use crate::intravisit::FnKind;
use crate::LangItem;
use rustc_ast as ast;
use rustc_ast::util::parser::ExprPrecedence;
use rustc_ast::{Attribute, FloatTy, IntTy, Label, LitKind, TraitObjectSyntax, UintTy};
@ -21,9 +20,9 @@
use rustc_span::{def_id::LocalDefId, BytePos, Span, DUMMY_SP};
use rustc_target::asm::InlineAsmRegOrRegClass;
use rustc_target::spec::abi::Abi;
use smallvec::SmallVec;
use std::fmt;
use tracing::debug;
#[derive(Debug, Copy, Clone, HashStable_Generic)]
pub struct Lifetime {

View File

@ -10,9 +10,6 @@
#![feature(variant_count)]
#![allow(internal_features)]
#[macro_use]
extern crate tracing;
extern crate self as rustc_hir;
mod arena;

View File

@ -14,9 +14,6 @@
pub mod rustc;
pub mod usefulness;
#[macro_use]
extern crate tracing;
#[cfg(feature = "rustc")]
rustc_fluent_macro::fluent_messages! { "../messages.ftl" }

View File

@ -1,11 +1,11 @@
use rustc_session::lint::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS;
use rustc_span::ErrorGuaranteed;
use crate::constructor::Constructor;
use crate::errors::{NonExhaustiveOmittedPattern, NonExhaustiveOmittedPatternLintOnArm, Uncovered};
use crate::pat_column::PatternColumn;
use crate::rustc::{RevealedTy, RustcPatCtxt, WitnessPat};
use crate::MatchArm;
use rustc_session::lint::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS;
use rustc_span::ErrorGuaranteed;
use tracing::instrument;
/// Traverse the patterns to collect any variants of a non_exhaustive enum that fail to be mentioned
/// in a given column.

View File

@ -709,16 +709,15 @@
//! I (Nadrieril) prefer to put new tests in `ui/pattern/usefulness` unless there's a specific
//! reason not to, for example if they crucially depend on a particular feature like `or_patterns`.
use self::PlaceValidity::*;
use crate::constructor::{Constructor, ConstructorSet, IntRange};
use crate::pat::{DeconstructedPat, PatId, PatOrWild, WitnessPat};
use crate::{Captures, MatchArm, PatCx, PrivateUninhabitedField};
use rustc_hash::FxHashSet;
use rustc_index::bit_set::BitSet;
use smallvec::{smallvec, SmallVec};
use std::fmt;
use crate::constructor::{Constructor, ConstructorSet, IntRange};
use crate::pat::{DeconstructedPat, PatId, PatOrWild, WitnessPat};
use crate::{Captures, MatchArm, PatCx, PrivateUninhabitedField};
use self::PlaceValidity::*;
use tracing::{debug, instrument};
#[cfg(feature = "rustc")]
use rustc_data_structures::stack::ensure_sufficient_stack;

View File

@ -6,9 +6,6 @@
#![feature(try_blocks)]
#![feature(let_chains)]
#[macro_use]
extern crate tracing;
mod errors;
use rustc_ast::visit::{try_visit, VisitorResult};
@ -31,6 +28,7 @@
use rustc_span::hygiene::Transparency;
use rustc_span::symbol::{kw, sym, Ident};
use rustc_span::Span;
use tracing::debug;
use std::fmt;
use std::marker::PhantomData;

View File

@ -15,6 +15,7 @@
use std::marker::PhantomData;
use std::sync::atomic::Ordering;
use std::sync::Arc;
use tracing::{debug, instrument};
use super::query::DepGraphQuery;
use super::serialized::{GraphEncoder, SerializedDepGraph, SerializedDepNodeIndex};

View File

@ -11,13 +11,12 @@
pub use query::DepGraphQuery;
pub use serialized::{SerializedDepGraph, SerializedDepNodeIndex};
use self::graph::{print_markframe_trace, MarkFrame};
use crate::ich::StableHashingContext;
use rustc_data_structures::profiling::SelfProfilerRef;
use rustc_session::Session;
use std::panic;
use self::graph::{print_markframe_trace, MarkFrame};
use tracing::instrument;
pub trait DepContext: Copy {
type Deps: Deps;

View File

@ -51,6 +51,7 @@
use std::iter;
use std::marker::PhantomData;
use std::sync::Arc;
use tracing::{debug, instrument};
// The maximum value of `SerializedDepNodeIndex` leaves the upper two bits
// unused so that we can store multiple index types in `CompressedHybridIndex`,

View File

@ -5,9 +5,6 @@
#![feature(let_chains)]
#![allow(rustc::potential_query_instability, internal_features)]
#[macro_use]
extern crate tracing;
pub mod cache;
pub mod dep_graph;
mod error;

View File

@ -27,6 +27,7 @@
use std::hash::Hash;
use std::mem;
use thin_vec::ThinVec;
use tracing::instrument;
use super::QueryConfig;

View File

@ -33,6 +33,7 @@
use std::path::{Path, PathBuf};
use std::str::{self, FromStr};
use std::sync::LazyLock;
use tracing::debug;
mod cfg;
pub mod sigpipe;

View File

@ -1,13 +1,12 @@
//! A module for searching for libraries
use rustc_fs_util::try_canonicalize;
use crate::search_paths::{PathKind, SearchPath};
use rustc_fs_util::{fix_windows_verbatim_for_gcc, try_canonicalize};
use smallvec::{smallvec, SmallVec};
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use crate::search_paths::{PathKind, SearchPath};
use rustc_fs_util::fix_windows_verbatim_for_gcc;
use tracing::debug;
#[derive(Clone)]
pub struct FileSearch<'a> {

View File

@ -8,9 +8,6 @@
pub mod errors;
#[macro_use]
extern crate tracing;
pub mod utils;
pub use lint::{declare_lint, declare_lint_pass, declare_tool_lint, impl_lint_pass};
pub use rustc_lint_defs as lint;

View File

@ -5,9 +5,9 @@
use rustc_middle::ty::print::{PrettyPrinter, Print, PrintError, Printer};
use rustc_middle::ty::{self, Instance, ReifyReason, Ty, TyCtxt, TypeVisitableExt};
use rustc_middle::ty::{GenericArg, GenericArgKind};
use std::fmt::{self, Write};
use std::mem::{self, discriminant};
use tracing::debug;
pub(super) fn mangle<'tcx>(
tcx: TyCtxt<'tcx>,

View File

@ -93,9 +93,6 @@
#![feature(let_chains)]
#![allow(internal_features)]
#[macro_use]
extern crate tracing;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{CrateNum, LOCAL_CRATE};
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
@ -104,6 +101,7 @@
use rustc_middle::query::Providers;
use rustc_middle::ty::{self, Instance, TyCtxt};
use rustc_session::config::SymbolManglingVersion;
use tracing::debug;
mod hashed;
mod legacy;

View File

@ -20,9 +20,6 @@
use std::path::{Path, PathBuf};
#[macro_use]
extern crate tracing;
pub mod abi;
pub mod asm;
pub mod json;

View File

@ -51,6 +51,7 @@
use std::path::{Path, PathBuf};
use std::str::FromStr;
use std::{fmt, io};
use tracing::debug;
pub mod abi;
pub mod crt_objects;

View File

@ -13,6 +13,7 @@
ImplSource, Obligation, ObligationCause, SelectionContext, TraitEngine, TraitEngineExt,
Unimplemented,
};
use tracing::debug;
/// Attempts to resolve an obligation to an `ImplSource`. The result is
/// a shallow `ImplSource` resolution, meaning that we do not

View File

@ -12,6 +12,7 @@
compute_dropck_outlives_inner, dtorck_constraint_for_ty_inner,
};
use rustc_trait_selection::traits::query::{CanonicalTyGoal, NoSolution};
use tracing::debug;
pub(crate) fn provide(p: &mut Providers) {
*p = Providers { dropck_outlives, adt_dtorck_constraint, ..*p };

View File

@ -6,6 +6,7 @@
use rustc_trait_selection::traits::{
EvaluationResult, Obligation, ObligationCause, OverflowError, SelectionContext, TraitQueryMode,
};
use tracing::debug;
pub(crate) fn provide(p: &mut Providers) {
*p = Providers { evaluate_obligation, ..*p };

View File

@ -2,9 +2,6 @@
#![recursion_limit = "256"]
#[macro_use]
extern crate tracing;
mod codegen;
mod dropck_outlives;
mod evaluate_obligation;

View File

@ -4,6 +4,7 @@
use rustc_middle::ty::{self, ParamEnvAnd, TyCtxt, TypeFoldable, TypeVisitableExt};
use rustc_trait_selection::traits::query::normalize::QueryNormalizeExt;
use rustc_trait_selection::traits::{Normalized, ObligationCause};
use tracing::debug;
pub(crate) fn provide(p: &mut Providers) {
*p = Providers {

View File

@ -10,6 +10,7 @@
use rustc_trait_selection::traits::{
self, FulfillmentErrorCode, ObligationCause, SelectionContext,
};
use tracing::debug;
pub(crate) fn provide(p: &mut Providers) {
*p = Providers {

View File

@ -2,6 +2,7 @@
use crate::Map;
use std::fmt;
use std::sync::atomic::{AtomicU32, Ordering};
use tracing::instrument;
#[derive(PartialEq, Clone, Debug)]
pub(crate) struct Dfa<R>

View File

@ -2,9 +2,6 @@
#![feature(never_type)]
#![allow(unused_variables)]
#[macro_use]
extern crate tracing;
pub(crate) use rustc_data_structures::fx::{FxIndexMap as Map, FxIndexSet as Set};
pub mod layout;

View File

@ -1,3 +1,5 @@
use tracing::{debug, instrument, trace};
pub(crate) mod query_context;
#[cfg(test)]
mod tests;