Directly use the instrument
macro instead of its full path
This commit is contained in:
parent
4f9898a794
commit
d3b22c7267
@ -31,7 +31,7 @@ pub(super) struct NodeCollector<'a, 'hir> {
|
||||
definitions: &'a definitions::Definitions,
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(sess, definitions, bodies))]
|
||||
#[instrument(level = "debug", skip(sess, definitions, bodies))]
|
||||
pub(super) fn index_hir<'hir>(
|
||||
sess: &Session,
|
||||
definitions: &definitions::Definitions,
|
||||
@ -67,7 +67,7 @@ pub(super) fn index_hir<'hir>(
|
||||
}
|
||||
|
||||
impl<'a, 'hir> NodeCollector<'a, 'hir> {
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn insert(&mut self, span: Span, hir_id: HirId, node: Node<'hir>) {
|
||||
debug_assert_eq!(self.owner, hir_id.owner);
|
||||
debug_assert_ne!(hir_id.local_id.as_u32(), 0);
|
||||
@ -142,7 +142,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
|
||||
});
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_item(&mut self, i: &'hir Item<'hir>) {
|
||||
debug_assert_eq!(i.def_id, self.owner);
|
||||
self.with_parent(i.hir_id(), |this| {
|
||||
@ -156,7 +156,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
|
||||
});
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_foreign_item(&mut self, fi: &'hir ForeignItem<'hir>) {
|
||||
debug_assert_eq!(fi.def_id, self.owner);
|
||||
self.with_parent(fi.hir_id(), |this| {
|
||||
@ -175,7 +175,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
|
||||
})
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_trait_item(&mut self, ti: &'hir TraitItem<'hir>) {
|
||||
debug_assert_eq!(ti.def_id, self.owner);
|
||||
self.with_parent(ti.hir_id(), |this| {
|
||||
@ -183,7 +183,7 @@ impl<'a, 'hir> Visitor<'hir> for NodeCollector<'a, 'hir> {
|
||||
});
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_impl_item(&mut self, ii: &'hir ImplItem<'hir>) {
|
||||
debug_assert_eq!(ii.def_id, self.owner);
|
||||
self.with_parent(ii.hir_id(), |this| {
|
||||
|
@ -220,7 +220,7 @@ impl ResolverAstLoweringExt for ResolverAstLowering {
|
||||
/// Panics if no map has been pushed.
|
||||
/// Remapping is used when creating lowering `-> impl Trait` return
|
||||
/// types to create the resulting opaque type.
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn record_def_id_remap(&mut self, from: LocalDefId, to: LocalDefId) {
|
||||
self.generics_def_id_map.last_mut().expect("no map pushed").insert(from, to);
|
||||
}
|
||||
@ -771,7 +771,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
}
|
||||
|
||||
/// Converts a lifetime into a new generic parameter.
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn lifetime_res_to_generic_param(
|
||||
&mut self,
|
||||
ident: Ident,
|
||||
@ -815,7 +815,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
/// name resolver owing to lifetime elision; this also populates the resolver's node-id->def-id
|
||||
/// map, so that later calls to `opt_node_id_to_def_id` that refer to these extra lifetime
|
||||
/// parameters will be successful.
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
#[inline]
|
||||
fn lower_lifetime_binder(
|
||||
&mut self,
|
||||
@ -1385,7 +1385,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
/// added explicitly in the HIR). But this includes all the lifetimes, and we only want to
|
||||
/// capture the lifetimes that are referenced in the bounds. Therefore, we add *extra* lifetime parameters
|
||||
/// for the lifetimes that get captured (`'x`, in our example above) and reference those.
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn lower_opaque_impl_trait(
|
||||
&mut self,
|
||||
span: Span,
|
||||
@ -1621,7 +1621,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
// `make_ret_async`: if `Some`, converts `-> T` into `-> impl Future<Output = T>` in the
|
||||
// return type. This is used for `async fn` declarations. The `NodeId` is the ID of the
|
||||
// return type `impl Trait` item.
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn lower_fn_decl(
|
||||
&mut self,
|
||||
decl: &FnDecl,
|
||||
@ -1730,7 +1730,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
// `output`: unlowered output type (`T` in `-> T`)
|
||||
// `fn_def_id`: `DefId` of the parent function (used to create child impl trait definition)
|
||||
// `opaque_ty_node_id`: `NodeId` of the opaque `impl Trait` type that should be created
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn lower_async_fn_ret_ty(
|
||||
&mut self,
|
||||
output: &FnRetTy,
|
||||
@ -2013,7 +2013,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
self.new_named_lifetime(l.id, l.id, span, ident)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn new_named_lifetime_with_res(
|
||||
&mut self,
|
||||
id: NodeId,
|
||||
@ -2044,7 +2044,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
hir::Lifetime { hir_id: self.lower_node_id(id), span: self.lower_span(span), name }
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn new_named_lifetime(
|
||||
&mut self,
|
||||
id: NodeId,
|
||||
@ -2132,7 +2132,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
hir::TraitRef { path, hir_ref_id: self.lower_node_id(p.ref_id) }
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn lower_poly_trait_ref(
|
||||
&mut self,
|
||||
p: &PolyTraitRef,
|
||||
|
@ -265,7 +265,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
|
||||
/// *user* has a name for. In that case, we'll be able to map
|
||||
/// `fr` to a `Region<'tcx>`, and that region will be one of
|
||||
/// named variants.
|
||||
#[tracing::instrument(level = "trace", skip(self))]
|
||||
#[instrument(level = "trace", skip(self))]
|
||||
fn give_name_from_error_region(&self, fr: RegionVid) -> Option<RegionName> {
|
||||
let error_region = self.to_error_region(fr)?;
|
||||
|
||||
@ -373,7 +373,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
|
||||
/// | fn foo(x: &u32) { .. }
|
||||
/// ------- fully elaborated type of `x` is `&'1 u32`
|
||||
/// ```
|
||||
#[tracing::instrument(level = "trace", skip(self))]
|
||||
#[instrument(level = "trace", skip(self))]
|
||||
fn give_name_if_anonymous_region_appears_in_arguments(
|
||||
&self,
|
||||
fr: RegionVid,
|
||||
@ -662,7 +662,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
|
||||
/// | let x = Some(&22);
|
||||
/// - fully elaborated type of `x` is `Option<&'1 u32>`
|
||||
/// ```
|
||||
#[tracing::instrument(level = "trace", skip(self))]
|
||||
#[instrument(level = "trace", skip(self))]
|
||||
fn give_name_if_anonymous_region_appears_in_upvars(&self, fr: RegionVid) -> Option<RegionName> {
|
||||
let upvar_index = self.regioncx.get_upvar_index_for_region(self.infcx.tcx, fr)?;
|
||||
let (upvar_name, upvar_span) = self.regioncx.get_upvar_name_and_span_for_region(
|
||||
@ -682,7 +682,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
|
||||
/// must be a closure since, in a free fn, such an argument would
|
||||
/// have to either also appear in an argument (if using elision)
|
||||
/// or be early bound (named, not in argument).
|
||||
#[tracing::instrument(level = "trace", skip(self))]
|
||||
#[instrument(level = "trace", skip(self))]
|
||||
fn give_name_if_anonymous_region_appears_in_output(&self, fr: RegionVid) -> Option<RegionName> {
|
||||
let tcx = self.infcx.tcx;
|
||||
let hir = tcx.hir();
|
||||
@ -814,7 +814,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "trace", skip(self))]
|
||||
#[instrument(level = "trace", skip(self))]
|
||||
fn give_name_if_anonymous_region_appears_in_yield_ty(
|
||||
&self,
|
||||
fr: RegionVid,
|
||||
|
@ -42,7 +42,6 @@ use rustc_span::{self, FileNameDisplayPreference, SourceFile};
|
||||
use rustc_symbol_mangling::typeid_for_trait_ref;
|
||||
use rustc_target::abi::{Align, Size};
|
||||
use smallvec::smallvec;
|
||||
use tracing::debug;
|
||||
|
||||
use libc::{c_char, c_longlong, c_uint};
|
||||
use std::borrow::Cow;
|
||||
@ -51,7 +50,6 @@ use std::hash::{Hash, Hasher};
|
||||
use std::iter;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::ptr;
|
||||
use tracing::instrument;
|
||||
|
||||
impl PartialEq for llvm::Metadata {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
|
@ -16,6 +16,8 @@
|
||||
|
||||
#[macro_use]
|
||||
extern crate rustc_macros;
|
||||
#[macro_use]
|
||||
extern crate tracing;
|
||||
|
||||
use back::write::{create_informational_target_machine, create_target_machine};
|
||||
|
||||
|
@ -334,7 +334,7 @@ pub enum InternKind {
|
||||
/// tracks where in the value we are and thus can show much better error messages.
|
||||
/// Any errors here would anyway be turned into `const_err` lints, whereas validation failures
|
||||
/// are hard errors.
|
||||
#[tracing::instrument(level = "debug", skip(ecx))]
|
||||
#[instrument(level = "debug", skip(ecx))]
|
||||
pub fn intern_const_alloc_recursive<
|
||||
'mir,
|
||||
'tcx: 'mir,
|
||||
|
@ -856,7 +856,7 @@ impl<'tcx> TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
|
||||
Ok(a.rebind(self.relate(a.skip_binder(), b.skip_binder())?))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn tys(&mut self, t: Ty<'tcx>, _t: Ty<'tcx>) -> RelateResult<'tcx, Ty<'tcx>> {
|
||||
debug_assert_eq!(t, _t);
|
||||
debug!("ConstInferUnifier: t={:?}", t);
|
||||
@ -932,7 +932,7 @@ impl<'tcx> TypeRelation<'tcx> for ConstInferUnifier<'_, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn consts(
|
||||
&mut self,
|
||||
c: ty::Const<'tcx>,
|
||||
|
@ -1434,7 +1434,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||
/// the message in `secondary_span` as the primary label, and apply the message that would
|
||||
/// otherwise be used for the primary label on the `secondary_span` `Span`. This applies on
|
||||
/// E0271, like `src/test/ui/issues/issue-39970.stderr`.
|
||||
#[tracing::instrument(
|
||||
#[instrument(
|
||||
level = "debug",
|
||||
skip(self, diag, secondary_span, swap_secondary_and_primary, prefer_label)
|
||||
)]
|
||||
|
@ -313,7 +313,7 @@ where
|
||||
self.delegate.push_verify(origin, generic, region, verify_bound);
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn projection_must_outlive(
|
||||
&mut self,
|
||||
origin: infer::SubregionOrigin<'tcx>,
|
||||
|
@ -34,7 +34,7 @@ use crate::infer::region_constraints::VerifyIfEq;
|
||||
/// like are used. This is a particular challenge since this function is invoked
|
||||
/// very late in inference and hence cannot make use of the normal inference
|
||||
/// machinery.
|
||||
#[tracing::instrument(level = "debug", skip(tcx, param_env))]
|
||||
#[instrument(level = "debug", skip(tcx, param_env))]
|
||||
pub fn extract_verify_if_eq<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
@ -71,7 +71,7 @@ pub fn extract_verify_if_eq<'tcx>(
|
||||
}
|
||||
|
||||
/// True if a (potentially higher-ranked) outlives
|
||||
#[tracing::instrument(level = "debug", skip(tcx, param_env))]
|
||||
#[instrument(level = "debug", skip(tcx, param_env))]
|
||||
pub(super) fn can_match_erased_ty<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
param_env: ty::ParamEnv<'tcx>,
|
||||
@ -110,7 +110,7 @@ impl<'tcx> Match<'tcx> {
|
||||
|
||||
/// Binds the pattern variable `br` to `value`; returns an `Err` if the pattern
|
||||
/// is already bound to a different value.
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn bind(
|
||||
&mut self,
|
||||
br: ty::BoundRegion,
|
||||
|
@ -155,7 +155,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||
///
|
||||
/// * From each pre-binding block to the next pre-binding block.
|
||||
/// * From each otherwise block to the next pre-binding block.
|
||||
#[tracing::instrument(level = "debug", skip(self, arms))]
|
||||
#[instrument(level = "debug", skip(self, arms))]
|
||||
pub(crate) fn match_expr(
|
||||
&mut self,
|
||||
destination: Place<'tcx>,
|
||||
|
@ -77,7 +77,7 @@ impl<'tcx> Cx<'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
pub(crate) fn pattern_from_hir(&mut self, p: &hir::Pat<'_>) -> Pat<'tcx> {
|
||||
let p = match self.tcx.hir().get(p.hir_id) {
|
||||
Node::Pat(p) => p,
|
||||
|
@ -1573,7 +1573,7 @@ impl<'tcx> Liveness<'_, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(skip(self), level = "INFO")]
|
||||
#[instrument(skip(self), level = "INFO")]
|
||||
fn report_unused(
|
||||
&self,
|
||||
hir_ids_and_spans: Vec<(HirId, Span, Span)>,
|
||||
|
@ -273,7 +273,7 @@ impl<'a> Resolver<'a> {
|
||||
///
|
||||
/// Invariant: This must only be called during main resolution, not during
|
||||
/// import resolution.
|
||||
#[tracing::instrument(level = "debug", skip(self, ribs))]
|
||||
#[instrument(level = "debug", skip(self, ribs))]
|
||||
pub(crate) fn resolve_ident_in_lexical_scope(
|
||||
&mut self,
|
||||
mut ident: Ident,
|
||||
@ -367,7 +367,7 @@ impl<'a> Resolver<'a> {
|
||||
/// expansion and import resolution (perhaps they can be merged in the future).
|
||||
/// The function is used for resolving initial segments of macro paths (e.g., `foo` in
|
||||
/// `foo::bar!(); or `foo!();`) and also for import paths on 2018 edition.
|
||||
#[tracing::instrument(level = "debug", skip(self, scope_set))]
|
||||
#[instrument(level = "debug", skip(self, scope_set))]
|
||||
pub(crate) fn early_resolve_ident_in_lexical_scope(
|
||||
&mut self,
|
||||
orig_ident: Ident,
|
||||
@ -708,7 +708,7 @@ impl<'a> Resolver<'a> {
|
||||
Err(Determinacy::determined(determinacy == Determinacy::Determined || force))
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
pub(crate) fn maybe_resolve_ident_in_module(
|
||||
&mut self,
|
||||
module: ModuleOrUniformRoot<'a>,
|
||||
@ -720,7 +720,7 @@ impl<'a> Resolver<'a> {
|
||||
.map_err(|(determinacy, _)| determinacy)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
pub(crate) fn resolve_ident_in_module(
|
||||
&mut self,
|
||||
module: ModuleOrUniformRoot<'a>,
|
||||
@ -734,7 +734,7 @@ impl<'a> Resolver<'a> {
|
||||
.map_err(|(determinacy, _)| determinacy)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn resolve_ident_in_module_ext(
|
||||
&mut self,
|
||||
module: ModuleOrUniformRoot<'a>,
|
||||
@ -772,7 +772,7 @@ impl<'a> Resolver<'a> {
|
||||
)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn resolve_ident_in_module_unadjusted(
|
||||
&mut self,
|
||||
module: ModuleOrUniformRoot<'a>,
|
||||
@ -796,7 +796,7 @@ impl<'a> Resolver<'a> {
|
||||
|
||||
/// Attempts to resolve `ident` in namespaces `ns` of `module`.
|
||||
/// Invariant: if `finalize` is `Some`, expansion and import resolution must be complete.
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn resolve_ident_in_module_unadjusted_ext(
|
||||
&mut self,
|
||||
module: ModuleOrUniformRoot<'a>,
|
||||
@ -1059,7 +1059,7 @@ impl<'a> Resolver<'a> {
|
||||
}
|
||||
|
||||
/// Validate a local resolution (from ribs).
|
||||
#[tracing::instrument(level = "debug", skip(self, all_ribs))]
|
||||
#[instrument(level = "debug", skip(self, all_ribs))]
|
||||
fn validate_res_from_ribs(
|
||||
&mut self,
|
||||
rib_index: usize,
|
||||
@ -1294,7 +1294,7 @@ impl<'a> Resolver<'a> {
|
||||
res
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
pub(crate) fn maybe_resolve_path(
|
||||
&mut self,
|
||||
path: &[Segment],
|
||||
@ -1304,7 +1304,7 @@ impl<'a> Resolver<'a> {
|
||||
self.resolve_path_with_ribs(path, opt_ns, parent_scope, None, None, None)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
pub(crate) fn resolve_path(
|
||||
&mut self,
|
||||
path: &[Segment],
|
||||
|
@ -1390,7 +1390,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
||||
})
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self, work))]
|
||||
#[instrument(level = "debug", skip(self, work))]
|
||||
fn with_lifetime_rib<T>(
|
||||
&mut self,
|
||||
kind: LifetimeRibKind,
|
||||
@ -1404,7 +1404,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
||||
ret
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn resolve_lifetime(&mut self, lifetime: &'ast Lifetime, use_ctxt: visit::LifetimeCtxt) {
|
||||
let ident = lifetime.ident;
|
||||
|
||||
@ -1508,7 +1508,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
||||
self.record_lifetime_res(lifetime.id, LifetimeRes::Error, LifetimeElisionCandidate::Named);
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn resolve_anonymous_lifetime(&mut self, lifetime: &Lifetime, elided: bool) {
|
||||
debug_assert_eq!(lifetime.ident.name, kw::UnderscoreLifetime);
|
||||
|
||||
@ -1573,7 +1573,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
||||
self.report_missing_lifetime_specifiers(vec![missing_lifetime], None);
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn resolve_elided_lifetime(&mut self, anchor_id: NodeId, span: Span) {
|
||||
let id = self.r.next_node_id();
|
||||
let lt = Lifetime { id, ident: Ident::new(kw::UnderscoreLifetime, span) };
|
||||
@ -1586,7 +1586,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
||||
self.resolve_anonymous_lifetime(<, true);
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn create_fresh_lifetime(&mut self, id: NodeId, ident: Ident, binder: NodeId) -> LifetimeRes {
|
||||
debug_assert_eq!(ident.name, kw::UnderscoreLifetime);
|
||||
debug!(?ident.span);
|
||||
@ -1604,7 +1604,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
||||
res
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn resolve_elided_lifetimes_in_path(
|
||||
&mut self,
|
||||
path_id: NodeId,
|
||||
@ -1804,7 +1804,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn record_lifetime_res(
|
||||
&mut self,
|
||||
id: NodeId,
|
||||
@ -1827,7 +1827,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn record_lifetime_param(&mut self, id: NodeId, res: LifetimeRes) {
|
||||
if let Some(prev_res) = self.r.lifetimes_res_map.insert(id, res) {
|
||||
panic!(
|
||||
@ -1838,7 +1838,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
|
||||
}
|
||||
|
||||
/// Perform resolution of a function signature, accounting for lifetime elision.
|
||||
#[tracing::instrument(level = "debug", skip(self, inputs))]
|
||||
#[instrument(level = "debug", skip(self, inputs))]
|
||||
fn resolve_fn_signature(
|
||||
&mut self,
|
||||
fn_id: NodeId,
|
||||
|
@ -278,7 +278,7 @@ pub fn provide(providers: &mut ty::query::Providers) {
|
||||
/// lifetimes into a single binder.) This requires us to resolve the
|
||||
/// *trait definition* of `Sub`; basically just enough lifetime information
|
||||
/// to look at the supertraits.
|
||||
#[tracing::instrument(level = "debug", skip(tcx))]
|
||||
#[instrument(level = "debug", skip(tcx))]
|
||||
fn resolve_lifetimes_trait_definition(
|
||||
tcx: TyCtxt<'_>,
|
||||
local_def_id: LocalDefId,
|
||||
@ -289,7 +289,7 @@ fn resolve_lifetimes_trait_definition(
|
||||
/// Computes the `ResolveLifetimes` map that contains data for an entire `Item`.
|
||||
/// You should not read the result of this query directly, but rather use
|
||||
/// `named_region_map`, `is_late_bound_map`, etc.
|
||||
#[tracing::instrument(level = "debug", skip(tcx))]
|
||||
#[instrument(level = "debug", skip(tcx))]
|
||||
fn resolve_lifetimes(tcx: TyCtxt<'_>, local_def_id: LocalDefId) -> ResolveLifetimes {
|
||||
convert_named_region_map(do_resolve(tcx, local_def_id, false))
|
||||
}
|
||||
@ -647,7 +647,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_ty(&mut self, ty: &'tcx hir::Ty<'tcx>) {
|
||||
match ty.kind {
|
||||
hir::TyKind::BareFn(ref c) => {
|
||||
@ -930,7 +930,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_lifetime(&mut self, lifetime_ref: &'tcx hir::Lifetime) {
|
||||
match lifetime_ref.name {
|
||||
hir::LifetimeName::Static => self.insert_lifetime(lifetime_ref, Region::Static),
|
||||
@ -1287,7 +1287,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
|
||||
self.with(scope, walk);
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn resolve_lifetime_ref(
|
||||
&mut self,
|
||||
region_def_id: LocalDefId,
|
||||
@ -1409,7 +1409,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
|
||||
);
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_segment_args(
|
||||
&mut self,
|
||||
res: Res,
|
||||
@ -1659,7 +1659,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn visit_fn_like_elision(
|
||||
&mut self,
|
||||
inputs: &'tcx [hir::Ty<'tcx>],
|
||||
@ -1707,7 +1707,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
|
||||
self.insert_lifetime(lifetime_ref, lifetime.shifted(late_depth));
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn insert_lifetime(&mut self, lifetime_ref: &'tcx hir::Lifetime, def: Region) {
|
||||
debug!(
|
||||
node = ?self.tcx.hir().node_to_string(lifetime_ref.hir_id),
|
||||
|
@ -135,7 +135,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentContext<'tcx> {
|
||||
/// `SomeTrait` or a where-clause that lets us unify `$0` with
|
||||
/// something concrete. If this fails, we'll unify `$0` with
|
||||
/// `projection_ty` again.
|
||||
#[tracing::instrument(level = "debug", skip(self, infcx, param_env, cause))]
|
||||
#[instrument(level = "debug", skip(self, infcx, param_env, cause))]
|
||||
fn normalize_projection_type(
|
||||
&mut self,
|
||||
infcx: &InferCtxt<'_, 'tcx>,
|
||||
|
@ -231,7 +231,7 @@ pub(super) fn poly_project_and_unify_type<'cx, 'tcx>(
|
||||
/// If successful, this may result in additional obligations.
|
||||
///
|
||||
/// See [poly_project_and_unify_type] for an explanation of the return value.
|
||||
#[tracing::instrument(level = "debug", skip(selcx))]
|
||||
#[instrument(level = "debug", skip(selcx))]
|
||||
fn project_and_unify_type<'cx, 'tcx>(
|
||||
selcx: &mut SelectionContext<'cx, 'tcx>,
|
||||
obligation: &ProjectionObligation<'tcx>,
|
||||
@ -1206,7 +1206,7 @@ impl<'tcx> Progress<'tcx> {
|
||||
///
|
||||
/// IMPORTANT:
|
||||
/// - `obligation` must be fully normalized
|
||||
#[tracing::instrument(level = "info", skip(selcx))]
|
||||
#[instrument(level = "info", skip(selcx))]
|
||||
fn project<'cx, 'tcx>(
|
||||
selcx: &mut SelectionContext<'cx, 'tcx>,
|
||||
obligation: &ProjectionTyObligation<'tcx>,
|
||||
@ -1368,7 +1368,7 @@ fn assemble_candidates_from_object_ty<'cx, 'tcx>(
|
||||
);
|
||||
}
|
||||
|
||||
#[tracing::instrument(
|
||||
#[instrument(
|
||||
level = "debug",
|
||||
skip(selcx, candidate_set, ctor, env_predicates, potentially_unnormalized_candidates)
|
||||
)]
|
||||
@ -1419,7 +1419,7 @@ fn assemble_candidates_from_predicates<'cx, 'tcx>(
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(selcx, obligation, candidate_set))]
|
||||
#[instrument(level = "debug", skip(selcx, obligation, candidate_set))]
|
||||
fn assemble_candidates_from_impls<'cx, 'tcx>(
|
||||
selcx: &mut SelectionContext<'cx, 'tcx>,
|
||||
obligation: &ProjectionTyObligation<'tcx>,
|
||||
|
@ -337,7 +337,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
Ok(candidates)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self, candidates))]
|
||||
#[instrument(level = "debug", skip(self, candidates))]
|
||||
fn assemble_candidates_from_projected_tys(
|
||||
&mut self,
|
||||
obligation: &TraitObligation<'tcx>,
|
||||
@ -367,7 +367,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
/// supplied to find out whether it is listed among them.
|
||||
///
|
||||
/// Never affects the inference environment.
|
||||
#[tracing::instrument(level = "debug", skip(self, stack, candidates))]
|
||||
#[instrument(level = "debug", skip(self, stack, candidates))]
|
||||
fn assemble_candidates_from_caller_bounds<'o>(
|
||||
&mut self,
|
||||
stack: &TraitObligationStack<'o, 'tcx>,
|
||||
@ -880,7 +880,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
};
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self, obligation, candidates))]
|
||||
#[instrument(level = "debug", skip(self, obligation, candidates))]
|
||||
fn assemble_candidates_for_transmutability(
|
||||
&mut self,
|
||||
obligation: &TraitObligation<'tcx>,
|
||||
@ -898,7 +898,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
candidates.vec.push(TransmutabilityCandidate);
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self, obligation, candidates))]
|
||||
#[instrument(level = "debug", skip(self, obligation, candidates))]
|
||||
fn assemble_candidates_for_trait_alias(
|
||||
&mut self,
|
||||
obligation: &TraitObligation<'tcx>,
|
||||
@ -917,7 +917,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
|
||||
/// Assembles the trait which are built-in to the language itself:
|
||||
/// `Copy`, `Clone` and `Sized`.
|
||||
#[tracing::instrument(level = "debug", skip(self, candidates))]
|
||||
#[instrument(level = "debug", skip(self, candidates))]
|
||||
fn assemble_builtin_bound_candidates(
|
||||
&mut self,
|
||||
conditions: BuiltinImplConditions<'tcx>,
|
||||
|
@ -2153,7 +2153,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn match_impl(
|
||||
&mut self,
|
||||
impl_def_id: DefId,
|
||||
@ -2335,7 +2335,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||
/// impl or trait. The obligations are substituted and fully
|
||||
/// normalized. This is used when confirming an impl or default
|
||||
/// impl.
|
||||
#[tracing::instrument(level = "debug", skip(self, cause, param_env))]
|
||||
#[instrument(level = "debug", skip(self, cause, param_env))]
|
||||
fn impl_or_trait_obligations(
|
||||
&mut self,
|
||||
cause: &ObligationCause<'tcx>,
|
||||
|
@ -201,7 +201,7 @@ pub trait CreateSubstsForGenericArgsCtxt<'a, 'tcx> {
|
||||
}
|
||||
|
||||
impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
pub fn ast_region_to_region(
|
||||
&self,
|
||||
lifetime: &hir::Lifetime,
|
||||
@ -317,7 +317,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
/// `[Vec<u8>, u8]` and `generic_args` are the arguments for the associated
|
||||
/// type itself: `['a]`. The returned `SubstsRef` concatenates these two
|
||||
/// lists: `[Vec<u8>, u8, 'a]`.
|
||||
#[tracing::instrument(level = "debug", skip(self, span))]
|
||||
#[instrument(level = "debug", skip(self, span))]
|
||||
fn create_substs_for_ast_path<'a>(
|
||||
&self,
|
||||
span: Span,
|
||||
@ -716,7 +716,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
/// where `'a` is a bound region at depth 0. Similarly, the `poly_trait_ref` would be
|
||||
/// `Bar<'a>`. The returned poly-trait-ref will have this binder instantiated explicitly,
|
||||
/// however.
|
||||
#[tracing::instrument(level = "debug", skip(self, span, constness, bounds, speculative))]
|
||||
#[instrument(level = "debug", skip(self, span, constness, bounds, speculative))]
|
||||
pub(crate) fn instantiate_poly_trait_ref(
|
||||
&self,
|
||||
trait_ref: &hir::TraitRef<'_>,
|
||||
@ -808,7 +808,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
ty::TraitRef::new(trait_def_id, substs)
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self, span))]
|
||||
#[instrument(level = "debug", skip(self, span))]
|
||||
fn create_substs_for_ast_trait_ref<'a>(
|
||||
&self,
|
||||
span: Span,
|
||||
@ -922,7 +922,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
/// **A note on binders:** there is an implied binder around
|
||||
/// `param_ty` and `ast_bounds`. See `instantiate_poly_trait_ref`
|
||||
/// for more details.
|
||||
#[tracing::instrument(level = "debug", skip(self, ast_bounds, bounds))]
|
||||
#[instrument(level = "debug", skip(self, ast_bounds, bounds))]
|
||||
pub(crate) fn add_bounds<'hir, I: Iterator<Item = &'hir hir::GenericBound<'hir>>>(
|
||||
&self,
|
||||
param_ty: Ty<'tcx>,
|
||||
@ -1028,10 +1028,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
/// **A note on binders:** given something like `T: for<'a> Iterator<Item = &'a u32>`, the
|
||||
/// `trait_ref` here will be `for<'a> T: Iterator`. The `binding` data however is from *inside*
|
||||
/// the binder (e.g., `&'a u32`) and hence may reference bound regions.
|
||||
#[tracing::instrument(
|
||||
level = "debug",
|
||||
skip(self, bounds, speculative, dup_bindings, path_span)
|
||||
)]
|
||||
#[instrument(level = "debug", skip(self, bounds, speculative, dup_bindings, path_span))]
|
||||
fn add_predicates_for_ast_type_binding(
|
||||
&self,
|
||||
hir_ref_id: hir::HirId,
|
||||
@ -2599,7 +2596,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
|
||||
/// Turns a `hir::Ty` into a `Ty`. For diagnostics' purposes we keep track of whether trait
|
||||
/// objects are borrowed like `&dyn Trait` to avoid emitting redundant errors.
|
||||
#[tracing::instrument(level = "debug", skip(self))]
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
fn ast_ty_to_ty_inner(&self, ast_ty: &hir::Ty<'_>, borrowed: bool, in_path: bool) -> Ty<'tcx> {
|
||||
let tcx = self.tcx();
|
||||
|
||||
|
@ -1308,7 +1308,7 @@ fn compare_type_predicate_entailment<'tcx>(
|
||||
/// For default associated types the normalization is not possible (the value
|
||||
/// from the impl could be overridden). We also can't normalize generic
|
||||
/// associated types (yet) because they contain bound parameters.
|
||||
#[tracing::instrument(level = "debug", skip(tcx))]
|
||||
#[instrument(level = "debug", skip(tcx))]
|
||||
pub fn check_type_bounds<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
trait_ty: &ty::AssocItem,
|
||||
|
@ -130,7 +130,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
///
|
||||
/// N.B., this code relies on `self.diverges` to be accurate. In particular, assignments to `!`
|
||||
/// will be permitted if the diverges flag is currently "always".
|
||||
#[tracing::instrument(level = "debug", skip(self, expr, expected_ty_expr, allow_two_phase))]
|
||||
#[instrument(level = "debug", skip(self, expr, expected_ty_expr, allow_two_phase))]
|
||||
pub fn demand_coerce_diag(
|
||||
&self,
|
||||
expr: &hir::Expr<'tcx>,
|
||||
|
@ -1405,7 +1405,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
})
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(self, code, span, def_id, substs))]
|
||||
#[instrument(level = "debug", skip(self, code, span, def_id, substs))]
|
||||
fn add_required_obligations_with_code(
|
||||
&self,
|
||||
span: Span,
|
||||
|
@ -972,7 +972,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) {
|
||||
}
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(tcx, span, sig_if_method))]
|
||||
#[instrument(level = "debug", skip(tcx, span, sig_if_method))]
|
||||
fn check_associated_item(
|
||||
tcx: TyCtxt<'_>,
|
||||
item_id: LocalDefId,
|
||||
@ -1225,7 +1225,7 @@ fn check_item_type(tcx: TyCtxt<'_>, item_id: LocalDefId, ty_span: Span, allow_fo
|
||||
});
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(tcx, ast_self_ty, ast_trait_ref))]
|
||||
#[instrument(level = "debug", skip(tcx, ast_self_ty, ast_trait_ref))]
|
||||
fn check_impl<'tcx>(
|
||||
tcx: TyCtxt<'tcx>,
|
||||
item: &'tcx hir::Item<'tcx>,
|
||||
@ -1472,7 +1472,7 @@ fn check_where_clauses<'tcx>(wfcx: &WfCheckingCtxt<'_, 'tcx>, span: Span, def_id
|
||||
wfcx.register_obligations(obligations);
|
||||
}
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(wfcx, span, hir_decl))]
|
||||
#[instrument(level = "debug", skip(wfcx, span, hir_decl))]
|
||||
fn check_fn_or_method<'tcx>(
|
||||
wfcx: &WfCheckingCtxt<'_, 'tcx>,
|
||||
span: Span,
|
||||
@ -1536,7 +1536,7 @@ const HELP_FOR_SELF_TYPE: &str = "consider changing to `self`, `&self`, `&mut se
|
||||
`self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one \
|
||||
of the previous types except `Self`)";
|
||||
|
||||
#[tracing::instrument(level = "debug", skip(wfcx))]
|
||||
#[instrument(level = "debug", skip(wfcx))]
|
||||
fn check_method_receiver<'tcx>(
|
||||
wfcx: &WfCheckingCtxt<'_, 'tcx>,
|
||||
fn_sig: &hir::FnSig<'_>,
|
||||
|
Loading…
x
Reference in New Issue
Block a user