mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
15 lines
229 B
Rust
15 lines
229 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
|
|
}
|