We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
As @jsgf points out in #556, the current code generated for constructors relies on RVO, or requires memmovable fields.
The text was updated successfully, but these errors were encountered:
--generate types,methods,functions,vars
This does seem to be a problem in practice.
This test fails:
// TestType.h struct TestType { TestType *self; TestType(); bool isvalid() const; };
// TestType.cpp TestType::TestType() { self = this; } bool TestType::isvalid() const { return self == this; }
// test.rs fn test() { let v = unsafe { mem::uninitialized() }; v = unsafe { TestType::new() }; assert!(unsafe { v.isvalid() }); // Fails }
I think bindgen should be generating a placement new method:
impl TestType { unsafe fn new_ptr(this: *mut Self) { TestType_TestType(this) } }
Sorry, something went wrong.
new(...)
No branches or pull requests
As @jsgf points out in #556, the current code generated for constructors relies on RVO, or requires memmovable fields.
The text was updated successfully, but these errors were encountered: