]> git.proxmox.com Git - rustc.git/blob - src/test/ui/lint/must_not_suspend/trait.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / lint / must_not_suspend / trait.rs
1 // edition:2018
2 #![feature(must_not_suspend)]
3 #![deny(must_not_suspend)]
4
5 #[must_not_suspend]
6 trait Wow {}
7
8 impl Wow for i32 {}
9
10 fn r#impl() -> impl Wow {
11 1
12 }
13
14 fn r#dyn() -> Box<dyn Wow> {
15 Box::new(1)
16 }
17
18 async fn other() {}
19
20 pub async fn uhoh() {
21 let _guard1 = r#impl(); //~ ERROR implementer of `Wow` held across
22 let _guard2 = r#dyn(); //~ ERROR boxed `Wow` trait object held across
23
24 other().await;
25 }
26
27 fn main() {
28 }