-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Stop applying dereferenceable(n) to return types
#149948
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
base: main
Are you sure you want to change the base?
Conversation
| // potentially self-referential types (see | ||
| // <https://github.com/rust-lang/unsafe-code-guidelines/issues/381>). If LLVM had a way | ||
| // to say "dereferenceable on entry" we could use it here. | ||
| attrs.pointee_size = match kind { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drive-by: I really dislike how we track dereferenceable as pointee_size: Size, this should imo really be dereferenceable: Option<NonZeroU64>, or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this entire code could benefit from a large-scale refactor.^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might or might not do something about it ^^"
It looks like the semantics of
dereferenceable(n)on return types is "dereferenceable until the end of the program", which is not sound for how we were using it. See dereferenceable on return type zulip thread.cc @rust-lang/opsem @nikic