Skip to content
New issue

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

cannot bind rvalue reference of type .. to lvalue of type .. / pointer argument requires that the function be marked unsafe #1348

Open
lnicola opened this issue Dec 7, 2023 · 0 comments

Comments

@lnicola
Copy link

lnicola commented Dec 7, 2023

Describe the bug
I'm getting the error in the issue.

To Reproduce

use autocxx::prelude::*;
use autocxx::subclass::*;

include_cpp! {
    #include "gdal/gdal_priv.h"
    safety!(unsafe_ffi)
    generate!("GDALDataset")
    subclass!("GDALDataset", MyDataset)
}

use ffi::*;

#[subclass]
#[derive(Default)]
pub struct MyDataset;

impl GDALDataset_methods for MyDataset {}

fn main() {}

Expected behavior
I'd like it to work.

Additional context
Requires gdal-devel or similar.

EDIT: dropping safety!(unsafe_ffi) fixes this, but then it fails with error: cannot bind rvalue reference of type ‘std::unique_ptr<GDALRelationship>&&’ to lvalue of type ‘std::unique_ptr<GDALRelationship>’.

@lnicola lnicola changed the title pointer argument requires that the function be marked unsafe cannot bind rvalue reference of type .. to lvalue of type .. / pointer argument requires that the function be marked unsafe Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant