| use self::ImproperCtype::*; |
| use crate::syntax::atom::Atom::{self, *}; |
| use crate::syntax::{Type, Types}; |
| pub enum ImproperCtype<'a> { |
| pub fn determine_improper_ctype(&self, ty: &Type) -> ImproperCtype<'a> { |
| if let Some(atom) = Atom::from(ident) { |
| Definite(atom == RustString) |
| } else if let Some(strct) = self.structs.get(ident) { |
| Depends(&strct.name.rust) // iterate to fixed-point |
| Definite(self.rust.contains(ident)) |
| | Type::SliceRefU8(_) => Definite(true), |
| Type::UniquePtr(_) | Type::CxxVector(_) => Definite(false), |
| Type::Ref(ty) => self.determine_improper_ctype(&ty.inner), |