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

explicitly drop box ptr #434

Merged
merged 1 commit into from Sep 24, 2022

Conversation

sorhawell
Copy link
Contributor

@sorhawell sorhawell commented Sep 23, 2022

compiling extendr with latest rust nightly I get warnings for every #[extendr] macro invocation

warning: unused return value of `Box::<T>::from_raw` that must be used
     --> src/rdataframe/mod.rs:98:1
      |
   98 | #[extendr]
      | ^^^^^^^^^^
      |
      = note: `#[warn(unused_must_use)]` on by default
      = note: call `drop(from_raw(ptr))` if you intend to drop the `Box`
      = note: this warning originates in the attribute macro `extendr` (in Nightly builds, run with -Z macro-backtrace for more info)

the warnings come from this update, where it is required to explicitly drop boxed pointers

another contributer to rust-lang solved it like this:

I have used the same pattern in this PR

@multimeric
Copy link
Member

I think rust-lang/rust#99270 is the original original source of this change. Anyway, looks good!

Copy link
Member

@Ilia-Kosenkov Ilia-Kosenkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, looks good!

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

Successfully merging this pull request may close these issues.

None yet

3 participants