summaryrefslogtreecommitdiffstats
path: root/src/test/ui/hygiene/impl_items-2.rs
blob: 465e444aedb6b32ef4adec7bc976f7b570819461 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#![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() {}