Skip to content

Type parameter is incorrectly stripped when types are not generated #833

Closed
@upsuper

Description

@upsuper

Input C/C++ Header

template<typename T>
class nsTArray {
  T* mHeader;
};

extern "C" nsTArray<int>* func();

Bindgen Invocation

$ bindgen input.hpp --generate functions

Actual Results

extern "C" {
    pub fn func() -> *mut nsTArray;
}

Expected Results

extern "C" {
    pub fn func() -> *mut nsTArray<::std::os::raw::c_int>;
}

like what it would generate when generating type is enabled.

RUST_LOG=bindgen Output

INFO:bindgen: Clang Version: clang version 4.0.0 (tags/RELEASE_400/final)
WARN:bindgen: Using clang (4, 0), expected (3, 9)
DEBUG:bindgen::ir::context: BindgenContext::add_item(Item { id: ItemId(0), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Module(Module { name: Some("root"), kind: Normal, children: {} }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }, declaration: None, loc: None
DEBUG:bindgen::ir::item: Item::from_ty_with_id: ItemId(1)
        ty = Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location = Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray"))
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray"))), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray"))), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::ty: from_clang_ty: ItemId(1), ty: Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), loc: Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray"))
DEBUG:bindgen::ir::ty: currently_parsed_types: [PartialType { decl: Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray")), id: ItemId(1) }]
WARN:bindgen::ir::comp: Unknown kind for comp type: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)
DEBUG:bindgen::ir::comp: CompInfo::from_ty(Struct, Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray")))
DEBUG:bindgen::ir::item: Item::named_type:
        with_id = None,
        ty = T Type(T, kind: Unexposed, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location: Cursor(T kind: TemplateTypeParameter, loc: test.hpp:1:19, usr: Some("c:test.hpp@9"))
DEBUG:bindgen::ir::context: BindgenContext::add_named_type: item = Item { id: ItemId(2), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Type(Type { name: Some("T"), layout: None, kind: Named, is_const: false }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }; definition = Cursor(T kind: TemplateTypeParameter, loc: test.hpp:1:19, usr: Some("c:test.hpp@9"))
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(2) as child of parent module ItemId(0)
DEBUG:bindgen::ir::item: from_ty_or_ref_with_id: ItemId(3) Type(T *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader")), Some(ItemId(1))
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(T *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))), Some(ItemId(1))
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::item: New unresolved type reference: Type(T *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))
DEBUG:bindgen::ir::context: BindgenContext::add_item(Item { id: ItemId(3), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(1), kind: Type(Type { name: None, layout: None, kind: UnresolvedTypeRef(Type(T *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader")), Some(ItemId(1))), is_const: false }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }, declaration: Some(Cursor( kind: InvalidFile, loc: builtin definitions, usr: None)), loc: None
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(3) as child of current module ItemId(0)
DEBUG:bindgen::ir::context: Invalid declaration Cursor( kind: InvalidFile, loc: builtin definitions, usr: None) found for type Type { name: None, layout: None, kind: UnresolvedTypeRef(Type(T *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader")), Some(ItemId(1))), is_const: false }
DEBUG:bindgen::ir::context: BindgenContext::add_item(Item { id: ItemId(1), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Type(Type { name: Some("nsTArray"), layout: None, kind: Comp(CompInfo { kind: Struct, fields: BeforeComputingBitfieldUnits([RawField(FieldData { name: Some("mHeader"), ty: ItemId(3), comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, bitfield: None, mutable: false, offset: None })]), template_params: [ItemId(2)], methods: [], constructors: [], destructor: None, base_members: [], inner_types: [], inner_vars: [], has_vtable: false, has_destructor: false, has_nonempty_base: false, has_non_type_template_params: false, packed: false, found_unknown_attr: false, detect_derive_default_cycle: Cell { value: false }, detect_has_destructor_cycle: Cell { value: false }, is_forward_declaration: false }), is_const: false }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }, declaration: Some(Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), loc: Some(Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray")))
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(1) as child of parent module ItemId(0)
DEBUG:bindgen::ir::item: Item::from_ty_with_id: ItemId(4)
        ty = Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location = Cursor( kind: UnexposedDecl, loc: test.hpp:6:8, usr: None)
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor( kind: UnexposedDecl, loc: test.hpp:6:8, usr: None)), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor( kind: UnexposedDecl, loc: test.hpp:6:8, usr: None)), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::ty: from_clang_ty: ItemId(4), ty: Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), loc: Cursor( kind: UnexposedDecl, loc: test.hpp:6:8, usr: None)
DEBUG:bindgen::ir::ty: currently_parsed_types: []
WARN:bindgen::ir::ty: invalid type Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None))
DEBUG:bindgen::ir::function: Function::parse(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func")), Type(nsTArray<int> *(), kind: FunctionProto, cconv: 1, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)))
DEBUG:bindgen::ir::item: Item::from_ty_with_id: ItemId(5)
        ty = Type(nsTArray<int> *(), kind: FunctionProto, cconv: 1, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location = Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(nsTArray<int> *(), kind: FunctionProto, cconv: 1, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(nsTArray<int> *(), kind: FunctionProto, cconv: 1, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::ty: from_clang_ty: ItemId(5), ty: Type(nsTArray<int> *(), kind: FunctionProto, cconv: 1, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), loc: Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))
DEBUG:bindgen::ir::ty: currently_parsed_types: []
DEBUG:bindgen::ir::function: FunctionSig::from_ty Type(nsTArray<int> *(), kind: FunctionProto, cconv: 1, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)) Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))
DEBUG:bindgen::ir::item: from_ty_or_ref_with_id: ItemId(6) Type(nsTArray<int> *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func")), None
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(nsTArray<int> *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::item: New unresolved type reference: Type(nsTArray<int> *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))
DEBUG:bindgen::ir::context: BindgenContext::add_item(Item { id: ItemId(6), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Type(Type { name: None, layout: None, kind: UnresolvedTypeRef(Type(nsTArray<int> *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func")), None), is_const: false }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }, declaration: Some(Cursor( kind: InvalidFile, loc: builtin definitions, usr: None)), loc: None
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(6) as child of parent module ItemId(0)
DEBUG:bindgen::ir::context: Invalid declaration Cursor( kind: InvalidFile, loc: builtin definitions, usr: None) found for type Type { name: None, layout: None, kind: UnresolvedTypeRef(Type(nsTArray<int> *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func")), None), is_const: false }
DEBUG:bindgen::ir::context: BindgenContext::add_item(Item { id: ItemId(5), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Type(Type { name: None, layout: Some(Layout { size: 1, align: 4, packed: false }), kind: Function(FunctionSig { return_type: ItemId(6), argument_types: [], is_variadic: false, abi: Known(C) }), is_const: false }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }, declaration: Some(Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), loc: Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func")))
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(5) as child of parent module ItemId(0)
DEBUG:bindgen::ir::context: Invalid declaration Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None) found for type Type { name: None, layout: Some(Layout { size: 1, align: 4, packed: false }), kind: Function(FunctionSig { return_type: ItemId(6), argument_types: [], is_variadic: false, abi: Known(C) }), is_const: false }
DEBUG:bindgen::ir::context: BindgenContext::add_item(Item { id: ItemId(7), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Function(Function { name: "func", mangled_name: None, signature: ItemId(5), comment: None, kind: Function }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }, declaration: Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))), loc: Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func")))
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(7) as child of parent module ItemId(0)
DEBUG:bindgen::ir::item: Item::from_ty_with_id: ItemId(8)
        ty = Type(T *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location = Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(T *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))), Some(ItemId(1))
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(T *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))), Some(ItemId(1))
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::ty: from_clang_ty: ItemId(8), ty: Type(T *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), loc: Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))
DEBUG:bindgen::ir::ty: currently_parsed_types: []
DEBUG:bindgen::ir::item: from_ty_or_ref_with_id: ItemId(9) Type(T, kind: Unexposed, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader")), None
DEBUG:bindgen::ir::item: refs already collected, resolving directly
DEBUG:bindgen::ir::item: Item::from_ty_with_id: ItemId(9)
        ty = Type(T, kind: Unexposed, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location = Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))
DEBUG:bindgen::ir::item: Item::named_type:
        with_id = Some(ItemId(9)),
        ty = T * Type(T *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location: Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(T, kind: Unexposed, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(T, kind: Unexposed, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::ty: from_clang_ty: ItemId(9), ty: Type(T, kind: Unexposed, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), loc: Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))
DEBUG:bindgen::ir::ty: currently_parsed_types: []
WARN:bindgen::ir::ty: Unexposed type Type(T, kind: Unexposed, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), recursing inside, loc: Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader"))
DEBUG:bindgen::ir::item: Item::from_ty recursing in the ast
DEBUG:bindgen::ir::item: Item::from_ty_with_id: ItemId(9)
        ty = Type(T, kind: Unexposed, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location = Cursor(T kind: TypeRef, loc: test.hpp:3:3, usr: None)
DEBUG:bindgen::ir::item: Item::named_type:
        with_id = Some(ItemId(9)),
        ty = T Type(T, kind: Unexposed, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location: Cursor(T kind: TypeRef, loc: test.hpp:3:3, usr: None)
DEBUG:bindgen::ir::context: add_builtin_item: item = Item { id: ItemId(9), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Type(Type { name: Some("T"), layout: None, kind: ResolvedTypeRef(ItemId(2)), is_const: false }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(9) as child of parent module ItemId(0)
DEBUG:bindgen::ir::context: BindgenContext::add_item(Item { id: ItemId(8), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(1), kind: Type(Type { name: None, layout: None, kind: Pointer(ItemId(9)), is_const: false }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }, declaration: Some(Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), loc: Some(Cursor(mHeader kind: FieldDecl, loc: test.hpp:3:6, usr: Some("c:@ST>1#T@nsTArray@FI@mHeader")))
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(8) as child of current module ItemId(0)
DEBUG:bindgen::ir::context: Invalid declaration Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None) found for type Type { name: None, layout: None, kind: Pointer(ItemId(9)), is_const: false }
DEBUG:bindgen::ir::item: Item::from_ty_with_id: ItemId(10)
        ty = Type(nsTArray<int> *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location = Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(nsTArray<int> *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(nsTArray<int> *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::ty: from_clang_ty: ItemId(10), ty: Type(nsTArray<int> *, kind: Pointer, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), loc: Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))
DEBUG:bindgen::ir::ty: currently_parsed_types: []
DEBUG:bindgen::ir::item: from_ty_or_ref_with_id: ItemId(11) Type(nsTArray<int>, kind: Unexposed, cconv: 100, decl: Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I")), canon: Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I"))), Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func")), None
DEBUG:bindgen::ir::item: refs already collected, resolving directly
DEBUG:bindgen::ir::item: Item::from_ty_with_id: ItemId(11)
        ty = Type(nsTArray<int>, kind: Unexposed, cconv: 100, decl: Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I")), canon: Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I"))),
        location = Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))
DEBUG:bindgen::ir::item: Item::named_type:
        with_id = Some(ItemId(11)),
        ty = nsTArray<int> *() Type(nsTArray<int> *(), kind: FunctionProto, cconv: 1, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location: Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(nsTArray<int>, kind: Unexposed, cconv: 100, decl: Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I")), canon: Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I"))), Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(nsTArray<int>, kind: Unexposed, cconv: 100, decl: Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I")), canon: Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I"))), Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::ty: from_clang_ty: ItemId(11), ty: Type(nsTArray<int>, kind: Unexposed, cconv: 100, decl: Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I")), canon: Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I"))), loc: Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func"))
DEBUG:bindgen::ir::ty: currently_parsed_types: [PartialType { decl: Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I")), id: ItemId(11) }]
DEBUG:bindgen::ir::item: from_ty_or_ref_with_id: ItemId(12) Type(int, kind: Int, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), None
DEBUG:bindgen::ir::item: refs already collected, resolving directly
DEBUG:bindgen::ir::item: Item::from_ty_with_id: ItemId(12)
        ty = Type(int, kind: Int, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location = Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(int, kind: Int, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), None
DEBUG:bindgen::ir::context: Not resolved, maybe builtin?
DEBUG:bindgen::ir::context: add_builtin_item: item = Item { id: ItemId(13), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Type(Type { name: Some("int"), layout: Some(Layout { size: 4, align: 4, packed: false }), kind: Int(Int), is_const: false }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(13) as child of parent module ItemId(0)
DEBUG:bindgen::ir::item: from_ty_or_ref_with_id: ItemId(14) Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray")), None
DEBUG:bindgen::ir::item: refs already collected, resolving directly
DEBUG:bindgen::ir::item: Item::from_ty_with_id: ItemId(14)
        ty = Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)),
        location = Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray"))
DEBUG:bindgen::ir::context: builtin_or_resolved_ty: Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Some(Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray"))), None
DEBUG:bindgen::ir::context: Already resolved ty ItemId(1), CanonicalTypeDeclaration(Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray"))), Type(, kind: Invalid, cconv: 100, decl: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None), canon: Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)) Some(Cursor(nsTArray kind: ClassTemplate, loc: test.hpp:2:7, usr: Some("c:@ST>1#T@nsTArray")))
DEBUG:bindgen::ir::context: add_builtin_item: item = Item { id: ItemId(14), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Type(Type { name: Some(""), layout: None, kind: ResolvedTypeRef(ItemId(1)), is_const: false }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(14) as child of parent module ItemId(0)
DEBUG:bindgen::ir::context: BindgenContext::add_item(Item { id: ItemId(11), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Type(Type { name: Some("nsTArray"), layout: None, kind: TemplateInstantiation(TemplateInstantiation { definition: ItemId(14), args: [ItemId(13)] }), is_const: false }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }, declaration: Some(Cursor(nsTArray kind: ClassDecl, loc: test.hpp:2:7, usr: Some("c:@S@nsTArray>#I"))), loc: Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func")))
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(11) as child of parent module ItemId(0)
DEBUG:bindgen::ir::context: BindgenContext::add_item(Item { id: ItemId(10), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Type(Type { name: None, layout: Some(Layout { size: 8, align: 8, packed: false }), kind: Pointer(ItemId(11)), is_const: false }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }, declaration: Some(Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None)), loc: Some(Cursor(func kind: FunctionDecl, loc: test.hpp:6:27, usr: Some("c:@F@func")))
DEBUG:bindgen::ir::context: add_item_to_module: adding ItemId(10) as child of parent module ItemId(0)
DEBUG:bindgen::ir::context: Invalid declaration Cursor( kind: NoDeclFound, loc: builtin definitions, usr: None) found for type Type { name: None, layout: Some(Layout { size: 8, align: 8, packed: false }), kind: Pointer(ItemId(11)), is_const: false }
DEBUG:bindgen::ir::context: No replacements to process
TRACE:bindgen::ir::analysis::template_params: constrain ItemId(5)
TRACE:bindgen::ir::analysis::template_params:   initially, used set is {}
TRACE:bindgen::ir::analysis::template_params:     other item: join with successors' usage
TRACE:bindgen::ir::analysis::template_params:       union with ItemId(6)'s usage: []
TRACE:bindgen::ir::analysis::template_params:   finally, used set is {}
TRACE:bindgen::ir::analysis::template_params: constrain ItemId(7)
TRACE:bindgen::ir::analysis::template_params:   initially, used set is {}
TRACE:bindgen::ir::analysis::template_params:     other item: join with successors' usage
TRACE:bindgen::ir::analysis::template_params:   finally, used set is {}
TRACE:bindgen::ir::analysis::template_params: constrain ItemId(0)
TRACE:bindgen::ir::analysis::template_params:   initially, used set is {}
TRACE:bindgen::ir::analysis::template_params:     other item: join with successors' usage
TRACE:bindgen::ir::analysis::template_params:   finally, used set is {}
DEBUG:bindgen::codegen: codegen: BindgenOptions { hidden_types: RegexSet { items: [], set: Some(RegexSet([])) }, opaque_types: RegexSet { items: [], set: Some(RegexSet([])) }, whitelisted_types: RegexSet { items: [], set: Some(RegexSet([])) }, whitelisted_functions: RegexSet { items: [], set: Some(RegexSet([])) }, whitelisted_vars: RegexSet { items: [], set: Some(RegexSet([])) }, bitfield_enums: RegexSet { items: [], set: Some(RegexSet([])) }, constified_enums: RegexSet { items: [], set: Some(RegexSet([])) }, constified_enum_modules: RegexSet { items: [], set: Some(RegexSet([])) }, builtins: false, links: [], emit_ast: false, emit_ir: false, emit_ir_graphviz: None, enable_cxx_namespaces: false, disable_name_namespacing: false, layout_tests: true, derive_debug: true, derive_default: false, unstable_rust: false, use_core: false, ctypes_prefix: None, namespaced_constants: true, msvc_mangling: false, convert_floats: true, raw_lines: [], clang_args: ["-isystem", "c:\\Program Files\\LLVM\\bin\\..\\lib\\clang\\4.0.0\\include", "-isystem", "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include", "-isystem", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.15063.0\\ucrt", "-isystem", "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.15063.0\\shared", "-isystem", "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.15063.0\\um", "-isystem", "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.15063.0\\winrt", "test.hpp"], input_header: Some("test.hpp"), input_unsaved_files: [], dummy_uses: None, parse_callbacks: None, codegen_config: CodegenConfig { functions: true, types: false, vars: false, methods: false, constructors: false, destructors: false }, conservative_inline_namespaces: false, generate_comments: true, generate_inline_functions: false, whitelist_recursively: true, objc_extern_crate: false, enable_mangling: true, prepend_enum_name: true }
DEBUG:bindgen::codegen: <Item as CodeGenerator>::codegen: self = Item { id: ItemId(0), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Module(Module { name: Some("root"), kind: Normal, children: {ItemId(1), ItemId(2), ItemId(3), ItemId(5), ItemId(6), ItemId(7), ItemId(8), ItemId(9), ItemId(10), ItemId(11), ItemId(13), ItemId(14)} }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }
DEBUG:bindgen::codegen: <Module as CodeGenerator>::codegen: item = Item { id: ItemId(0), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Module(Module { name: Some("root"), kind: Normal, children: {ItemId(1), ItemId(2), ItemId(3), ItemId(5), ItemId(6), ItemId(7), ItemId(8), ItemId(9), ItemId(10), ItemId(11), ItemId(13), ItemId(14)} }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }
DEBUG:bindgen::codegen: <Item as CodeGenerator>::codegen: self = Item { id: ItemId(7), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Function(Function { name: "func", mangled_name: None, signature: ItemId(5), comment: None, kind: Function }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }
DEBUG:bindgen::codegen: <Function as CodeGenerator>::codegen: item = Item { id: ItemId(7), local_id: Cell { value: None }, next_child_local_id: Cell { value: 1 }, canonical_name_cache: RefCell { value: None }, comment: None, annotations: Annotations { opaque: false, hide: false, use_instead_of: None, disallow_copy: false, private_fields: None, accessor_kind: None, constify_enum_variant: false }, parent_id: ItemId(0), kind: Function(Function { name: "func", mangled_name: None, signature: ItemId(5), comment: None, kind: Function }), detect_derive_debug_cycle: Cell { value: false }, detect_derive_copy_cycle: Cell { value: false } }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions