diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 00d2d16a3b3cd..de2e7836fe3c9 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -658,12 +658,17 @@ impl<'hir> Generics<'hir> { && segment.args().parenthesized == GenericArgsParentheses::ParenSugar && let [binding] = segment.args().bindings && let TypeBindingKind::Equality { term: Term::Ty(ret_ty) } = binding.kind - && let TyKind::TraitObject(_, _, TraitObjectSyntax::Dyn | TraitObjectSyntax::DynStar) = ret_ty.kind - && ret_ty.span.can_be_used_for_suggestions() { - Some(ret_ty.span) - } else { - None - }; + && let TyKind::TraitObject( + _, + _, + TraitObjectSyntax::Dyn | TraitObjectSyntax::DynStar, + ) = ret_ty.kind + && ret_ty.span.can_be_used_for_suggestions() + { + Some(ret_ty.span) + } else { + None + }; span_for_parentheses.map_or_else( || {