1 // Test that closures and generators are "must use" types.
4 #![feature(async_closure)]
5 #![feature(generators)]
6 #![deny(unused_must_use)]
9 || { //~ ERROR unused closure that must be used
13 async {}; //~ ERROR unused implementer of `Future` that must be used
14 || async {}; //~ ERROR unused closure that must be used
15 async || {}; //~ ERROR unused closure that must be used
18 [Box::new([|| {}; 10]); 1]; //~ ERROR unused array of boxed arrays of closures that must be used
20 vec![|| "a"].pop().unwrap(); //~ ERROR unused closure that must be used
23 || true; //~ ERROR unused closure that must be used