]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-item/associated-item-duplicate-names-3.rs
Merge commit '8da837185714cefbb261e93e9846afb11c1dc60e' into sync-rustfmt-subtree
[rust.git] / src / test / ui / associated-item / associated-item-duplicate-names-3.rs
1 //
2 // Before the introduction of the "duplicate associated type" error, the
3 // program below used to result in the "ambiguous associated type" error E0223,
4 // which is unexpected.
5
6 trait Foo {
7     type Bar;
8 }
9
10 struct Baz;
11
12 impl Foo for Baz {
13     type Bar = i16;
14     type Bar = u16; //~ ERROR duplicate definitions
15 }
16
17 fn main() {
18     let x: Baz::Bar = 5;
19 }