diff --git a/compiler/rustc_hir/src/target.rs b/compiler/rustc_hir/src/target.rs index 29c948fe318..70d9db4a84b 100644 --- a/compiler/rustc_hir/src/target.rs +++ b/compiler/rustc_hir/src/target.rs @@ -86,7 +86,11 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { Target::Statement => "statement", Target::Arm => "match arm", Target::AssocConst => "associated const", - Target::Method(_) => "method", + Target::Method(kind) => match kind { + MethodKind::Inherent => "inherent method", + MethodKind::Trait { body: false } => "required trait method", + MethodKind::Trait { body: true } => "provided trait method", + }, Target::AssocTy => "associated type", Target::ForeignFn => "foreign function", Target::ForeignStatic => "foreign static item",