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

The new unsafety definition #397

Open
ojeda opened this issue Nov 24, 2022 · 2 comments
Open

The new unsafety definition #397

ojeda opened this issue Nov 24, 2022 · 2 comments

Comments

@ojeda
Copy link
Contributor

ojeda commented Nov 24, 2022

The new unsafety definition (after #395) is:

An unsafe operation is an operation that may result in undefined behavior that is not diagnosed as a static error.

Someone may argue that safe operations can also "result" in UB (due to some unsoundness in an abstraction or a broken contract), thus many more operations are unsafe than the ones stated in the list. Perhaps some clarification on "result" would help, or a different way to express the idea.

@crlf0710
Copy link

crlf0710 commented Apr 3, 2023

I don't speak English well, but my two cents: An unsafe operation is an operation that has preconditions that are currently not expressed in the Rust language.

@Veykril
Copy link
Member

Veykril commented Aug 3, 2023

Someone may argue that safe operations can also "result" in UB

I'd argue against that. If some contract was broken (or unsoundness was already incurred, which tbf is UB in itself), you have effectively invoked UB at that point already, the safe code wreaking havoc is just an after effect of that but the true culprit is still the unsafe code doing undefined things.

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

3 participants