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:
Tomasz Miąsko 2021-12-11 00:00:00 +00:00
parent 404c8471ab
commit ffe067cdfc
2 changed files with 43 additions and 49 deletions

View 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);
}