2014-03-18 10:42:23 -04:00
|
|
|
// Test that duplicate methods in impls are not allowed
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
trait Bar {
|
2015-01-08 21:54:35 +11:00
|
|
|
fn bar(&self) -> isize;
|
2014-03-18 10:42:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Bar for Foo {
|
2015-01-08 21:54:35 +11:00
|
|
|
fn bar(&self) -> isize {1}
|
2016-03-09 08:57:53 -08:00
|
|
|
fn bar(&self) -> isize {2} //~ ERROR duplicate definitions
|
2014-03-18 10:42:23 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!("{}", Foo.bar());
|
|
|
|
}
|