- let subtype = self.resolve_path(&$p_arg.path, generics);
- if self.is_transparent_container(ident, is_ref) {
- // We dont (yet) support primitives or containers inside transparent
- // containers, so check for that first:
- if self.is_primitive(&subtype) { return false; }
- if self.is_known_container(&subtype, is_ref) { return false; }
- if !in_type {
- if self.c_type_has_inner_from_path(&subtype) {
- if !self.write_c_path_intern(w, &$p_arg.path, generics, is_ref, is_mut, ptr_for_ref) { return false; }
+ if let Some(subtype) = self.maybe_resolve_path(&$p_arg.path, generics) {
+ if self.is_transparent_container(ident, is_ref) {
+ // We dont (yet) support primitives or containers inside transparent
+ // containers, so check for that first:
+ if self.is_primitive(&subtype) { return false; }
+ if self.is_known_container(&subtype, is_ref) { return false; }
+ if !in_type {
+ if self.c_type_has_inner_from_path(&subtype) {
+ if !self.write_c_path_intern(w, &$p_arg.path, generics, is_ref, is_mut, ptr_for_ref) { return false; }
+ } else {
+ // Option<T> needs to be converted to a *mut T, ie mut ptr-for-ref
+ if !self.write_c_path_intern(w, &$p_arg.path, generics, true, true, true) { return false; }
+ }