mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-15 08:18:44 +00:00
14 lines
201 B
Rust
14 lines
201 B
Rust
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
|
|
}
|