mirror of
https://git.proxmox.com/git/rustc
synced 2025-08-17 11:32:29 +00:00
17 lines
274 B
Rust
17 lines
274 B
Rust
// 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());
|
|
}
|