From cc16c902f13c6ba0f191eb6cc151a4b5e009eace Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Fri, 30 Aug 2024 09:02:58 +1000 Subject: [PATCH] Remove `#[macro_use] extern crate tracing` from `rustc_hir_analysis`. --- compiler/rustc_hir_analysis/src/autoderef.rs | 1 + compiler/rustc_hir_analysis/src/check/check.rs | 1 + compiler/rustc_hir_analysis/src/check/compare_impl_item.rs | 1 + compiler/rustc_hir_analysis/src/check/mod.rs | 1 + compiler/rustc_hir_analysis/src/check/region.rs | 1 + compiler/rustc_hir_analysis/src/check/wfcheck.rs | 1 + compiler/rustc_hir_analysis/src/check_unused.rs | 1 + compiler/rustc_hir_analysis/src/coherence/builtin.rs | 1 + .../rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs | 1 + compiler/rustc_hir_analysis/src/coherence/mod.rs | 1 + compiler/rustc_hir_analysis/src/coherence/orphan.rs | 1 + compiler/rustc_hir_analysis/src/collect.rs | 1 + compiler/rustc_hir_analysis/src/collect/generics_of.rs | 1 + compiler/rustc_hir_analysis/src/collect/item_bounds.rs | 1 + compiler/rustc_hir_analysis/src/collect/predicates_of.rs | 1 + compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs | 1 + compiler/rustc_hir_analysis/src/collect/type_of.rs | 1 + compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs | 1 + compiler/rustc_hir_analysis/src/constrained_generic_params.rs | 1 + .../src/errors/wrong_number_of_generic_args.rs | 1 + compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs | 1 + compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs | 1 + compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs | 1 + .../rustc_hir_analysis/src/hir_ty_lowering/object_safety.rs | 1 + compiler/rustc_hir_analysis/src/hir_wf_check.rs | 1 + .../rustc_hir_analysis/src/impl_wf_check/min_specialization.rs | 1 + compiler/rustc_hir_analysis/src/lib.rs | 3 --- compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs | 1 + compiler/rustc_hir_analysis/src/variance/constraints.rs | 1 + compiler/rustc_hir_analysis/src/variance/mod.rs | 1 + compiler/rustc_hir_analysis/src/variance/solve.rs | 1 + compiler/rustc_hir_analysis/src/variance/terms.rs | 1 + 32 files changed, 31 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/autoderef.rs b/compiler/rustc_hir_analysis/src/autoderef.rs index 53c8586b52a..46a0d4f498a 100644 --- a/compiler/rustc_hir_analysis/src/autoderef.rs +++ b/compiler/rustc_hir_analysis/src/autoderef.rs @@ -4,6 +4,7 @@ use rustc_span::def_id::{LocalDefId, LOCAL_CRATE}; use rustc_span::Span; use rustc_trait_selection::traits::ObligationCtxt; +use tracing::{debug, instrument}; use crate::errors::AutoDerefReachedRecursionLimit; use crate::traits; diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs index d414bcdb95b..e47c707ee18 100644 --- a/compiler/rustc_hir_analysis/src/check/check.rs +++ b/compiler/rustc_hir_analysis/src/check/check.rs @@ -27,6 +27,7 @@ use rustc_trait_selection::traits; use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _; use rustc_type_ir::fold::TypeFoldable; +use tracing::{debug, instrument}; use {rustc_attr as attr, rustc_hir as hir}; use super::compare_impl_item::{check_type_bounds, compare_impl_method, compare_impl_ty}; diff --git a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs index 35577613800..2afed04c5bc 100644 --- a/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs +++ b/compiler/rustc_hir_analysis/src/check/compare_impl_item.rs @@ -28,6 +28,7 @@ use rustc_trait_selection::traits::{ self, FulfillmentError, ObligationCause, ObligationCauseCode, ObligationCtxt, Reveal, }; +use tracing::{debug, instrument}; use super::potentially_plural_count; use crate::errors::{LifetimesOrBoundsMismatchOnTrait, MethodShouldReturnFuture}; diff --git a/compiler/rustc_hir_analysis/src/check/mod.rs b/compiler/rustc_hir_analysis/src/check/mod.rs index 678b8c89a50..6820a44f141 100644 --- a/compiler/rustc_hir_analysis/src/check/mod.rs +++ b/compiler/rustc_hir_analysis/src/check/mod.rs @@ -97,6 +97,7 @@ use rustc_trait_selection::error_reporting::traits::suggestions::ReturnsVisitor; use rustc_trait_selection::error_reporting::InferCtxtErrorExt; use rustc_trait_selection::traits::ObligationCtxt; +use tracing::debug; use self::compare_impl_item::collect_return_position_impl_trait_in_trait_tys; use self::region::region_scope_tree; diff --git a/compiler/rustc_hir_analysis/src/check/region.rs b/compiler/rustc_hir_analysis/src/check/region.rs index 48335173979..2d6147cff2a 100644 --- a/compiler/rustc_hir_analysis/src/check/region.rs +++ b/compiler/rustc_hir_analysis/src/check/region.rs @@ -18,6 +18,7 @@ use rustc_middle::middle::region::*; use rustc_middle::ty::TyCtxt; use rustc_span::source_map; +use tracing::debug; use super::errs::{maybe_expr_static_mut, maybe_stmt_static_mut}; diff --git a/compiler/rustc_hir_analysis/src/check/wfcheck.rs b/compiler/rustc_hir_analysis/src/check/wfcheck.rs index cb66179ec80..359b4729e50 100644 --- a/compiler/rustc_hir_analysis/src/check/wfcheck.rs +++ b/compiler/rustc_hir_analysis/src/check/wfcheck.rs @@ -36,6 +36,7 @@ }; use rustc_type_ir::solve::NoSolution; use rustc_type_ir::TypeFlags; +use tracing::{debug, instrument}; use {rustc_ast as ast, rustc_hir as hir}; use crate::autoderef::Autoderef; diff --git a/compiler/rustc_hir_analysis/src/check_unused.rs b/compiler/rustc_hir_analysis/src/check_unused.rs index ca9e2e8a3cc..68b7b44c36d 100644 --- a/compiler/rustc_hir_analysis/src/check_unused.rs +++ b/compiler/rustc_hir_analysis/src/check_unused.rs @@ -4,6 +4,7 @@ use rustc_middle::query::Providers; use rustc_middle::ty::TyCtxt; use rustc_session::lint; +use tracing::debug; pub(crate) fn provide(providers: &mut Providers) { *providers = Providers { check_unused_traits, ..*providers }; diff --git a/compiler/rustc_hir_analysis/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs index 23f1adfe302..9f01f7be80a 100644 --- a/compiler/rustc_hir_analysis/src/coherence/builtin.rs +++ b/compiler/rustc_hir_analysis/src/coherence/builtin.rs @@ -23,6 +23,7 @@ ConstParamTyImplementationError, CopyImplementationError, InfringingFieldsReason, }; use rustc_trait_selection::traits::{self, ObligationCause, ObligationCtxt}; +use tracing::debug; use crate::errors; diff --git a/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs b/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs index 00bbbf7130f..6825c2e33fe 100644 --- a/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs +++ b/compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs @@ -10,6 +10,7 @@ use rustc_span::{ErrorGuaranteed, Symbol}; use rustc_trait_selection::traits::{self, SkipLeakCheck}; use smallvec::SmallVec; +use tracing::debug; pub(crate) fn crate_inherent_impls_overlap_check( tcx: TyCtxt<'_>, diff --git a/compiler/rustc_hir_analysis/src/coherence/mod.rs b/compiler/rustc_hir_analysis/src/coherence/mod.rs index 3d800bb165c..db809e4837d 100644 --- a/compiler/rustc_hir_analysis/src/coherence/mod.rs +++ b/compiler/rustc_hir_analysis/src/coherence/mod.rs @@ -13,6 +13,7 @@ use rustc_middle::ty::{self, TyCtxt, TypeVisitableExt}; use rustc_session::parse::feature_err; use rustc_span::{sym, ErrorGuaranteed}; +use tracing::debug; use crate::errors; diff --git a/compiler/rustc_hir_analysis/src/coherence/orphan.rs b/compiler/rustc_hir_analysis/src/coherence/orphan.rs index dcd0e3111a4..5fdaba41fb2 100644 --- a/compiler/rustc_hir_analysis/src/coherence/orphan.rs +++ b/compiler/rustc_hir_analysis/src/coherence/orphan.rs @@ -14,6 +14,7 @@ use rustc_trait_selection::traits::{ self, IsFirstInputType, OrphanCheckErr, OrphanCheckMode, UncoveredTyParams, }; +use tracing::{debug, instrument}; use crate::errors; diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs index 3acf2c63145..bf8f5721ad2 100644 --- a/compiler/rustc_hir_analysis/src/collect.rs +++ b/compiler/rustc_hir_analysis/src/collect.rs @@ -42,6 +42,7 @@ use rustc_trait_selection::error_reporting::traits::suggestions::NextTypeParamName; use rustc_trait_selection::infer::InferCtxtExt; use rustc_trait_selection::traits::ObligationCtxt; +use tracing::{debug, instrument}; use crate::check::intrinsic::intrinsic_operation_unsafety; use crate::errors; diff --git a/compiler/rustc_hir_analysis/src/collect/generics_of.rs b/compiler/rustc_hir_analysis/src/collect/generics_of.rs index 28d6cab4b43..be6c3f048dc 100644 --- a/compiler/rustc_hir_analysis/src/collect/generics_of.rs +++ b/compiler/rustc_hir_analysis/src/collect/generics_of.rs @@ -10,6 +10,7 @@ use rustc_session::lint; use rustc_span::symbol::{kw, Symbol}; use rustc_span::Span; +use tracing::{debug, instrument}; use crate::delegation::inherit_generics_for_delegation_item; use crate::middle::resolve_bound_vars as rbv; diff --git a/compiler/rustc_hir_analysis/src/collect/item_bounds.rs b/compiler/rustc_hir_analysis/src/collect/item_bounds.rs index ec48c781c0e..d62727e76b5 100644 --- a/compiler/rustc_hir_analysis/src/collect/item_bounds.rs +++ b/compiler/rustc_hir_analysis/src/collect/item_bounds.rs @@ -8,6 +8,7 @@ use rustc_span::def_id::{DefId, LocalDefId}; use rustc_span::Span; use rustc_type_ir::Upcast; +use tracing::{debug, instrument}; use super::ItemCtxt; use crate::hir_ty_lowering::{HirTyLowerer, PredicateFilter}; diff --git a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs index bba8b0497be..fcc281cc7ee 100644 --- a/compiler/rustc_hir_analysis/src/collect/predicates_of.rs +++ b/compiler/rustc_hir_analysis/src/collect/predicates_of.rs @@ -10,6 +10,7 @@ use rustc_middle::{bug, span_bug}; use rustc_span::symbol::Ident; use rustc_span::{Span, DUMMY_SP}; +use tracing::{debug, instrument, trace}; use crate::bounds::Bounds; use crate::collect::ItemCtxt; diff --git a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs index e38492d9e64..af4aa7a7d8d 100644 --- a/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs +++ b/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs @@ -24,6 +24,7 @@ use rustc_span::def_id::{DefId, LocalDefId}; use rustc_span::symbol::{sym, Ident}; use rustc_span::Span; +use tracing::{debug, debug_span, instrument}; use crate::errors; diff --git a/compiler/rustc_hir_analysis/src/collect/type_of.rs b/compiler/rustc_hir_analysis/src/collect/type_of.rs index 96256b91b9f..5cb90e97eef 100644 --- a/compiler/rustc_hir_analysis/src/collect/type_of.rs +++ b/compiler/rustc_hir_analysis/src/collect/type_of.rs @@ -11,6 +11,7 @@ use rustc_middle::{bug, span_bug}; use rustc_span::symbol::Ident; use rustc_span::{Span, DUMMY_SP}; +use tracing::debug; use super::{bad_placeholder, ItemCtxt}; use crate::errors::TypeofReservedKeywordUsed; diff --git a/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs b/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs index c8b0f03a929..7f4a8208faa 100644 --- a/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs +++ b/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs @@ -7,6 +7,7 @@ use rustc_middle::hir::nested_filter; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; use rustc_span::DUMMY_SP; +use tracing::{debug, instrument, trace}; use crate::errors::{TaitForwardCompat, TaitForwardCompat2, UnconstrainedOpaqueType}; diff --git a/compiler/rustc_hir_analysis/src/constrained_generic_params.rs b/compiler/rustc_hir_analysis/src/constrained_generic_params.rs index edf65245664..6a9ae0de1c1 100644 --- a/compiler/rustc_hir_analysis/src/constrained_generic_params.rs +++ b/compiler/rustc_hir_analysis/src/constrained_generic_params.rs @@ -4,6 +4,7 @@ use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_span::Span; use rustc_type_ir::fold::TypeFoldable; +use tracing::debug; #[derive(Clone, PartialEq, Eq, Hash, Debug)] pub(crate) struct Parameter(pub u32); diff --git a/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs b/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs index f8b2469dfea..da89f5769d1 100644 --- a/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs +++ b/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs @@ -5,6 +5,7 @@ use rustc_hir as hir; use rustc_middle::ty::{self as ty, AssocItems, AssocKind, TyCtxt}; use rustc_span::def_id::DefId; +use tracing::debug; use GenericArgsInfo::*; /// Handles the `wrong number of type / lifetime / ... arguments` family of error messages. diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs index 7f4c75d3a6a..70a3c744c78 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs @@ -13,6 +13,7 @@ use rustc_trait_selection::traits; use rustc_type_ir::visit::{TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor}; use smallvec::SmallVec; +use tracing::{debug, instrument}; use crate::bounds::Bounds; use crate::errors; diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs index a59e9aa85fd..8d5f98c7372 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs @@ -11,6 +11,7 @@ use rustc_session::lint::builtin::LATE_BOUND_LIFETIME_ARGUMENTS; use rustc_span::symbol::{kw, sym}; use smallvec::SmallVec; +use tracing::{debug, instrument}; use super::{HirTyLowerer, IsMethodCall}; use crate::errors::wrong_number_of_generic_args::{GenericArgsInfo, WrongNumberOfGenericArgs}; diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs index 0cdd3e4a1c6..f955e08dd5f 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs @@ -50,6 +50,7 @@ use rustc_trait_selection::infer::InferCtxtExt; use rustc_trait_selection::traits::wf::object_region_bounds; use rustc_trait_selection::traits::{self, ObligationCtxt}; +use tracing::{debug, debug_span, instrument}; use crate::bounds::Bounds; use crate::errors::{AmbiguousLifetimeBound, WildPatTy}; diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/object_safety.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/object_safety.rs index 52e167379b5..88538863710 100644 --- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/object_safety.rs +++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/object_safety.rs @@ -14,6 +14,7 @@ use rustc_trait_selection::error_reporting::traits::report_object_safety_error; use rustc_trait_selection::traits::{self, hir_ty_lowering_object_safety_violations}; use smallvec::{smallvec, SmallVec}; +use tracing::{debug, instrument}; use super::HirTyLowerer; use crate::bounds::Bounds; diff --git a/compiler/rustc_hir_analysis/src/hir_wf_check.rs b/compiler/rustc_hir_analysis/src/hir_wf_check.rs index 3ecf61501f6..2fa4ca68073 100644 --- a/compiler/rustc_hir_analysis/src/hir_wf_check.rs +++ b/compiler/rustc_hir_analysis/src/hir_wf_check.rs @@ -8,6 +8,7 @@ use rustc_middle::ty::{self, TyCtxt}; use rustc_span::def_id::LocalDefId; use rustc_trait_selection::traits::{self, ObligationCtxt}; +use tracing::debug; use crate::collect::ItemCtxt; diff --git a/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs b/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs index f44a78bac4d..147646930dd 100644 --- a/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs +++ b/compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs @@ -77,6 +77,7 @@ use rustc_trait_selection::error_reporting::InferCtxtErrorExt; use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _; use rustc_trait_selection::traits::{self, translate_args_with_cause, wf, ObligationCtxt}; +use tracing::{debug, instrument}; use crate::errors::GenericArgsOnOverriddenImpl; use crate::{constrained_generic_params as cgp, errors}; diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs index 891e4fcd019..1481a4dd141 100644 --- a/compiler/rustc_hir_analysis/src/lib.rs +++ b/compiler/rustc_hir_analysis/src/lib.rs @@ -75,9 +75,6 @@ #![warn(unreachable_pub)] // tidy-alphabetical-end -#[macro_use] -extern crate tracing; - // These are used by Clippy. pub mod check; diff --git a/compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs b/compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs index 454c20d3e64..c2377b4781c 100644 --- a/compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs +++ b/compiler/rustc_hir_analysis/src/outlives/implicit_infer.rs @@ -3,6 +3,7 @@ use rustc_hir::def_id::DefId; use rustc_middle::ty::{self, GenericArg, GenericArgKind, Ty, TyCtxt}; use rustc_span::Span; +use tracing::debug; use super::explicit::ExplicitPredicatesMap; use super::utils::*; diff --git a/compiler/rustc_hir_analysis/src/variance/constraints.rs b/compiler/rustc_hir_analysis/src/variance/constraints.rs index 4fb7a02f8c9..415b23d812b 100644 --- a/compiler/rustc_hir_analysis/src/variance/constraints.rs +++ b/compiler/rustc_hir_analysis/src/variance/constraints.rs @@ -8,6 +8,7 @@ use rustc_hir::def::DefKind; use rustc_middle::ty::{self, GenericArgKind, GenericArgsRef, Ty, TyCtxt}; use rustc_middle::{bug, span_bug}; +use tracing::{debug, instrument}; use super::terms::VarianceTerm::*; use super::terms::*; diff --git a/compiler/rustc_hir_analysis/src/variance/mod.rs b/compiler/rustc_hir_analysis/src/variance/mod.rs index e8e2caf7e62..12bb9a3f9e0 100644 --- a/compiler/rustc_hir_analysis/src/variance/mod.rs +++ b/compiler/rustc_hir_analysis/src/variance/mod.rs @@ -12,6 +12,7 @@ use rustc_middle::ty::{ self, CrateVariancesMap, GenericArgsRef, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, }; +use tracing::{debug, instrument}; /// Defines the `TermsContext` basically houses an arena where we can /// allocate terms. diff --git a/compiler/rustc_hir_analysis/src/variance/solve.rs b/compiler/rustc_hir_analysis/src/variance/solve.rs index 4f1bac17e71..d0bdca86779 100644 --- a/compiler/rustc_hir_analysis/src/variance/solve.rs +++ b/compiler/rustc_hir_analysis/src/variance/solve.rs @@ -7,6 +7,7 @@ use rustc_hir::def_id::DefIdMap; use rustc_middle::ty; +use tracing::debug; use super::constraints::*; use super::terms::VarianceTerm::*; diff --git a/compiler/rustc_hir_analysis/src/variance/terms.rs b/compiler/rustc_hir_analysis/src/variance/terms.rs index 597699b37b1..cf38957bf24 100644 --- a/compiler/rustc_hir_analysis/src/variance/terms.rs +++ b/compiler/rustc_hir_analysis/src/variance/terms.rs @@ -15,6 +15,7 @@ use rustc_hir::def::DefKind; use rustc_hir::def_id::{LocalDefId, LocalDefIdMap}; use rustc_middle::ty::{self, TyCtxt}; +use tracing::debug; use self::VarianceTerm::*;