SHADOWING_SUPERTRAIT_ITEMS

Static SHADOWING_SUPERTRAIT_ITEMS 

Source
pub static SHADOWING_SUPERTRAIT_ITEMS: &Lint
Expand description

The shadowing_supertrait_items lint detects when the definition of an item that is provided by both a subtrait and supertrait is shadowed, preferring the subtrait.

§Example

 #![feature(supertrait_item_shadowing)]
 #![deny(shadowing_supertrait_items)]

 trait Upstream {
     fn hello(&self) {}
 }
 impl<T> Upstream for T {}

 trait Downstream: Upstream {
     fn hello(&self) {}
 }
 impl<T> Downstream for T {}

{{produces}}

§Explanation

RFC 3624 specified a heuristic in which a supertrait item would be shadowed by a subtrait item when ambiguity occurs during item selection. In order to mitigate side-effects of this happening silently, this lint detects these cases when users want to deny them or fix their trait definitions.