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

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

19 lines
238 B
Rust
Raw Normal View History

2016-05-27 20:06:24 +00:00
trait MyTrait {
fn get(&self) -> usize;
}
impl<T> MyTrait for T {
2016-05-27 20:06:24 +00:00
fn get(&self) -> usize { 0 }
}
struct Foo {
value: usize
}
impl MyTrait for Foo { //~ ERROR E0119
fn get(&self) -> usize { self.value }
}
fn main() {
}