Skip to content

Commit af337e8

Browse files
committed
Add test for issue-76375
1 parent 7d4d64d commit af337e8

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// edition:2018
2+
// compile-flags: -Z mir-opt-level=2 -Z unsound-mir-opts
3+
4+
#[inline(always)]
5+
pub fn f(s: bool) -> String {
6+
let a = "Hello world!".to_string();
7+
let b = a;
8+
let c = b;
9+
if s {
10+
c
11+
} else {
12+
String::new()
13+
}
14+
}

src/test/ui/mir/issue-76375.rs

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// edition:2018
2+
// build-pass
3+
// compile-flags: -Z mir-opt-level=2 -L.
4+
// aux-build:issue_76375_aux.rs
5+
6+
#![crate_type = "lib"]
7+
8+
extern crate issue_76375_aux;
9+
10+
pub async fn g() {
11+
issue_76375_aux::f(true);
12+
h().await;
13+
}
14+
15+
pub async fn h() {}

0 commit comments

Comments
 (0)