about summary refs log tree commit diff
path: root/tests/ui/traits/trait-upcasting/deref-upcast-shadowing-lint.rs
blob: ab84527edcff9ebe004996f78833887df7e07179 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ check-pass
#![warn(deref_into_dyn_supertrait)]
use std::ops::Deref;

trait Bar<T> {}
trait Foo: Bar<i32> {}

impl<'a> Deref for dyn Foo + 'a {
    //~^ warn: this `Deref` implementation is covered by an implicit supertrait coercion
    type Target = dyn Bar<u32> + 'a;

    fn deref(&self) -> &Self::Target {
        todo!()
    }
}

fn main() {}