Static SUPERTRAIT_ITEM_SHADOWING_DEFINITION

Source
pub static SUPERTRAIT_ITEM_SHADOWING_DEFINITION: &Lint
Expand description

The supertrait_item_shadowing_definition 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(supertrait_item_shadowing_definition)]

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.