static TRIVIAL_BOUNDS: &Lint
trivial_bounds lint detects trait bounds that don’t depend on
any type parameters.
#![feature(trivial_bounds)] pub struct A where i32: Copy;
Usually you would not write a trait bound that you know is always
true, or never true. However, when using macros, the macro may not
know whether or not the constraint would hold or not at the time when
generating the code. Currently, the compiler does not alert you if the
constraint is always true, and generates an error if it is never true.
trivial_bounds feature changes this to be a warning in both
cases, giving macros more freedom and flexibility to generate code,
while still providing a signal when writing non-macro code that
something is amiss.