diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:12:43 +0000 |
commit | cf94bdc0742c13e2a0cac864c478b8626b266e1b (patch) | |
tree | 044670aa50cc5e2b4229aa0b6b3df6676730c0a6 /src/test/ui/associated-item | |
parent | Adding debian version 1.65.0+dfsg1-2. (diff) | |
download | rustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.tar.xz rustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.zip |
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/associated-item/associated-item-duplicate-names-2.stderr | 8 | ||||
-rw-r--r-- | src/test/ui/associated-item/associated-item-duplicate-names-3.rs | 1 | ||||
-rw-r--r-- | src/test/ui/associated-item/associated-item-duplicate-names-3.stderr | 18 | ||||
-rw-r--r-- | src/test/ui/associated-item/associated-item-duplicate-names.stderr | 14 | ||||
-rw-r--r-- | src/test/ui/associated-item/impl-duplicate-methods.rs (renamed from src/test/ui/impl-duplicate-methods.rs) | 2 | ||||
-rw-r--r-- | src/test/ui/associated-item/impl-duplicate-methods.stderr | 11 |
6 files changed, 41 insertions, 13 deletions
diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr b/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr index f4efd1312..0b96a6bd7 100644 --- a/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr +++ b/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr @@ -1,11 +1,11 @@ -error[E0201]: duplicate definitions with name `bar`: +error[E0592]: duplicate definitions with name `bar` --> $DIR/associated-item-duplicate-names-2.rs:5:5 | LL | const bar: bool = true; - | --------------- previous definition of `bar` here + | --------------- other definition for `bar` LL | fn bar() {} - | ^^^^^^^^ duplicate definition + | ^^^^^^^^ duplicate definitions for `bar` error: aborting due to previous error -For more information about this error, try `rustc --explain E0201`. +For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-3.rs b/src/test/ui/associated-item/associated-item-duplicate-names-3.rs index 6aa1b483e..3a70a2f94 100644 --- a/src/test/ui/associated-item/associated-item-duplicate-names-3.rs +++ b/src/test/ui/associated-item/associated-item-duplicate-names-3.rs @@ -16,4 +16,5 @@ impl Foo for Baz { fn main() { let x: Baz::Bar = 5; + //~^ ERROR ambiguous associated type } diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr b/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr index 03782f663..bf4bd634c 100644 --- a/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr +++ b/src/test/ui/associated-item/associated-item-duplicate-names-3.stderr @@ -1,11 +1,21 @@ error[E0201]: duplicate definitions with name `Bar`: --> $DIR/associated-item-duplicate-names-3.rs:14:5 | +LL | type Bar; + | --------- item in trait +... LL | type Bar = i16; - | -------- previous definition of `Bar` here + | --------------- previous definition here LL | type Bar = u16; - | ^^^^^^^^ duplicate definition + | ^^^^^^^^^^^^^^^ duplicate definition -error: aborting due to previous error +error[E0223]: ambiguous associated type + --> $DIR/associated-item-duplicate-names-3.rs:18:12 + | +LL | let x: Baz::Bar = 5; + | ^^^^^^^^ help: use fully-qualified syntax: `<Baz as Trait>::Bar` + +error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0201`. +Some errors have detailed explanations: E0201, E0223. +For more information about an error, try `rustc --explain E0201`. diff --git a/src/test/ui/associated-item/associated-item-duplicate-names.stderr b/src/test/ui/associated-item/associated-item-duplicate-names.stderr index c9119c102..f89ea6e57 100644 --- a/src/test/ui/associated-item/associated-item-duplicate-names.stderr +++ b/src/test/ui/associated-item/associated-item-duplicate-names.stderr @@ -1,18 +1,24 @@ error[E0201]: duplicate definitions with name `Ty`: --> $DIR/associated-item-duplicate-names.rs:11:5 | +LL | type Ty; + | -------- item in trait +... LL | type Ty = (); - | ------- previous definition of `Ty` here + | ------------- previous definition here LL | type Ty = usize; - | ^^^^^^^ duplicate definition + | ^^^^^^^^^^^^^^^^ duplicate definition error[E0201]: duplicate definitions with name `BAR`: --> $DIR/associated-item-duplicate-names.rs:13:5 | +LL | const BAR: u32; + | --------------- item in trait +... LL | const BAR: u32 = 7; - | -------------- previous definition of `BAR` here + | ------------------- previous definition here LL | const BAR: u32 = 8; - | ^^^^^^^^^^^^^^ duplicate definition + | ^^^^^^^^^^^^^^^^^^^ duplicate definition error: aborting due to 2 previous errors diff --git a/src/test/ui/impl-duplicate-methods.rs b/src/test/ui/associated-item/impl-duplicate-methods.rs index adb09d7f5..328d54d5a 100644 --- a/src/test/ui/impl-duplicate-methods.rs +++ b/src/test/ui/associated-item/impl-duplicate-methods.rs @@ -3,7 +3,7 @@ struct Foo; impl Foo { fn orange(&self) {} fn orange(&self) {} - //~^ ERROR duplicate definition + //~^ ERROR duplicate definitions with name `orange` [E0592] } fn main() {} diff --git a/src/test/ui/associated-item/impl-duplicate-methods.stderr b/src/test/ui/associated-item/impl-duplicate-methods.stderr new file mode 100644 index 000000000..6f753845a --- /dev/null +++ b/src/test/ui/associated-item/impl-duplicate-methods.stderr @@ -0,0 +1,11 @@ +error[E0592]: duplicate definitions with name `orange` + --> $DIR/impl-duplicate-methods.rs:5:5 + | +LL | fn orange(&self) {} + | ---------------- other definition for `orange` +LL | fn orange(&self) {} + | ^^^^^^^^^^^^^^^^ duplicate definitions for `orange` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0592`. |