Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
359bfa901b9d8eddbed7b88b6716dbb77b7bfb95
rust/tests/ui/mir/mir_const_prop_identity.rs

13 lines
190 B
Rust
Raw Normal View History

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.
2021-12-11 00:00:00 +00:00
// Regression test for issue #91725.
//
[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives
2024-02-16 20:02:50 +00:00
//@ run-pass
//@ compile-flags: -Zmir-opt-level=4
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.
2021-12-11 00:00:00 +00:00
fn main() {
let a = true;
let _ = &a;
let mut b = false;
b |= a;
assert!(b);
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 1896ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API