blob: 415fe818f530864cf012127b072ec5c59f8da18e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
pub trait Foo { fn foo<T>(&self, ext_thing: &T); }
pub trait Bar: Foo { }
impl<T: Foo> Bar for T { }
pub struct Thing;
impl Foo for Thing {
fn foo<T>(&self, _: &T) {}
}
#[inline(never)]
fn foo(b: &dyn Bar) {
//~^ ERROR E0038
b.foo(&0)
}
fn main() {
let mut thing = Thing;
let test: &dyn Bar = &mut thing;
//~^ ERROR E0038
foo(test);
//~^ ERROR E0038
}
|