mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
27 lines
430 B
Rust
27 lines
430 B
Rust
#![feature(decl_macro)]
|
|
|
|
trait Trait {
|
|
fn foo() {}
|
|
}
|
|
|
|
macro trait_impl() {
|
|
fn foo() {}
|
|
}
|
|
|
|
// Check that we error on multiple impl items that resolve to the same trait item.
|
|
impl Trait for i32 {
|
|
trait_impl!();
|
|
fn foo() {}
|
|
//~^ ERROR duplicate definitions with name `foo`: [E0201]
|
|
}
|
|
|
|
struct Type;
|
|
|
|
// Check that we do not error with inherent impls.
|
|
impl Type {
|
|
trait_impl!();
|
|
fn foo() {}
|
|
}
|
|
|
|
fn main() {}
|