Skip to content

Commit 6b3e1e5

Browse files
committed
Generate trait bounds on associated types
1 parent 1368591 commit 6b3e1e5

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

impl/src/generics.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ impl<'a> ParamsInScope<'a> {
2525

2626
fn crawl(in_scope: &ParamsInScope, ty: &Type, found: &mut bool) {
2727
if let Type::Path(ty) = ty {
28-
if ty.qself.is_none() {
29-
if let Some(ident) = ty.path.get_ident() {
30-
if in_scope.names.contains(ident) {
31-
*found = true;
32-
}
28+
if let Some(qself) = &ty.qself {
29+
crawl(in_scope, &qself.ty, found);
30+
} else {
31+
let front = ty.path.segments.first().unwrap();
32+
if front.arguments.is_none() && in_scope.names.contains(&front.ident) {
33+
*found = true;
3334
}
3435
}
3536
for segment in &ty.path.segments {

0 commit comments

Comments
 (0)