-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Make lit_to_mir_constant
and lit_to_const
infallible
#135195
Conversation
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
lit_to_mir_constant
infalliblelit_to_mir_constant
and lit_to_const
infallible
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri, @rust-lang/wg-const-eval Some changes occurred in match checking cc @Nadrieril HIR ty lowering was modified cc @fmease Some changes occurred in cc @BoxyUwU |
This comment has been minimized.
This comment has been minimized.
2256627
to
f6146ff
Compare
This comment has been minimized.
This comment has been minimized.
f6146ff
to
eb63fd6
Compare
This comment has been minimized.
This comment has been minimized.
trunc(if neg { (n.get() as i128).overflowing_neg().0 as u128 } else { n.get() }) | ||
} | ||
(ast::LitKind::Float(n, _), ty::Float(fty)) => { | ||
parse_float_into_constval(*n, *fty, neg).unwrap() |
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.
delayed_bug to bug, it's unreachable I guess? 😁 though given we've got no tests for that, I don't mind merging this and reacting to a fuzzer ICE if it's reachable
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.
yea, I looked into this before the holidays and if memory serves right the parser ensures we don't get anything that could fail here.
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.
gamer
r=me after nits
eb63fd6
to
5d0405d
Compare
This comment has been minimized.
This comment has been minimized.
5d0405d
to
c92ed62
Compare
@bors r=lcnr |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#134228 (Exhaustively handle expressions in patterns) - rust-lang#135194 (triagebot: mark tidy changes with a more specific `A-tidy` label) - rust-lang#135222 (Ensure that we don't try to access fields on a non-struct pattern type) - rust-lang#135250 (A couple simple borrowck cleanups) - rust-lang#135252 (Fix release notes link) - rust-lang#135253 (Revert rust-lang#131365) Failed merges: - rust-lang#135195 (Make `lit_to_mir_constant` and `lit_to_const` infallible) r? `@ghost` `@rustbot` modify labels: rollup
Make `lit_to_mir_constant` and `lit_to_const` infallible My motivation for this change is just that it's annoying to check everywhere, especially since all but one call site was just ICEing on errors anyway right there. They can still fail, but now just return an error constant instead of having the caller handle the error. fixes rust-lang#114317 fixes rust-lang#126182
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#134228 (Exhaustively handle expressions in patterns) - rust-lang#135194 (triagebot: mark tidy changes with a more specific `A-tidy` label) - rust-lang#135222 (Ensure that we don't try to access fields on a non-struct pattern type) - rust-lang#135250 (A couple simple borrowck cleanups) - rust-lang#135252 (Fix release notes link) - rust-lang#135253 (Revert rust-lang#131365) Failed merges: - rust-lang#135195 (Make `lit_to_mir_constant` and `lit_to_const` infallible) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#128110 (Suggest Replacing Comma with Semicolon in Incorrect Repeat Expressions) - rust-lang#134609 (Add new `{x86_64,i686}-win7-windows-gnu` targets) - rust-lang#134875 (Implement `const Destruct` in old solver) - rust-lang#135221 (Include rustc and rustdoc book in replace-version-placeholder) - rust-lang#135231 (bootstrap: Add more comments to some of the test steps) - rust-lang#135256 (Move `mod cargo` below the import statements) Failed merges: - rust-lang#135195 (Make `lit_to_mir_constant` and `lit_to_const` infallible) r? `@ghost` `@rustbot` modify labels: rollup
@bors r- |
c92ed62
to
84c8d4f
Compare
@bors r=lcnr |
…iaskrgr Rollup of 3 pull requests Successful merges: - rust-lang#134898 (Make it easier to run CI jobs locally) - rust-lang#135195 (Make `lit_to_mir_constant` and `lit_to_const` infallible) - rust-lang#135261 (Account for identity substituted items in symbol mangling) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 3 pull requests Successful merges: - rust-lang#134898 (Make it easier to run CI jobs locally) - rust-lang#135195 (Make `lit_to_mir_constant` and `lit_to_const` infallible) - rust-lang#135261 (Account for identity substituted items in symbol mangling) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#135195 - oli-obk:push-toyoyrupruko, r=lcnr Make `lit_to_mir_constant` and `lit_to_const` infallible My motivation for this change is just that it's annoying to check everywhere, especially since all but one call site was just ICEing on errors anyway right there. They can still fail, but now just return an error constant instead of having the caller handle the error. fixes rust-lang#114317 fixes rust-lang#126182
My motivation for this change is just that it's annoying to check everywhere, especially since all but one call site was just ICEing on errors anyway right there.
They can still fail, but now just return an error constant instead of having the caller handle the error.
fixes #114317
fixes #126182