-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Closed
Labels
A-trait-systemArea: Trait systemArea: Trait system
Description
Neither of these are able to resolve foo.
trait A { }
impl A {
fn foo() -> int { 10 }
}
impl int: A { }
fn main() {
let x = &0;
let y = x as &A;
y.foo();
}
trait A { }
impl A {
fn foo() -> int { 10 }
}
impl int: A { }
fn f<T: A>(x: &T) {
assert x.foo() == 10;
}
fn main() { }
This pattern is makes semantic sense, though it is odd and possibly useless.
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait system