1 #![feature(trivial_bounds)]
3 #![deny(trivial_bounds)]
5 struct A where i32: Copy; //~ ERROR
15 // Check only the bound the user writes trigger the lint
16 fn trivial_elaboration<T>() where T: X<i32> + Z<S = i32>, i32: Y<T> {} // OK
18 fn global_param() where i32: X<()> {} //~ ERROR
20 // Should only error on the trait bound, not the implicit
21 // projection bound <i32 as Z>::S == i32.
22 fn global_projection() where i32: Z<S = i32> {} //~ ERROR
28 // Lifetime bounds should be linted as well
29 fn global_lifetimes() where i32: 'static, &'static str: 'static {}
33 fn local_lifetimes<'a>() where i32: 'a, &'a str: 'a {} // OK
35 fn global_outlives() where 'static: 'static {} //~ ERROR
37 // Check that each bound is checked individually
38 fn mixed_bounds<T: Copy>() where i32: X<T> + Copy {} //~ ERROR