rust/tests/ui/lint/must_not_suspend/generic.rs

21 lines
330 B
Rust
Raw Normal View History

2021-09-18 14:23:16 -05:00
// edition:2018
2021-09-18 15:00:36 -05:00
// run-pass
//
// this test shows a case where the lint doesn't fire in generic code
2021-09-18 14:23:16 -05:00
#![feature(must_not_suspend)]
#![deny(must_not_suspend)]
#[must_not_suspend]
struct No {}
async fn shushspend() {}
async fn wheeee<T>(t: T) {
shushspend().await;
drop(t);
}
fn main() {
2021-09-18 15:00:36 -05:00
let _fut = wheeee(No {});
2021-09-18 14:23:16 -05:00
}