Return an error when eval_rvalue_with_identities fails
Previously some code paths would fail to evaluate the rvalue, while incorrectly indicating success with `Ok`. As a result the previous value of lhs could have been incorrectly const propagated.
This commit is contained in:
parent
404c8471ab
commit
ffe067cdfc
2 changed files with 43 additions and 49 deletions
12
src/test/ui/mir/mir_const_prop_identity.rs
Normal file
12
src/test/ui/mir/mir_const_prop_identity.rs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
// Regression test for issue #91725.
|
||||
//
|
||||
// run-pass
|
||||
// compile-flags: -Zmir-opt-level=4
|
||||
|
||||
fn main() {
|
||||
let a = true;
|
||||
let _ = &a;
|
||||
let mut b = false;
|
||||
b |= a;
|
||||
assert!(b);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue