Skip to content

std::boxed::into_raw should be marked as safe #25755

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

Closed
shepmaster opened this issue May 24, 2015 · 1 comment · Fixed by #25767
Closed

std::boxed::into_raw should be marked as safe #25755

shepmaster opened this issue May 24, 2015 · 1 comment · Fixed by #25767

Comments

@shepmaster
Copy link
Member

If I understand the reasoning behind marking mem::forget safe, then I think the same should apply to into_raw.

Currently, it says:

Function is unsafe, because result of this function is no longer automatically managed that may lead to memory or other resource leak.

@Gankra
Copy link
Contributor

Gankra commented May 24, 2015

Agreed. It's safe. Basically a mem::forget that returns an integer.

mystor added a commit to mystor/rust that referenced this issue May 25, 2015
By the same logic that `mem::forget` is safe, `boxed::into_raw` is actually a safe function. Fixes rust-lang#25755.
bors added a commit that referenced this issue May 25, 2015
By the same logic that `mem::forget` is safe, `boxed::into_raw` is actually a safe function.

Fixes #25755.
bors added a commit that referenced this issue May 25, 2015
By the same logic that `mem::forget` is safe, `boxed::into_raw` is actually a safe function.

Fixes #25755.
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 a pull request may close this issue.

3 participants