autocxx
autocxx copied to clipboard
Expected a pinned reference: WasNotPin
c++ header
namespace mapnik {
class Map {
public:
int &a(long);
};
} // namespace mapnik
thread 'main' panicked at 'Expected a pinned reference: WasNotPin', /home/boydjohnson/.cargo/registry/src/github.com-1ecc6299db9ec823/autocxx-engine-0.22.3/src/conversion/codegen_rs/lifetime.rs:103:33
Expected Behavior
autocxx-gen produces the c++ side of the bridge.
Actual Behavior
autocxx-bindgen produces
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mapnik_Map {
pub _address: u8,
}
extern "C" {
#[link_name = "\u{1}_ZN6mapnik3Map1aEl"]
pub fn mapnik_Map_a(
this: *mut mapnik_Map,
arg1: ::std::os::raw::c_long,
) -> *mut ::std::os::raw::c_int;
}
impl mapnik_Map {
#[inline]
pub unsafe fn a(&mut self, arg1: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_int {
mapnik_Map_a(self, arg1)
}
}
but autocxx-gen fails with the above panic.
Specifications
- Version: 0.22.3
- Platform: ubuntu
Let me know if this is a bad issue/not a bug/bug in my understanding of C++.
Thanks, this is definitely a bug in autocxx. Would you mind raising a PR with a failing test case?
Yeah, I'll do so.
Sorry for the delay on this. This is next on my list of bugs to take a look at.
No problem. Thanks for all your work, @adetaylor