rust/tests/ui/dyn-compatibility/mention-correct-dyn-incompatible-trait.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
321 B
Rust
Raw Normal View History

// issue: rust-lang/rust#19538
trait Foo {
fn foo<T>(&self, val: T);
}
trait Bar: Foo { }
pub struct Thing;
impl Foo for Thing {
fn foo<T>(&self, val: T) { }
}
impl Bar for Thing { }
fn main() {
let mut thing = Thing;
2019-05-28 18:46:13 +00:00
let test: &mut dyn Bar = &mut thing;
//~^ ERROR E0038
//~| ERROR E0038
}