+ } else if trait_bound.path.segments.len() == 1 {
+ // If we're templated on Deref<Target = ConcreteThing>, store
+ // the reference type in `default_generics` which handles full
+ // types and not just paths.
+ if let syn::PathArguments::AngleBracketed(ref args) =
+ trait_bound.path.segments[0].arguments {
+ for subargument in args.args.iter() {
+ match subargument {
+ syn::GenericArgument::Lifetime(_) => {},
+ syn::GenericArgument::Binding(ref b) => {
+ if &format!("{}", b.ident) != "Target" { return false; }
+ let default = &b.ty;
+ self.default_generics.insert(&type_param.ident, (parse_quote!(&#default), parse_quote!(&#default)));
+ break 'bound_loop;
+ },
+ _ => unimplemented!(),
+ }
+ }
+ None
+ } else { None }