MCPcopy Create free account
hub / github.com/dtolnay/thiserror / crawl

Function crawl

impl/src/generics.rs:26–46  ·  view source on GitHub ↗
(in_scope: &ParamsInScope, ty: &Type, found: &mut bool)

Source from the content-addressed store, hash-verified

24}
25
26fn 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
48pub struct InferredBounds {
49 bounds: Map<String, (Set<String>, Punctuated<TokenStream, Token![+]>)>,

Callers 1

intersectsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected