]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/impl-object-overlap-issue-23853.rs
:arrow_up: rust-analyzer
[rust.git] / src / test / ui / traits / impl-object-overlap-issue-23853.rs
1 // run-pass
2 // Test that we are able to compile the case where both a blanket impl
3 // and the object type itself supply the required trait obligation.
4 // In this case, the blanket impl for `Foo` applies to any type,
5 // including `Bar`, but the object type `Bar` also implicitly supplies
6 // this context.
7
8 trait Foo { fn dummy(&self) { } }
9
10 trait Bar: Foo { }
11
12 impl<T:?Sized> Foo for T { }
13
14 fn want_foo<B:?Sized+Foo>() { }
15
16 fn main() {
17     want_foo::<dyn Bar>();
18 }