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

Internal functions that could cause UB if misused should be marked unsafe #244

Closed
programmerjake opened this issue Apr 15, 2021 · 1 comment · Fixed by #250
Closed

Internal functions that could cause UB if misused should be marked unsafe #244

programmerjake opened this issue Apr 15, 2021 · 1 comment · Fixed by #250
Milestone

Comments

@programmerjake
Copy link

A good example is Context::new:

The following safe code can cause UB:

fn crash() {
    drop(Context::new(23 as LLVMContextRef));
}

This isn't actually a soundness issue since those functions aren't publicly accessible, however I think it's a code-style issue that goes against the safety ethos of Rust.

@TheDan64
Copy link
Owner

This is an interesting point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants