mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Add test for issue-76375
This commit is contained in:
parent
7d4d64d69f
commit
af337e87e2
14
src/test/ui/mir/auxiliary/issue_76375_aux.rs
Normal file
14
src/test/ui/mir/auxiliary/issue_76375_aux.rs
Normal file
@ -0,0 +1,14 @@
|
||||
// edition:2018
|
||||
// compile-flags: -Z mir-opt-level=2 -Z unsound-mir-opts
|
||||
|
||||
#[inline(always)]
|
||||
pub fn f(s: bool) -> String {
|
||||
let a = "Hello world!".to_string();
|
||||
let b = a;
|
||||
let c = b;
|
||||
if s {
|
||||
c
|
||||
} else {
|
||||
String::new()
|
||||
}
|
||||
}
|
15
src/test/ui/mir/issue-76375.rs
Normal file
15
src/test/ui/mir/issue-76375.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// edition:2018
|
||||
// build-pass
|
||||
// compile-flags: -Z mir-opt-level=2 -L.
|
||||
// aux-build:issue_76375_aux.rs
|
||||
|
||||
#![crate_type = "lib"]
|
||||
|
||||
extern crate issue_76375_aux;
|
||||
|
||||
pub async fn g() {
|
||||
issue_76375_aux::f(true);
|
||||
h().await;
|
||||
}
|
||||
|
||||
pub async fn h() {}
|
Loading…
Reference in New Issue
Block a user