From d1f5beeed5d9ed2274006c1d93c0608111774b7c Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 10 May 2024 13:46:24 +1000 Subject: [PATCH] Remove `#[macro_use] extern crate tracing` from `rustc_resolve`. Explicit imports are more standard nowadays and easier to read. --- compiler/rustc_resolve/src/build_reduced_graph.rs | 2 ++ compiler/rustc_resolve/src/def_collector.rs | 1 + compiler/rustc_resolve/src/diagnostics.rs | 1 + .../rustc_resolve/src/effective_visibilities.rs | 1 + compiler/rustc_resolve/src/ident.rs | 1 + compiler/rustc_resolve/src/imports.rs | 1 + compiler/rustc_resolve/src/late.rs | 1 + compiler/rustc_resolve/src/late/diagnostics.rs | 1 + compiler/rustc_resolve/src/lib.rs | 14 +++++--------- compiler/rustc_resolve/src/rustdoc.rs | 1 + 10 files changed, 15 insertions(+), 9 deletions(-) diff --git a/compiler/rustc_resolve/src/build_reduced_graph.rs b/compiler/rustc_resolve/src/build_reduced_graph.rs index 3467f1c3edf..5bc51f3852c 100644 --- a/compiler/rustc_resolve/src/build_reduced_graph.rs +++ b/compiler/rustc_resolve/src/build_reduced_graph.rs @@ -32,6 +32,8 @@ use std::cell::Cell; +use tracing::debug; + type Res = def::Res; impl<'a, Id: Into> ToNameBinding<'a> diff --git a/compiler/rustc_resolve/src/def_collector.rs b/compiler/rustc_resolve/src/def_collector.rs index a27a6bceda3..96d953debe2 100644 --- a/compiler/rustc_resolve/src/def_collector.rs +++ b/compiler/rustc_resolve/src/def_collector.rs @@ -7,6 +7,7 @@ use rustc_span::hygiene::LocalExpnId; use rustc_span::symbol::{kw, sym, Symbol}; use rustc_span::Span; +use tracing::debug; pub(crate) fn collect_definitions( resolver: &mut Resolver<'_, '_>, diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 01e279b6d04..a6b0902c09e 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -28,6 +28,7 @@ use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::{BytePos, Span, SyntaxContext}; use thin_vec::{thin_vec, ThinVec}; +use tracing::debug; use crate::errors::{ self, AddedMacroUse, ChangeImportBinding, ChangeImportBindingSuggestion, ConsiderAddingADerive, diff --git a/compiler/rustc_resolve/src/effective_visibilities.rs b/compiler/rustc_resolve/src/effective_visibilities.rs index 3443bbe6e11..7c1d8e7af5a 100644 --- a/compiler/rustc_resolve/src/effective_visibilities.rs +++ b/compiler/rustc_resolve/src/effective_visibilities.rs @@ -11,6 +11,7 @@ use rustc_middle::middle::privacy::{EffectiveVisibilities, EffectiveVisibility}; use rustc_middle::ty::Visibility; use std::mem; +use tracing::info; #[derive(Clone, Copy)] enum ParentId<'a> { diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index 43a43e01a9a..f88725830f1 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -11,6 +11,7 @@ use rustc_span::sym; use rustc_span::symbol::{kw, Ident}; use rustc_span::Span; +use tracing::{debug, instrument}; use crate::errors::{ParamKindInEnumDiscriminant, ParamKindInNonTrivialAnonConst}; use crate::late::{ConstantHasGenerics, NoConstantGenericsReason, PathSource, Rib, RibKind}; diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs index 3d9380a3ebd..f53bcb0e9d0 100644 --- a/compiler/rustc_resolve/src/imports.rs +++ b/compiler/rustc_resolve/src/imports.rs @@ -34,6 +34,7 @@ use rustc_span::symbol::{kw, Ident, Symbol}; use rustc_span::Span; use smallvec::SmallVec; +use tracing::debug; use std::cell::Cell; use std::mem; diff --git a/compiler/rustc_resolve/src/late.rs b/compiler/rustc_resolve/src/late.rs index 5dd95a1896b..1bdc261c693 100644 --- a/compiler/rustc_resolve/src/late.rs +++ b/compiler/rustc_resolve/src/late.rs @@ -30,6 +30,7 @@ use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::{BytePos, Span, SyntaxContext}; use smallvec::{smallvec, SmallVec}; +use tracing::{debug, instrument, trace}; use std::assert_matches::debug_assert_matches; use std::borrow::Cow; diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 64451030adf..ac6a864ea0e 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -40,6 +40,7 @@ use std::ops::Deref; use thin_vec::ThinVec; +use tracing::debug; use super::NoConstantGenericsReason; diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index f1a8b56e7bb..2381623b841 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -23,12 +23,6 @@ #![feature(rustdoc_internals)] // tidy-alphabetical-end -#[macro_use] -extern crate tracing; - -use errors::{ - ParamKindInEnumDiscriminant, ParamKindInNonTrivialAnonConst, ParamKindInTyOfConstParam, -}; use rustc_arena::{DroplessArena, TypedArena}; use rustc_ast::expand::StrippedCfgItem; use rustc_ast::node_id::NodeMap; @@ -61,19 +55,21 @@ use rustc_span::hygiene::{ExpnId, LocalExpnId, MacroKind, SyntaxContext, Transparency}; use rustc_span::symbol::{kw, sym, Ident, Symbol}; use rustc_span::{Span, DUMMY_SP}; - use smallvec::{smallvec, SmallVec}; use std::cell::{Cell, RefCell}; use std::collections::BTreeSet; use std::fmt; +use tracing::debug; use diagnostics::{ImportSuggestion, LabelSuggestion, Suggestion}; +use effective_visibilities::EffectiveVisibilitiesVisitor; +use errors::{ + ParamKindInEnumDiscriminant, ParamKindInNonTrivialAnonConst, ParamKindInTyOfConstParam, +}; use imports::{Import, ImportData, ImportKind, NameResolution}; use late::{HasGenericParams, PathSource, PatternSource, UnnecessaryQualification}; use macros::{MacroRulesBinding, MacroRulesScope, MacroRulesScopeRef}; -use crate::effective_visibilities::EffectiveVisibilitiesVisitor; - type Res = def::Res; mod build_reduced_graph; diff --git a/compiler/rustc_resolve/src/rustdoc.rs b/compiler/rustc_resolve/src/rustdoc.rs index aace0f3fef9..66b4981eb55 100644 --- a/compiler/rustc_resolve/src/rustdoc.rs +++ b/compiler/rustc_resolve/src/rustdoc.rs @@ -8,6 +8,7 @@ use rustc_span::{InnerSpan, Span, DUMMY_SP}; use std::mem; use std::ops::Range; +use tracing::{debug, trace}; #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub enum DocFragmentKind {