diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 0db22c3cea59d..050a7f9356ee9 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -655,6 +655,9 @@ impl<'hir> Generics<'hir> { match bound { GenericBound::Trait(data, _) => { let segment = data.trait_ref.path.segments.first()?; + if segment.args().parenthesized != GenericArgsParentheses::ParenSugar { + return None; + } let binding = segment.args().bindings.first()?; if let TypeBindingKind::Equality { term: Term::Ty(ty) } = binding.kind { Some(ty)