| 24 | } |
| 25 | |
| 26 | fn crawl(in_scope: &ParamsInScope, ty: &Type, found: &mut bool) { |
| 27 | if let Type::Path(ty) = ty { |
| 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; |
| 34 | } |
| 35 | } |
| 36 | for segment in &ty.path.segments { |
| 37 | if let PathArguments::AngleBracketed(arguments) = &segment.arguments { |
| 38 | for arg in &arguments.args { |
| 39 | if let GenericArgument::Type(ty) = arg { |
| 40 | crawl(in_scope, ty, found); |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | pub struct InferredBounds { |
| 49 | bounds: Map<String, (Set<String>, Punctuated<TokenStream, Token![+]>)>, |