]> git.lizzy.rs Git - rust.git/blob - tests/ui/associated-item/associated-item-duplicate-names-3.rs
Rollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-Simulacrum
[rust.git] / tests / 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     //~^ ERROR ambiguous associated type
20 }