rust/tests/ui/error-codes/E0033.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
201 B
Rust
Raw Normal View History

2016-05-17 13:01:31 +00:00
trait SomeTrait {
fn foo(&self);
}
struct S;
impl SomeTrait for S {
fn foo(&self) {}
2016-05-17 13:01:31 +00:00
}
fn main() {
let trait_obj: &dyn SomeTrait = &S;
2016-08-08 20:37:44 +00:00
let &invalid = trait_obj;
//~^ ERROR E0033
2016-05-17 13:01:31 +00:00
}