Remove #[macro_use] extern crate tracing from rustc_infer.

This commit is contained in:
Nicholas Nethercote 2024-08-30 08:35:03 +10:00
parent ed5161c5ac
commit 04a07dc314
27 changed files with 26 additions and 3 deletions

View file

@ -13,6 +13,7 @@ use rustc_middle::ty::{
self, BoundVar, GenericArg, InferConst, List, Ty, TyCtxt, TypeFlags, TypeVisitableExt, self, BoundVar, GenericArg, InferConst, List, Ty, TyCtxt, TypeFlags, TypeVisitableExt,
}; };
use smallvec::SmallVec; use smallvec::SmallVec;
use tracing::debug;
use crate::infer::canonical::{ use crate::infer::canonical::{
Canonical, CanonicalTyVarKind, CanonicalVarInfo, CanonicalVarKind, OriginalQueryValues, Canonical, CanonicalTyVarKind, CanonicalVarInfo, CanonicalVarKind, OriginalQueryValues,

View file

@ -17,6 +17,7 @@ use rustc_middle::mir::ConstraintCategory;
use rustc_middle::ty::fold::TypeFoldable; use rustc_middle::ty::fold::TypeFoldable;
use rustc_middle::ty::{self, BoundVar, GenericArg, GenericArgKind, Ty, TyCtxt}; use rustc_middle::ty::{self, BoundVar, GenericArg, GenericArgKind, Ty, TyCtxt};
use rustc_middle::{bug, span_bug}; use rustc_middle::{bug, span_bug};
use tracing::{debug, instrument};
use crate::infer::canonical::instantiate::{instantiate_value, CanonicalExt}; use crate::infer::canonical::instantiate::{instantiate_value, CanonicalExt};
use crate::infer::canonical::{ use crate::infer::canonical::{

View file

@ -5,6 +5,7 @@
use rustc_data_structures::transitive_relation::TransitiveRelation; use rustc_data_structures::transitive_relation::TransitiveRelation;
use rustc_middle::ty::{Region, TyCtxt}; use rustc_middle::ty::{Region, TyCtxt};
use tracing::debug;
/// Combines a `FreeRegionMap` and a `TyCtxt`. /// Combines a `FreeRegionMap` and a `TyCtxt`.
/// ///

View file

@ -16,6 +16,7 @@ use rustc_middle::ty::{
}; };
use rustc_middle::{bug, span_bug}; use rustc_middle::{bug, span_bug};
use rustc_span::Span; use rustc_span::Span;
use tracing::{debug, instrument};
use super::outlives::test_type_match; use super::outlives::test_type_match;
use crate::infer::region_constraints::{ use crate::infer::region_constraints::{

View file

@ -44,6 +44,7 @@ use rustc_middle::{bug, span_bug};
use rustc_span::symbol::Symbol; use rustc_span::symbol::Symbol;
use rustc_span::Span; use rustc_span::Span;
use snapshot::undo_log::InferCtxtUndoLogs; use snapshot::undo_log::InferCtxtUndoLogs;
use tracing::{debug, instrument};
use type_variable::TypeVariableOrigin; use type_variable::TypeVariableOrigin;
pub use BoundRegionConversionTime::*; pub use BoundRegionConversionTime::*;
pub use RegionVariableOrigin::*; pub use RegionVariableOrigin::*;

View file

@ -11,6 +11,7 @@ use rustc_middle::ty::{
TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor,
}; };
use rustc_span::Span; use rustc_span::Span;
use tracing::{debug, instrument};
use crate::errors::OpaqueHiddenTypeDiag; use crate::errors::OpaqueHiddenTypeDiag;
use crate::infer::{InferCtxt, InferOk}; use crate::infer::{InferCtxt, InferOk};

View file

@ -1,6 +1,7 @@
use rustc_data_structures::undo_log::UndoLogs; use rustc_data_structures::undo_log::UndoLogs;
use rustc_middle::bug; use rustc_middle::bug;
use rustc_middle::ty::{self, OpaqueHiddenType, OpaqueTypeKey, Ty}; use rustc_middle::ty::{self, OpaqueHiddenType, OpaqueTypeKey, Ty};
use tracing::instrument;
use super::{OpaqueTypeDecl, OpaqueTypeMap}; use super::{OpaqueTypeDecl, OpaqueTypeMap};
use crate::infer::snapshot::undo_log::{InferCtxtUndoLogs, UndoLog}; use crate::infer::snapshot::undo_log::{InferCtxtUndoLogs, UndoLog};

View file

@ -2,6 +2,7 @@ use rustc_data_structures::fx::FxIndexSet;
use rustc_data_structures::transitive_relation::TransitiveRelationBuilder; use rustc_data_structures::transitive_relation::TransitiveRelationBuilder;
use rustc_middle::bug; use rustc_middle::bug;
use rustc_middle::ty::{self, Region}; use rustc_middle::ty::{self, Region};
use tracing::{debug, instrument};
use super::explicit_outlives_bounds; use super::explicit_outlives_bounds;
use crate::infer::free_regions::FreeRegionMap; use crate::infer::free_regions::FreeRegionMap;

View file

@ -2,6 +2,7 @@
use rustc_middle::traits::query::{NoSolution, OutlivesBound}; use rustc_middle::traits::query::{NoSolution, OutlivesBound};
use rustc_middle::ty; use rustc_middle::ty;
use tracing::instrument;
use self::env::OutlivesEnvironment; use self::env::OutlivesEnvironment;
use super::region_constraints::RegionConstraintData; use super::region_constraints::RegionConstraintData;

View file

@ -70,6 +70,7 @@ use rustc_middle::ty::{
use rustc_span::DUMMY_SP; use rustc_span::DUMMY_SP;
use rustc_type_ir::outlives::{push_outlives_components, Component}; use rustc_type_ir::outlives::{push_outlives_components, Component};
use smallvec::smallvec; use smallvec::smallvec;
use tracing::{debug, instrument};
use super::env::OutlivesEnvironment; use super::env::OutlivesEnvironment;
use crate::infer::outlives::env::RegionBoundPairs; use crate::infer::outlives::env::RegionBoundPairs;

View file

@ -3,6 +3,7 @@ use std::collections::hash_map::Entry;
use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::fx::FxHashMap;
use rustc_middle::ty::error::TypeError; use rustc_middle::ty::error::TypeError;
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
use tracing::instrument;
use crate::infer::region_constraints::VerifyIfEq; use crate::infer::region_constraints::VerifyIfEq;
use crate::infer::relate::{self as relate, Relate, RelateResult, TypeRelation}; use crate::infer::relate::{self as relate, Relate, RelateResult, TypeRelation};

View file

@ -3,6 +3,7 @@ use std::assert_matches::assert_matches;
use rustc_middle::ty::{self, OutlivesPredicate, Ty, TyCtxt}; use rustc_middle::ty::{self, OutlivesPredicate, Ty, TyCtxt};
use rustc_type_ir::outlives::{compute_alias_components_recursive, Component}; use rustc_type_ir::outlives::{compute_alias_components_recursive, Component};
use smallvec::smallvec; use smallvec::smallvec;
use tracing::{debug, instrument, trace};
use crate::infer::outlives::env::RegionBoundPairs; use crate::infer::outlives::env::RegionBoundPairs;
use crate::infer::region_constraints::VerifyIfEq; use crate::infer::region_constraints::VerifyIfEq;

View file

@ -4,6 +4,7 @@ use rustc_data_structures::graph::vec_graph::VecGraph;
use rustc_index::Idx; use rustc_index::Idx;
use rustc_middle::span_bug; use rustc_middle::span_bug;
use rustc_middle::ty::error::TypeError; use rustc_middle::ty::error::TypeError;
use tracing::{debug, instrument};
use super::*; use super::*;
use crate::infer::relate::RelateResult; use crate::infer::relate::RelateResult;

View file

@ -13,6 +13,7 @@ use rustc_middle::infer::unify_key::{RegionVariableValue, RegionVidKey};
use rustc_middle::ty::{self, ReBound, ReStatic, ReVar, Region, RegionVid, Ty, TyCtxt}; use rustc_middle::ty::{self, ReBound, ReStatic, ReVar, Region, RegionVid, Ty, TyCtxt};
use rustc_middle::{bug, span_bug}; use rustc_middle::{bug, span_bug};
use rustc_span::Span; use rustc_span::Span;
use tracing::{debug, instrument};
use self::CombineMapType::*; use self::CombineMapType::*;
use self::UndoLog::*; use self::UndoLog::*;

View file

@ -24,6 +24,7 @@ use rustc_middle::traits::solve::Goal;
use rustc_middle::ty::error::{ExpectedFound, TypeError}; use rustc_middle::ty::error::{ExpectedFound, TypeError};
use rustc_middle::ty::{self, InferConst, IntType, Ty, TyCtxt, TypeVisitableExt, UintType, Upcast}; use rustc_middle::ty::{self, InferConst, IntType, Ty, TyCtxt, TypeVisitableExt, UintType, Upcast};
pub use rustc_next_trait_solver::relate::combine::*; pub use rustc_next_trait_solver::relate::combine::*;
use tracing::debug;
use super::glb::Glb; use super::glb::Glb;
use super::lub::Lub; use super::lub::Lub;

View file

@ -11,6 +11,7 @@ use rustc_middle::ty::{
self, AliasRelationDirection, InferConst, Term, Ty, TyCtxt, TypeVisitable, TypeVisitableExt, self, AliasRelationDirection, InferConst, Term, Ty, TyCtxt, TypeVisitable, TypeVisitableExt,
}; };
use rustc_span::Span; use rustc_span::Span;
use tracing::{debug, instrument, warn};
use super::{ use super::{
PredicateEmittingRelation, Relate, RelateResult, StructurallyRelateAliases, TypeRelation, PredicateEmittingRelation, Relate, RelateResult, StructurallyRelateAliases, TypeRelation,

View file

@ -4,6 +4,7 @@ use rustc_middle::traits::solve::Goal;
use rustc_middle::ty::relate::{Relate, RelateResult, TypeRelation}; use rustc_middle::ty::relate::{Relate, RelateResult, TypeRelation};
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
use rustc_span::Span; use rustc_span::Span;
use tracing::{debug, instrument};
use super::combine::{CombineFields, PredicateEmittingRelation}; use super::combine::{CombineFields, PredicateEmittingRelation};
use super::lattice::{self, LatticeDir}; use super::lattice::{self, LatticeDir};

View file

@ -3,6 +3,7 @@
use rustc_middle::ty::fold::FnMutDelegate; use rustc_middle::ty::fold::FnMutDelegate;
use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable}; use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable};
use tracing::{debug, instrument};
use super::RelateResult; use super::RelateResult;
use crate::infer::snapshot::CombinedSnapshot; use crate::infer::snapshot::CombinedSnapshot;

View file

@ -19,6 +19,7 @@
use rustc_middle::ty::relate::RelateResult; use rustc_middle::ty::relate::RelateResult;
use rustc_middle::ty::{self, Ty, TyVar}; use rustc_middle::ty::{self, Ty, TyVar};
use tracing::instrument;
use super::combine::PredicateEmittingRelation; use super::combine::PredicateEmittingRelation;
use crate::infer::{DefineOpaqueTypes, InferCtxt}; use crate::infer::{DefineOpaqueTypes, InferCtxt};

View file

@ -4,6 +4,7 @@ use rustc_middle::traits::solve::Goal;
use rustc_middle::ty::relate::{Relate, RelateResult, TypeRelation}; use rustc_middle::ty::relate::{Relate, RelateResult, TypeRelation};
use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt};
use rustc_span::Span; use rustc_span::Span;
use tracing::{debug, instrument};
use super::combine::{CombineFields, PredicateEmittingRelation}; use super::combine::{CombineFields, PredicateEmittingRelation};
use super::lattice::{self, LatticeDir}; use super::lattice::{self, LatticeDir};

View file

@ -4,6 +4,7 @@ use rustc_middle::ty::relate::{
}; };
use rustc_middle::ty::{self, Ty, TyCtxt, TyVar}; use rustc_middle::ty::{self, Ty, TyCtxt, TyVar};
use rustc_span::Span; use rustc_span::Span;
use tracing::{debug, instrument};
use super::combine::CombineFields; use super::combine::CombineFields;
use crate::infer::relate::{PredicateEmittingRelation, StructurallyRelateAliases}; use crate::infer::relate::{PredicateEmittingRelation, StructurallyRelateAliases};

View file

@ -4,6 +4,7 @@ use rustc_data_structures::{snapshot_vec as sv, unify as ut};
use rustc_middle::infer::unify_key::{ConstVariableValue, ConstVidKey}; use rustc_middle::infer::unify_key::{ConstVariableValue, ConstVidKey};
use rustc_middle::ty::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable}; use rustc_middle::ty::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable};
use rustc_middle::ty::{self, ConstVid, FloatVid, IntVid, RegionVid, Ty, TyCtxt, TyVid}; use rustc_middle::ty::{self, ConstVid, FloatVid, IntVid, RegionVid, Ty, TyCtxt, TyVid};
use tracing::instrument;
use ut::UnifyKey; use ut::UnifyKey;
use crate::infer::type_variable::TypeVariableOrigin; use crate::infer::type_variable::TypeVariableOrigin;

