]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lint/must_not_suspend/ref.rs
89fd73c187e901fc7f4645cb70c2648186f66230
[rust.git] / src / test / ui / lint / must_not_suspend / ref.rs
1 // edition:2018
2 #![feature(must_not_suspend)]
3 #![deny(must_not_suspend)]
4
5 #[must_not_suspend = "You gotta use Umm's, ya know?"]
6 struct Umm {
7     i: i64
8 }
9
10 struct Bar {
11     u: Umm,
12 }
13
14 async fn other() {}
15
16 impl Bar {
17     async fn uhoh(&mut self) {
18         let guard = &mut self.u; //~ ERROR `Umm` held across
19         //~^ ERROR `Umm` held across
20
21         other().await;
22
23         *guard = Umm {
24             i: 2
25         }
26     }
27 }
28
29 fn main() {
30 }