mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
24 lines
429 B
Rust
24 lines
429 B
Rust
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)
|
|
//~^ ERROR E0038
|
|
}
|
|
|
|
fn main() {
|
|
let mut thing = Thing;
|
|
let test: &dyn Bar = &mut thing;
|
|
//~^ ERROR E0038
|
|
//~| ERROR E0038
|
|
foo(test);
|
|
//~^ ERROR E0038
|
|
}
|