+ if let Some((types, generics, inp, outp, field_ty)) = method_args_ret {
+ let mut nullable_found = false;
+ for (name, inp) in inp {
+ if types.skip_arg(inp, generics) { continue; }
+ if if let syn::Type::Reference(syn::TypeReference { elem, .. }) = inp {
+ if let syn::Type::Path(syn::TypePath { ref path, .. }) = &**elem {
+ types.is_path_transparent_container(path, generics, true)
+ } else { false }
+ } else if let syn::Type::Path(syn::TypePath { ref path, .. }) = inp {
+ types.is_path_transparent_container(path, generics, true)
+ } else { false } {
+ // Note downstream clients match this text exactly so any changes may require
+ // changes in the Java and Swift bindings, at least.
+ if !nullable_found { writeln!(w, "{}///", prefix).unwrap(); }
+ nullable_found = true;
+ writeln!(w, "{}/// Note that {} (or a relevant inner pointer) may be NULL or all-0s to represent None", prefix, name).unwrap();
+ }
+ }
+ if if let Some(syn::Type::Reference(syn::TypeReference { elem, .. })) = outp {
+ if let syn::Type::Path(syn::TypePath { ref path, .. }) = &**elem {
+ types.is_path_transparent_container(path, generics, true)
+ } else { false }
+ } else if let Some(syn::Type::Path(syn::TypePath { ref path, .. })) = outp {
+ types.is_path_transparent_container(path, generics, true)
+ } else { false } {
+ // Note downstream clients match this text exactly so any changes may require
+ // changes in the Java and Swift bindings, at least.
+ if !nullable_found { writeln!(w, "{}///", prefix).unwrap(); }
+ nullable_found = true;
+ writeln!(w, "{}/// Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None", prefix).unwrap();
+ }
+ let field = field_ty.map(|ty| generics.resolve_type(ty));
+ if if let Some(syn::Type::Reference(syn::TypeReference { elem, .. })) = field {
+ if let syn::Type::Path(syn::TypePath { ref path, .. }) = &**elem {
+ let resolved_path = types.resolve_path(path, generics);
+ if types.crate_types.opaques.get(&resolved_path).is_some() {
+ writeln!(w, "{}/// Note that this field is expected to be a reference.", prefix).unwrap();
+ }
+ types.is_path_transparent_container(path, generics, true)
+ } else { false }
+ } else if let Some(syn::Type::Path(syn::TypePath { ref path, .. })) = field {
+ types.is_path_transparent_container(path, generics, true)
+ } else { false } {
+ // Note downstream clients match this text exactly so any changes may require
+ // changes in the Java and Swift bindings, at least.
+ if !nullable_found { writeln!(w, "{}///", prefix).unwrap(); }
+ writeln!(w, "{}/// Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None", prefix).unwrap();
+ }
+ }
+