2016-02-26 14:01:16 -08:00
|
|
|
// Test that you cannot define items with the same name in overlapping inherent
|
|
|
|
// impl blocks.
|
|
|
|
|
2016-09-15 00:51:46 +03:00
|
|
|
#![allow(unused)]
|
2016-03-17 09:05:24 -07:00
|
|
|
|
2016-02-26 14:01:16 -08:00
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
2017-11-20 13:13:27 +01:00
|
|
|
fn id() {} //~ ERROR duplicate definitions
|
2016-02-26 14:01:16 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn id() {}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Bar<T>(T);
|
|
|
|
|
|
|
|
impl<T> Bar<T> {
|
2017-11-20 13:13:27 +01:00
|
|
|
fn bar(&self) {} //~ ERROR duplicate definitions
|
2016-02-26 14:01:16 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Bar<u32> {
|
|
|
|
fn bar(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Baz<T>(T);
|
|
|
|
|
|
|
|
impl<T: Copy> Baz<T> {
|
2017-11-20 13:13:27 +01:00
|
|
|
fn baz(&self) {} //~ ERROR duplicate definitions
|
2016-02-26 14:01:16 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> Baz<Vec<T>> {
|
|
|
|
fn baz(&self) {}
|
|
|
|
}
|
|
|
|
|
2016-09-15 00:51:46 +03:00
|
|
|
fn main() {}
|