1 #![deny(unused_must_use)]
8 trait DecidedlyUnimportant {}
12 impl Critical for Anon {}
13 impl NotSoCritical for Anon {}
14 impl DecidedlyUnimportant for Anon {}
16 fn get_critical() -> impl NotSoCritical + Critical + DecidedlyUnimportant {
20 fn get_boxed_critical() -> Box<dyn Critical> {
24 fn get_nested_boxed_critical() -> Box<Box<dyn Critical>> {
25 Box::new(Box::new(Anon {}))
28 fn get_critical_tuple() -> (u32, Box<dyn Critical>, impl Critical, ()) {
29 (0, get_boxed_critical(), get_critical(), ())
33 get_critical(); //~ ERROR unused implementer of `Critical` that must be used
34 get_boxed_critical(); //~ ERROR unused boxed `Critical` trait object that must be used
35 get_nested_boxed_critical();
36 //~^ ERROR unused boxed boxed `Critical` trait object that must be used
37 get_critical_tuple(); //~ ERROR unused boxed `Critical` trait object in tuple element 1
38 //~^ ERROR unused implementer of `Critical` in tuple element 2