]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
9346a6ac AL |
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 | ||
c34b1796 | 16 | fn main() { |
dc9dc135 | 17 | want_foo::<dyn Bar>(); |
223e47cc | 18 | } |