]> git.lizzy.rs Git - rust.git/blob - tests/ui/traits/object-does-not-impl-trait.rs
Auto merge of #105716 - chriswailes:ndk-update-redux, r=pietroalbini
[rust.git] / tests / ui / traits / object-does-not-impl-trait.rs
1 // Test that an object type `Box<Foo>` is not considered to implement the
2 // trait `Foo`. Issue #5087.
3
4 trait Foo {}
5 fn take_foo<F:Foo>(f: F) {}
6 fn take_object(f: Box<dyn Foo>) { take_foo(f); }
7 //~^ ERROR `Box<dyn Foo>: Foo` is not satisfied
8 fn main() {}