-
Couldn't load subscription status.
- Fork 13.9k
Port all viable contracts from verify-rust-std #147148
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: master
Are you sure you want to change the base?
Port all viable contracts from verify-rust-std #147148
Conversation
| } | ||
|
|
||
| #[inline] | ||
| #[allow(unused_parens)] |
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 know it's a draft so feel free to ignore, but I'd really prefer to see that lint bug being fixed first before merging so we don't have add all the allow)
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 believe this is fixed as part of #144438. Not sure exactly what caused the issue in the first place.
This comment has been minimized.
This comment has been minimized.
| #[core::contracts::requires(!self.overflowing_mul(rhs).1)] | ||
| pub const unsafe fn unchecked_mul(self, rhs: Self) -> Self { | ||
| assert_unsafe_precondition!( | ||
| check_language_ub, |
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.
Many contracts are duplicating existing assert_unsafe_precondition!(). How should we handle this duplication?
| + _7 = &_4; | ||
| + _6 = {closure@$SRC_DIR/core/src/num/uint_macros.rs:LL:COL} { 0: copy _7 }; | ||
| + StorageDead(_7); | ||
| + _5 = contract_check_requires::<{closure@core::num::<impl u16>::unchecked_shl::{closure#0}}>(move _6) -> [return: bb1, unwind continue]; |
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.
All these extra checks would slow down debug builds a lot in terms of runtime performance and likely a bit in build times, right? Can we check by how much exactly?
|
☔ The latest upstream changes (presumably #142771) made this pull request unmergeable. Please resolve the merge conflicts. |
fc56734 to
f47406e
Compare
This comment has been minimized.
This comment has been minimized.
f47406e to
fa3bb5c
Compare
Ports over all contracts (other than those for `Alignment`, see the separate PR) that can be expressed using the current, experimental contracts syntax. (Notably, this excludes all contracts that refer to pointer validity.)
Updated via `./x.py test mir-opt --bless --stage 1`.
fa3bb5c to
b38b44c
Compare
Ports over all contracts (other than those for
Alignment, see the separate PR) that can be expressed using the current, experimental contracts syntax. (Notably, this excludes all contracts that refer to pointer validity.)