View file

@ -1,5 +1,6 @@
use rustc_data_structures::undo_log::UndoLogs; use rustc_data_structures::undo_log::UndoLogs;
use rustc_middle::ty; use rustc_middle::ty;
use tracing::{debug, instrument};
use super::region_constraints::RegionSnapshot; use super::region_constraints::RegionSnapshot;
use super::InferCtxt; use super::InferCtxt;

View file

@ -4,6 +4,7 @@ use rustc_data_structures::undo_log::{Rollback, UndoLogs};
use rustc_data_structures::{snapshot_vec as sv, unify as ut}; use rustc_data_structures::{snapshot_vec as sv, unify as ut};
use rustc_middle::infer::unify_key::{ConstVidKey, EffectVidKey, RegionVidKey}; use rustc_middle::infer::unify_key::{ConstVidKey, EffectVidKey, RegionVidKey};
use rustc_middle::ty::{self, OpaqueHiddenType, OpaqueTypeKey}; use rustc_middle::ty::{self, OpaqueHiddenType, OpaqueTypeKey};
use tracing::debug;
use crate::infer::{region_constraints, type_variable, InferCtxtInner}; use crate::infer::{region_constraints, type_variable, InferCtxtInner};
use crate::traits; use crate::traits;

View file

@ -9,6 +9,7 @@ use rustc_index::IndexVec;
use rustc_middle::bug; use rustc_middle::bug;
use rustc_middle::ty::{self, Ty, TyVid}; use rustc_middle::ty::{self, Ty, TyVid};
use rustc_span::Span; use rustc_span::Span;
use tracing::debug;
use crate::infer::InferCtxtUndoLogs; use crate::infer::InferCtxtUndoLogs;

View file

@ -31,9 +31,6 @@
#![warn(unreachable_pub)] #![warn(unreachable_pub)]
// tidy-alphabetical-end // tidy-alphabetical-end
#[macro_use]
extern crate tracing;
mod errors; mod errors;
pub mod infer; pub mod infer;
pub mod traits; pub mod traits;

View file

@ -4,6 +4,7 @@ use rustc_data_structures::snapshot_map::{self, SnapshotMapRef, SnapshotMapStora
use rustc_data_structures::undo_log::Rollback; use rustc_data_structures::undo_log::Rollback;
use rustc_middle::traits::EvaluationResult; use rustc_middle::traits::EvaluationResult;
use rustc_middle::ty; use rustc_middle::ty;
use tracing::{debug, info};
use super::PredicateObligation; use super::PredicateObligation;
use crate::infer::snapshot::undo_log::InferCtxtUndoLogs; use crate::infer::snapshot::undo_log::InferCtxtUndoLogs;