rust/tests/ui/error-codes/E0033-teach.rs
2023-01-11 09:32:08 +00:00

15 lines
228 B
Rust

// compile-flags: -Z teach
trait SomeTrait {
fn foo(&self);
}
struct S;
impl SomeTrait for S {
fn foo(&self) {}
}
fn main() {
let trait_obj: &dyn SomeTrait = &S;
let &invalid = trait_obj;
//~^ ERROR E0033
}