fe9d07dda6
There is also code for ~Trait and &Trait, but these are currently (incorrectly) synonyms for "as @Trait" and "as &Trait".
16 lines
160 B
Rust
16 lines
160 B
Rust
trait Foo {
|
|
fn foo() {}
|
|
}
|
|
|
|
impl int : Foo {
|
|
fn foo() {
|
|
io::println("Hello world!");
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let x = 3 as @Foo;
|
|
x.foo();
|
|
}
|
|
|