RESOLVING_TO_ITEMS_SHADOWING_SUPERTRAIT_ITEMS

Static RESOLVING_TO_ITEMS_SHADOWING_SUPERTRAIT_ITEMS 

Source
pub static RESOLVING_TO_ITEMS_SHADOWING_SUPERTRAIT_ITEMS: &Lint
Expand description

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

§Example

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

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

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

 struct MyType;
 MyType.hello();

{{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 the call sites.