]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_typeck/src/mem_categorization.rs
Auto merge of #102189 - davidtwco:translation-derive-enums, r=compiler-errors
[rust.git] / compiler / rustc_typeck / src / mem_categorization.rs
index ced919f66db41996e07877cd329ca6da5bfc7922..39610e3ae38057228ec2d97c6690806261aeabfe 100644 (file)
@@ -265,6 +265,7 @@ pub(crate) fn cat_expr_adjusted(
         self.cat_expr_adjusted_with(expr, || Ok(previous), adjustment)
     }
 
+    #[instrument(level = "debug", skip(self, previous))]
     fn cat_expr_adjusted_with<F>(
         &self,
         expr: &hir::Expr<'_>,
@@ -274,7 +275,6 @@ fn cat_expr_adjusted_with<F>(
     where
         F: FnOnce() -> McResult<PlaceWithHirId<'tcx>>,
     {
-        debug!("cat_expr_adjusted_with({:?}): {:?}", adjustment, expr);
         let target = self.resolve_vars_if_possible(adjustment.target);
         match adjustment.kind {
             adjustment::Adjust::Deref(overloaded) => {
@@ -299,6 +299,7 @@ fn cat_expr_adjusted_with<F>(
         }
     }
 
+    #[instrument(level = "debug", skip(self))]
     pub(crate) fn cat_expr_unadjusted(
         &self,
         expr: &hir::Expr<'_>,
@@ -387,6 +388,7 @@ pub(crate) fn cat_expr_unadjusted(
         }
     }
 
+    #[instrument(level = "debug", skip(self, span))]
     pub(crate) fn cat_res(
         &self,
         hir_id: hir::HirId,
@@ -394,8 +396,6 @@ pub(crate) fn cat_res(
         expr_ty: Ty<'tcx>,
         res: Res,
     ) -> McResult<PlaceWithHirId<'tcx>> {
-        debug!("cat_res: id={:?} expr={:?} def={:?}", hir_id, expr_ty, res);
-
         match res {
             Res::Def(
                 DefKind::Ctor(..)
@@ -475,13 +475,12 @@ pub(crate) fn cat_projection<N: HirNode>(
         ret
     }
 
+    #[instrument(level = "debug", skip(self))]
     fn cat_overloaded_place(
         &self,
         expr: &hir::Expr<'_>,
         base: &hir::Expr<'_>,
     ) -> McResult<PlaceWithHirId<'tcx>> {
-        debug!("cat_overloaded_place(expr={:?}, base={:?})", expr, base);
-
         // Reconstruct the output assuming it's a reference with the
         // same region and mutability as the receiver. This holds for
         // `Deref(Mut)::Deref(_mut)` and `Index(Mut)::index(_mut)`.
@@ -497,13 +496,12 @@ fn cat_overloaded_place(
         self.cat_deref(expr, base)
     }
 
+    #[instrument(level = "debug", skip(self, node))]
     fn cat_deref(
         &self,
         node: &impl HirNode,
         base_place: PlaceWithHirId<'tcx>,
     ) -> McResult<PlaceWithHirId<'tcx>> {
-        debug!("cat_deref: base_place={:?}", base_place);
-
         let base_curr_ty = base_place.place.ty();
         let deref_ty = match base_curr_ty.builtin_deref(true) {
             Some(mt) => mt.ty,