blob: 81a8f5338ebd5cb64720fb98db9e38319cd783bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// Test that duplicate methods in impls are not allowed
struct Foo;
trait Bar {
fn bar(&self) -> isize;
}
impl Bar for Foo {
fn bar(&self) -> isize {1}
fn bar(&self) -> isize {2} //~ ERROR duplicate definitions
}
fn main() {
println!("{}", Foo.bar());
}
|