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

Fix warning about unused_must_use for Box::from_raw #860

Merged
merged 1 commit into from Jul 19, 2022

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Jul 18, 2022

rust-lang/rust#99270 recently added a must_use for Box::from_raw. This causes this particular line to raise a warning. This solves it by explicitly dropping the value. This code was storing a pointer to a Rust structure using Box::into_raw. This drop impl was reconstituting it as a Box in order to free the memory. However, this doesn't care about the return value as it is only doing this to then immediately drop and free the value.

@alexcrichton alexcrichton merged commit 46674ce into rust-lang:master Jul 19, 2022
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

2 participants