Skip to content

Commit e9a59db

Browse files
committed
Remove #[macro_use] extern crate tracing from rustc_middle.
1 parent 8ae0694 commit e9a59db

40 files changed

+41
-6
lines changed

Diff for: compiler/rustc_middle/src/hooks/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use rustc_hir::def_id::{DefId, DefPathHash};
1010
use rustc_session::StableCrateId;
1111
use rustc_span::def_id::{CrateNum, LocalDefId};
1212
use rustc_span::{ExpnHash, ExpnId, DUMMY_SP};
13+
use tracing::instrument;
1314

1415
macro_rules! declare_hooks {
1516
($($(#[$attr:meta])*hook $name:ident($($arg:ident: $K:ty),*) -> $V:ty;)*) => {

Diff for: compiler/rustc_middle/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@
6363
#![feature(yeet_expr)]
6464
// tidy-alphabetical-end
6565

66-
#[macro_use]
67-
extern crate tracing;
68-
6966
#[cfg(test)]
7067
mod tests;
7168

Diff for: compiler/rustc_middle/src/lint.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use rustc_session::lint::{
1212
use rustc_session::Session;
1313
use rustc_span::hygiene::{ExpnKind, MacroKind};
1414
use rustc_span::{symbol, DesugaringKind, Span, Symbol, DUMMY_SP};
15+
use tracing::instrument;
1516

1617
use crate::ty::TyCtxt;
1718

Diff for: compiler/rustc_middle/src/middle/region.rs

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use rustc_hir as hir;
1313
use rustc_hir::{HirId, HirIdMap, Node};
1414
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
1515
use rustc_span::{Span, DUMMY_SP};
16+
use tracing::debug;
1617

1718
use std::fmt;
1819
use std::ops::Deref;

Diff for: compiler/rustc_middle/src/middle/stability.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ use rustc_session::Session;
2323
use rustc_span::symbol::{sym, Symbol};
2424
use rustc_span::Span;
2525
use std::num::NonZero;
26+
use tracing::debug;
2627

2728
#[derive(PartialEq, Clone, Copy, Debug)]
2829
pub enum StabilityLevel {

Diff for: compiler/rustc_middle/src/mir/interpret/allocation/provenance_map.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
44
use std::cmp;
55

6+
use super::{alloc_range, AllocError, AllocRange, AllocResult, CtfeProvenance, Provenance};
67
use rustc_data_structures::sorted_map::SortedMap;
78
use rustc_macros::HashStable;
8-
use rustc_target::abi::{HasDataLayout, Size};
9-
10-
use super::{alloc_range, AllocError, AllocRange, AllocResult, CtfeProvenance, Provenance};
119
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
10+
use rustc_target::abi::{HasDataLayout, Size};
11+
use tracing::trace;
1212

1313
/// Stores the provenance information of pointers stored in memory.
1414
#[derive(Clone, PartialEq, Eq, Hash, Debug)]

Diff for: compiler/rustc_middle/src/mir/interpret/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use std::num::NonZero;
1515
use std::sync::atomic::{AtomicU32, Ordering};
1616

1717
use smallvec::{smallvec, SmallVec};
18+
use tracing::{debug, trace};
1819

1920
use rustc_ast::LitKind;
2021
use rustc_data_structures::fx::FxHashMap;

Diff for: compiler/rustc_middle/src/mir/interpret/queries.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use rustc_hir::def::DefKind;
99
use rustc_hir::def_id::DefId;
1010
use rustc_session::lint;
1111
use rustc_span::{Span, DUMMY_SP};
12+
use tracing::{debug, instrument};
1213

1314
impl<'tcx> TyCtxt<'tcx> {
1415
/// Evaluates a constant without providing any generic parameters. This is useful to evaluate consts

Diff for: compiler/rustc_middle/src/mir/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ use rustc_span::symbol::Symbol;
3737
use rustc_span::{Span, DUMMY_SP};
3838

3939
use either::Either;
40+
use tracing::trace;
4041

4142
use std::borrow::Cow;
4243
use std::cell::RefCell;

Diff for: compiler/rustc_middle/src/mir/mono.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use rustc_span::symbol::Symbol;
1818
use rustc_span::Span;
1919
use std::fmt;
2020
use std::hash::Hash;
21+
use tracing::debug;
2122

2223
/// Describes how a monomorphization will be instantiated in object files.
2324
#[derive(PartialEq)]

Diff for: compiler/rustc_middle/src/mir/patch.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use rustc_middle::mir::*;
2+
use tracing::debug;
23

34
/// This struct represents a patch to MIR, which can add
45
/// new statements and basic blocks and patch over block

Diff for: compiler/rustc_middle/src/mir/pretty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use rustc_middle::mir::interpret::{
1515
use rustc_middle::mir::visit::Visitor;
1616
use rustc_middle::mir::*;
1717
use rustc_target::abi::Size;
18+
use tracing::trace;
1819

1920
const INDENT: &str = " ";
2021
/// Alignment for lining up comments following MIR statements

Diff for: compiler/rustc_middle/src/mir/tcx.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use crate::mir::*;
77
use rustc_hir as hir;
8+
use tracing::{debug, instrument};
89

910
#[derive(Copy, Clone, Debug, TypeFoldable, TypeVisitable)]
1011
pub struct PlaceTy<'tcx> {

Diff for: compiler/rustc_middle/src/thir.rs

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use rustc_target::asm::InlineAsmRegOrRegClass;
3232
use std::cmp::Ordering;
3333
use std::fmt;
3434
use std::ops::Index;
35+
use tracing::instrument;
3536

3637
pub mod visit;
3738

Diff for: compiler/rustc_middle/src/ty/_match.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::ty::error::TypeError;
22
use crate::ty::relate::{self, Relate, RelateResult, TypeRelation};
33
use crate::ty::{self, InferConst, Ty, TyCtxt};
4+
use tracing::{debug, instrument};
45

56
/// A type "A" *matches* "B" if the fresh types in B could be
67
/// instantiated with values so as to make it equal to A. Matching is

Diff for: compiler/rustc_middle/src/ty/adt.rs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use rustc_query_system::ich::StableHashingContext;
1717
use rustc_session::DataTypeKind;
1818
use rustc_span::symbol::sym;
1919
use rustc_target::abi::{ReprOptions, VariantIdx, FIRST_VARIANT};
20+
use tracing::{debug, info, trace};
2021

2122
use std::cell::RefCell;
2223
use std::hash::{Hash, Hasher};

Diff for: compiler/rustc_middle/src/ty/consts.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use rustc_hir::def::{DefKind, Res};
88
use rustc_hir::def_id::LocalDefId;
99
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
1010
use rustc_type_ir::{self as ir, TypeFlags, WithCachedTypeInfo};
11+
use tracing::{debug, instrument};
1112

1213
mod int;
1314
mod kind;

Diff for: compiler/rustc_middle/src/ty/context.rs

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ use rustc_target::spec::abi;
7474
use rustc_type_ir::TyKind::*;
7575
use rustc_type_ir::WithCachedTypeInfo;
7676
use rustc_type_ir::{CollectAndApply, Interner, TypeFlags};
77+
use tracing::{debug, instrument};
7778

7879
use std::assert_matches::assert_matches;
7980
use std::borrow::Borrow;

Diff for: compiler/rustc_middle/src/ty/erase_regions.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::query::Providers;
22
use crate::ty::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable};
33
use crate::ty::{self, Ty, TyCtxt, TypeFlags, TypeVisitableExt};
4+
use tracing::debug;
45

56
pub(super) fn provide(providers: &mut Providers) {
67
*providers = Providers { erase_regions_ty, ..*providers };

Diff for: compiler/rustc_middle/src/ty/fold.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::ty::{self, Binder, BoundTy, Ty, TyCtxt, TypeVisitableExt};
22
use rustc_data_structures::fx::FxIndexMap;
33
use rustc_hir::def_id::DefId;
4+
use tracing::{debug, instrument};
45

56
pub use rustc_type_ir::fold::{FallibleTypeFolder, TypeFoldable, TypeFolder, TypeSuperFoldable};
67

Diff for: compiler/rustc_middle/src/ty/generic_args.rs

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use rustc_macros::{
1818
use rustc_serialize::{Decodable, Encodable};
1919
use rustc_type_ir::WithCachedTypeInfo;
2020
use smallvec::SmallVec;
21+
use tracing::debug;
2122

2223
use core::intrinsics;
2324
use std::marker::PhantomData;

Diff for: compiler/rustc_middle/src/ty/generics.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use rustc_hir::def_id::DefId;
66
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
77
use rustc_span::symbol::{kw, Symbol};
88
use rustc_span::Span;
9+
use tracing::instrument;
910

1011
use super::{Clause, InstantiatedPredicates, ParamConst, ParamTy, Ty, TyCtxt};
1112

Diff for: compiler/rustc_middle/src/ty/impls_ty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHas
1212
use rustc_query_system::ich::StableHashingContext;
1313
use std::cell::RefCell;
1414
use std::ptr;
15+
use tracing::trace;
1516

1617
impl<'a, 'tcx, H, T> HashStable<StableHashingContext<'a>> for &'tcx ty::list::RawList<H, T>
1718
where

Diff for: compiler/rustc_middle/src/ty/inhabitedness/inhabited_predicate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use rustc_macros::HashStable;
22
use smallvec::SmallVec;
3+
use tracing::instrument;
34

45
use crate::ty::context::TyCtxt;
56
use crate::ty::{self, DefId, OpaqueTypeKey, ParamEnv, Ty};

Diff for: compiler/rustc_middle/src/ty/inhabitedness/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ use crate::ty::context::TyCtxt;
4848
use crate::ty::{self, DefId, Ty, TypeVisitableExt, VariantDef, Visibility};
4949

5050
use rustc_type_ir::TyKind::*;
51+
use tracing::instrument;
5152

5253
pub mod inhabited_predicate;
5354

Diff for: compiler/rustc_middle/src/ty/instance.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use rustc_macros::{
1414
use rustc_middle::ty::normalize_erasing_regions::NormalizationError;
1515
use rustc_span::def_id::LOCAL_CRATE;
1616
use rustc_span::Symbol;
17+
use tracing::{debug, instrument};
1718

1819
use std::assert_matches::assert_matches;
1920
use std::fmt;

Diff for: compiler/rustc_middle/src/ty/layout.rs

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use rustc_target::abi::*;
1919
use rustc_target::spec::{
2020
abi::Abi as SpecAbi, HasTargetSpec, HasWasmCAbiOpt, PanicStrategy, Target, WasmCAbi,
2121
};
22+
use tracing::debug;
2223

2324
use std::borrow::Cow;
2425
use std::cmp;

Diff for: compiler/rustc_middle/src/ty/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ use rustc_span::{ExpnId, ExpnKind, Span};
6161
use rustc_target::abi::{Align, FieldIdx, Integer, IntegerType, VariantIdx};
6262
pub use rustc_target::abi::{ReprFlags, ReprOptions};
6363
pub use rustc_type_ir::{DebugWithInfcx, InferCtxtLike, WithInfcx};
64+
use tracing::{debug, instrument};
6465
pub use vtable::*;
6566

6667
use std::assert_matches::assert_matches;

Diff for: compiler/rustc_middle/src/ty/normalize_erasing_regions.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use crate::traits::query::NoSolution;
1111
use crate::ty::fold::{FallibleTypeFolder, TypeFoldable, TypeFolder};
1212
use crate::ty::{self, EarlyBinder, GenericArgsRef, Ty, TyCtxt, TypeVisitableExt};
1313
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
14+
use tracing::{debug, instrument};
1415

1516
#[derive(Debug, Copy, Clone, HashStable, TyEncodable, TyDecodable)]
1617
pub enum NormalizationError<'tcx> {

Diff for: compiler/rustc_middle/src/ty/opaque_types.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::ty::{GenericArg, GenericArgKind};
55
use rustc_data_structures::fx::FxHashMap;
66
use rustc_span::def_id::DefId;
77
use rustc_span::Span;
8+
use tracing::{debug, instrument, trace};
89

910
/// Converts generic params of a TypeFoldable from one
1011
/// item's generics to another. Usually from a function's generics

Diff for: compiler/rustc_middle/src/ty/predicate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use rustc_hir::def_id::DefId;
44
use rustc_macros::{extension, HashStable};
55
use rustc_type_ir as ir;
66
use std::cmp::Ordering;
7+
use tracing::instrument;
78

89
use crate::ty::{
910
self, DebruijnIndex, EarlyBinder, PredicatePolarity, Ty, TyCtxt, TypeFlags, Upcast, UpcastFrom,

Diff for: compiler/rustc_middle/src/ty/print/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use rustc_data_structures::sso::SsoHashSet;
77
use rustc_hir as hir;
88
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId};
99
use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData};
10+
use tracing::{debug, instrument, trace};
1011

1112
// `pretty` is a separate module only for organization.
1213
mod pretty;

Diff for: compiler/rustc_middle/src/ty/region.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use rustc_span::{ErrorGuaranteed, DUMMY_SP};
88
use rustc_type_ir::RegionKind as IrRegionKind;
99
pub use rustc_type_ir::RegionVid;
1010
use std::ops::Deref;
11+
use tracing::debug;
1112

1213
use crate::ty::{self, BoundVar, TyCtxt, TypeFlags};
1314

Diff for: compiler/rustc_middle/src/ty/relate.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use rustc_hir::def_id::DefId;
1414
use rustc_macros::TypeVisitable;
1515
use rustc_target::spec::abi;
1616
use std::iter;
17+
use tracing::{debug, instrument};
1718

1819
use super::Pattern;
1920

Diff for: compiler/rustc_middle/src/ty/rvalue_scopes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::middle::region::{Scope, ScopeData, ScopeTree};
22
use rustc_hir as hir;
33
use rustc_hir::ItemLocalMap;
44
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
5+
use tracing::debug;
56

67
/// `RvalueScopes` is a mapping from sub-expressions to _extended_ lifetime as determined by
78
/// rules laid out in `rustc_hir_analysis::check::rvalue_scopes`.

Diff for: compiler/rustc_middle/src/ty/trait_def.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use hir::def_id::LOCAL_CRATE;
55
use rustc_hir as hir;
66
use rustc_hir::def_id::DefId;
77
use std::iter;
8+
use tracing::debug;
89

910
use rustc_data_structures::fx::FxIndexMap;
1011
use rustc_errors::ErrorGuaranteed;

Diff for: compiler/rustc_middle/src/ty/util.rs

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use rustc_target::abi::{Float, Integer, IntegerType, Size};
2424
use rustc_target::spec::abi::Abi;
2525
use smallvec::{smallvec, SmallVec};
2626
use std::{fmt, iter};
27+
use tracing::{debug, instrument, trace};
2728

2829
#[derive(Copy, Clone, Debug)]
2930
pub struct Discr<'tcx> {

Diff for: compiler/rustc_middle/src/ty/walk.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use crate::ty::{self, Ty};
55
use crate::ty::{GenericArg, GenericArgKind};
66
use rustc_data_structures::sso::SsoHashSet;
77
use smallvec::{smallvec, SmallVec};
8+
use tracing::debug;
89

910
// The TypeWalker's stack is hot enough that it's worth going to some effort to
1011
// avoid heap allocations.

Diff for: compiler/rustc_middle/src/util/call_kind.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use rustc_hir::def_id::DefId;
88
use rustc_hir::{lang_items, LangItem};
99
use rustc_span::symbol::Ident;
1010
use rustc_span::{sym, DesugaringKind, Span};
11+
use tracing::debug;
1112

1213
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
1314
pub enum CallDesugaringKind {

Diff for: compiler/rustc_middle/src/util/find_self_call.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::ty::GenericArgsRef;
33
use crate::ty::{self, TyCtxt};
44
use rustc_span::def_id::DefId;
55
use rustc_span::source_map::Spanned;
6+
use tracing::debug;
67

78
/// Checks if the specified `local` is used as the `self` parameter of a method call
89
/// in the provided `BasicBlock`. If it is, then the `DefId` of the called method is

0 commit comments

Comments
 (0)