The limiting of supported types in `write_template_generics` isn't
super useful as its only called once per type - later uses of the
same type with the reference flag set or wiped doesn't change
anything. Still, it is relied on somewhat, so we can't drop it
entirely.
Now that we've moved more of the `[u8; 32]` newtypes to option
wrappers, failing for non-primitive references spuriously breaks.
Instead, we just allow it for manually-mapped types and let the
compiler complain if we do something invalid.
} else { unimplemented!(); }
} else if let syn::Type::Path(p_arg) = t {
if let Some(resolved) = self.maybe_resolve_path(&p_arg.path, generics) {
- if !self.is_primitive(&resolved) {
+ if !self.is_primitive(&resolved) && self.c_type_from_path(&resolved, false, false).is_none() {
if is_ref {
// We don't currently support outer reference types for non-primitive inners
return false;
}
}
} else {
- if is_ref {
- // We don't currently support outer reference types for non-primitive inners
- return false;
- }
+ return false;
}
if !self.write_c_type_intern(w, t, generics, false, false, false, true, true) { return false; }
} else {