-
Notifications
You must be signed in to change notification settings - Fork 106
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
Strengthen soundness proof for size_of_val_raw #1574
Conversation
src/macro_util.rs
Outdated
// [1] TODO(#429), | ||
// TODO(https://github.com/rust-lang/unsafe-code-guidelines/issues/465#issuecomment-1782206516): | ||
// Citation for this? |
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.
Is [1] still referenced somewhere after your revision?
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.
Oops, fixed.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1574 +/- ##
=======================================
Coverage 87.70% 87.70%
=======================================
Files 15 15
Lines 5563 5563
=======================================
Hits 4879 4879
Misses 684 684 ☔ View full report in Codecov by Sentry. |
Previously, we needed to rely on the fact that the instance of any valid Rust type with 0 elements has a size (in number of bytes) which is not greater than `isize::MAX`. Providing this as a guarantee turned out to be controversial. [1] This was made possible by rust-lang/rust#126152. [1] rust-lang/unsafe-code-guidelines#465 (comment)
04047d8
to
987c34a
Compare
Can we just use |
A few issues:
Note that |
Previously, we needed to rely on the fact that the instance of any valid Rust type with 0 elements has a size (in number of bytes) which is not greater than
isize::MAX
. Providing this as a guarantee turned out to be controversial. [1]This was made possible by rust-lang/rust#126152.
[1] rust-lang/unsafe-code-guidelines#465 (comment)