1
Fork 0

Directly use the instrument macro instead of its full path

This commit is contained in:
Oli Scherer 2022-08-31 13:01:10 +00:00
parent 4f9898a794
commit d3b22c7267
25 changed files with 86 additions and 89 deletions

View file

@ -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();

View file

@ -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,

View file

@ -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>,

View file

@ -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,

View file

@ -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<'_>,