Skip to content

Even some more stylo derived errors #662

@fitzgen

Description

@fitzgen

Input C/C++ Header

template <class T> class RefPtr { T a; };
template <class T> class nsMainThreadPtrHolder { T a; };
template <class T> class nsMainThreadPtrHandle {
  RefPtr<nsMainThreadPtrHolder<T>> mPtr;
};

Bindgen Invokation

Complicated, will get back with a minimal invokation in a bit.

Actual Results

/* automatically generated by rust-bindgen */

pub use self::root::*;
pub use self::root::mozilla::*;
pub use self::root::mozilla::css::*;
pub use self::root::mozilla::dom::*;
use atomic_refcell::AtomicRefCell;
use data::ElementData;
pub type ServoUnsafeCell<T> = ::std::cell::UnsafeCell<T>;
pub type ServoCell<T> = ::std::cell::Cell<T>;
pub type ServoNodeData = AtomicRefCell<ElementData>;

#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
pub mod root {
    #[allow(unused_imports)]
    use self::super::root;
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct RefPtr<T> {
        pub a: T,
    }
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct nsMainThreadPtrHolder<T> {
        pub a: T,
    }
    #[repr(C)]
    #[derive(Debug, Copy, Clone)]
    pub struct nsMainThreadPtrHandle {
        pub mPtr: root::RefPtr<root::nsMainThreadPtrHolder<T>>,
    }
}

Which results in compilation errors like

error[E0412]: cannot find type `T` in this scope
  --> stylo_structs.rs:30:60
   |
30 |         pub mPtr: root::RefPtr<root::nsMainThreadPtrHolder<T>>,
   |                                                            ^ not found in this scope

-->

Expected Results

Some compilation errors from the raw-line insertions, but all type parameters that get referenced should exist.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions