Skip to content

Commit bdfc688

Browse files
committed
Add drop tracking version of must_not_suspend ref test
1 parent 3924dac commit bdfc688

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// edition:2018
2+
// compile-flags: -Zdrop-tracking
3+
#![feature(must_not_suspend)]
4+
#![deny(must_not_suspend)]
5+
6+
#[must_not_suspend = "You gotta use Umm's, ya know?"]
7+
struct Umm {
8+
i: i64
9+
}
10+
11+
struct Bar {
12+
u: Umm,
13+
}
14+
15+
async fn other() {}
16+
17+
impl Bar {
18+
async fn uhoh(&mut self) {
19+
let guard = &mut self.u; //~ ERROR `Umm` held across
20+
21+
other().await;
22+
23+
*guard = Umm {
24+
i: 2
25+
}
26+
}
27+
}
28+
29+
fn main() {
30+
}

0 commit comments

Comments
 (0)