From 6b3e1e50b27d9f90fd4a4be098d4693e50609784 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Wed, 8 Jan 2025 11:41:16 -0800 Subject: [PATCH] Generate trait bounds on associated types --- impl/src/generics.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/impl/src/generics.rs b/impl/src/generics.rs index 254c2ed..26fe0a9 100644 --- a/impl/src/generics.rs +++ b/impl/src/generics.rs @@ -25,11 +25,12 @@ impl<'a> ParamsInScope<'a> { fn crawl(in_scope: &ParamsInScope, ty: &Type, found: &mut bool) { if let Type::Path(ty) = ty { - if ty.qself.is_none() { - if let Some(ident) = ty.path.get_ident() { - if in_scope.names.contains(ident) { - *found = true; - } + if let Some(qself) = &ty.qself { + crawl(in_scope, &qself.ty, found); + } else { + let front = ty.path.segments.first().unwrap(); + if front.arguments.is_none() && in_scope.names.contains(&front.ident) { + *found = true; } } for segment in &ty.path.segments {