2015-01-05 02:39:02 +00:00
|
|
|
pub trait Foo { fn foo<T>(&self, ext_thing: &T); }
|
|
|
|
pub trait Bar: Foo { }
|
2014-11-27 16:28:51 +00:00
|
|
|
impl<T: Foo> Bar for T { }
|
|
|
|
|
|
|
|
pub struct Thing;
|
|
|
|
impl Foo for Thing {
|
|
|
|
fn foo<T>(&self, _: &T) {}
|
|
|
|
}
|
|
|
|
|
2015-02-09 15:44:17 +00:00
|
|
|
#[inline(never)]
|
2019-05-28 18:46:13 +00:00
|
|
|
fn foo(b: &dyn Bar) {
|
2015-12-15 09:31:58 +00:00
|
|
|
//~^ ERROR E0038
|
2015-03-03 08:42:26 +00:00
|
|
|
b.foo(&0)
|
2024-02-09 12:17:55 +00:00
|
|
|
//~^ ERROR E0038
|
2015-02-09 15:44:17 +00:00
|
|
|
}
|
2014-11-27 16:28:51 +00:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut thing = Thing;
|
2019-05-28 18:46:13 +00:00
|
|
|
let test: &dyn Bar = &mut thing;
|
2024-02-09 12:17:55 +00:00
|
|
|
//~^ ERROR E0038
|
|
|
|
//~| ERROR E0038
|
2014-11-27 16:28:51 +00:00
|
|
|
foo(test);
|
2024-02-09 12:17:55 +00:00
|
|
|
//~^ ERROR E0038
|
2014-11-27 16:28:51 +00:00
|
|
|
}
|