summaryrefslogtreecommitdiffstats
path: root/src/test/ui/object-safety/issue-19538.rs
blob: 7054ef41b1c829b989a2c20960c80ef15f1f871d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;
    let test: &mut dyn Bar = &mut thing;
    //~^ ERROR E0038
    //~| ERROR E0038
}