From 17d40c6057c88f4c432b0d7bac88e1b84cb7e67f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:03:36 +0200 Subject: Adding upstream version 1.65.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/error-codes/E0004.stderr | 6 ++-- src/test/ui/error-codes/E0005.stderr | 2 +- src/test/ui/error-codes/E0057.stderr | 4 +-- src/test/ui/error-codes/E0060.stderr | 2 +- src/test/ui/error-codes/E0061.stderr | 4 +-- src/test/ui/error-codes/E0081.rs | 37 +++++++++++++++++++----- src/test/ui/error-codes/E0081.stderr | 52 ++++++++++++++++++++++++++++------ src/test/ui/error-codes/E0107.stderr | 2 +- src/test/ui/error-codes/E0117.rs | 2 +- src/test/ui/error-codes/E0117.stderr | 4 +-- src/test/ui/error-codes/E0120.stderr | 4 +-- src/test/ui/error-codes/E0271.stderr | 6 ++-- src/test/ui/error-codes/E0275.stderr | 4 +-- src/test/ui/error-codes/E0277-2.stderr | 4 +-- src/test/ui/error-codes/E0401.stderr | 8 +++--- src/test/ui/error-codes/E0565-2.stderr | 4 ++- 16 files changed, 104 insertions(+), 41 deletions(-) (limited to 'src/test/ui/error-codes') diff --git a/src/test/ui/error-codes/E0004.stderr b/src/test/ui/error-codes/E0004.stderr index 8ba151d9e..4ac8c904f 100644 --- a/src/test/ui/error-codes/E0004.stderr +++ b/src/test/ui/error-codes/E0004.stderr @@ -1,8 +1,8 @@ -error[E0004]: non-exhaustive patterns: `HastaLaVistaBaby` not covered +error[E0004]: non-exhaustive patterns: `Terminator::HastaLaVistaBaby` not covered --> $DIR/E0004.rs:9:11 | LL | match x { - | ^ pattern `HastaLaVistaBaby` not covered + | ^ pattern `Terminator::HastaLaVistaBaby` not covered | note: `Terminator` defined here --> $DIR/E0004.rs:2:5 @@ -15,7 +15,7 @@ LL | HastaLaVistaBaby, help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern or an explicit pattern as shown | LL ~ Terminator::TalkToMyHand => {} -LL + HastaLaVistaBaby => todo!() +LL + Terminator::HastaLaVistaBaby => todo!() | error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0005.stderr b/src/test/ui/error-codes/E0005.stderr index f01a77bd3..de8e6bac4 100644 --- a/src/test/ui/error-codes/E0005.stderr +++ b/src/test/ui/error-codes/E0005.stderr @@ -19,7 +19,7 @@ help: you might want to use `if let` to ignore the variant that isn't matched | LL | let y = if let Some(y) = x { y } else { todo!() }; | ++++++++++ ++++++++++++++++++++++ -help: alternatively, on nightly, you might want to use `#![feature(let_else)]` to handle the variant that isn't matched +help: alternatively, you might want to use let else to handle the variant that isn't matched | LL | let Some(y) = x else { todo!() }; | ++++++++++++++++ diff --git a/src/test/ui/error-codes/E0057.stderr b/src/test/ui/error-codes/E0057.stderr index 2307f52c9..bea226f09 100644 --- a/src/test/ui/error-codes/E0057.stderr +++ b/src/test/ui/error-codes/E0057.stderr @@ -12,7 +12,7 @@ LL | let f = |x| x * 3; help: provide the argument | LL | let a = f(/* value */); - | ~~~~~~~~~~~~~~ + | ~~~~~~~~~~~~~ error[E0057]: this function takes 1 argument but 2 arguments were supplied --> $DIR/E0057.rs:5:13 @@ -28,7 +28,7 @@ LL | let f = |x| x * 3; help: remove the extra argument | LL | let c = f(2); - | ~~~~ + | ~~~ error: aborting due to 2 previous errors diff --git a/src/test/ui/error-codes/E0060.stderr b/src/test/ui/error-codes/E0060.stderr index 644fd5983..934a18d89 100644 --- a/src/test/ui/error-codes/E0060.stderr +++ b/src/test/ui/error-codes/E0060.stderr @@ -12,7 +12,7 @@ LL | fn printf(_: *const u8, ...) -> u32; help: provide the argument | LL | unsafe { printf(/* *const u8 */); } - | ~~~~~~~~~~~~~~~~~~~~~~~ + | ~~~~~~~~~~~~~~~~~ error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0061.stderr b/src/test/ui/error-codes/E0061.stderr index fa55db092..fa4ccbe66 100644 --- a/src/test/ui/error-codes/E0061.stderr +++ b/src/test/ui/error-codes/E0061.stderr @@ -12,7 +12,7 @@ LL | fn f(a: u16, b: &str) {} help: provide the argument | LL | f(0, /* &str */); - | ~~~~~~~~~~~~~~~~ + | ~~~~~~~~~~~~~~~ error[E0061]: this function takes 1 argument but 0 arguments were supplied --> $DIR/E0061.rs:9:5 @@ -28,7 +28,7 @@ LL | fn f2(a: u16) {} help: provide the argument | LL | f2(/* u16 */); - | ~~~~~~~~~~~~~ + | ~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/src/test/ui/error-codes/E0081.rs b/src/test/ui/error-codes/E0081.rs index 5aa6a7863..f53fda864 100644 --- a/src/test/ui/error-codes/E0081.rs +++ b/src/test/ui/error-codes/E0081.rs @@ -1,9 +1,9 @@ enum Enum { //~^ ERROR discriminant value `3` assigned more than once P = 3, - //~^ NOTE first assignment of `3` + //~^ NOTE `3` assigned here X = 3, - //~^ NOTE second assignment of `3` + //~^ NOTE `3` assigned here Y = 5 } @@ -11,20 +11,43 @@ enum Enum { enum EnumOverflowRepr { //~^ ERROR discriminant value `1` assigned more than once P = 257, - //~^ NOTE first assignment of `1` (overflowed from `257`) + //~^ NOTE `1` (overflowed from `257`) assigned here X = 513, - //~^ NOTE second assignment of `1` (overflowed from `513`) + //~^ NOTE `1` (overflowed from `513`) assigned here } #[repr(i8)] enum NegDisEnum { //~^ ERROR discriminant value `-1` assigned more than once First = -1, - //~^ NOTE first assignment of `-1` + //~^ NOTE `-1` assigned here Second = -2, - //~^ NOTE assigned discriminant for `Last` was incremented from this discriminant + //~^ NOTE discriminant for `Last` incremented from this startpoint (`Second` + 1 variant later => `Last` = -1) Last, - //~^ NOTE second assignment of `-1` + //~^ NOTE `-1` assigned here +} + +enum MultipleDuplicates { + //~^ ERROR discriminant value `0` assigned more than once + //~^^ ERROR discriminant value `-2` assigned more than once + V0, + //~^ NOTE `0` assigned here + V1 = 0, + //~^ NOTE `0` assigned here + V2, + V3, + V4 = 0, + //~^ NOTE `0` assigned here + V5 = -2, + //~^ NOTE discriminant for `V7` incremented from this startpoint (`V5` + 2 variants later => `V7` = 0) + //~^^ NOTE `-2` assigned here + V6, + V7, + //~^ NOTE `0` assigned here + V8 = -3, + //~^ NOTE discriminant for `V9` incremented from this startpoint (`V8` + 1 variant later => `V9` = -2) + V9, + //~^ NOTE `-2` assigned here } fn main() { diff --git a/src/test/ui/error-codes/E0081.stderr b/src/test/ui/error-codes/E0081.stderr index ff6113646..64562fefc 100644 --- a/src/test/ui/error-codes/E0081.stderr +++ b/src/test/ui/error-codes/E0081.stderr @@ -5,10 +5,10 @@ LL | enum Enum { | ^^^^^^^^^ LL | LL | P = 3, - | - first assignment of `3` + | - `3` assigned here LL | LL | X = 3, - | - second assignment of `3` + | - `3` assigned here error[E0081]: discriminant value `1` assigned more than once --> $DIR/E0081.rs:11:1 @@ -17,10 +17,10 @@ LL | enum EnumOverflowRepr { | ^^^^^^^^^^^^^^^^^^^^^ LL | LL | P = 257, - | --- first assignment of `1` (overflowed from `257`) + | --- `1` (overflowed from `257`) assigned here LL | LL | X = 513, - | --- second assignment of `1` (overflowed from `513`) + | --- `1` (overflowed from `513`) assigned here error[E0081]: discriminant value `-1` assigned more than once --> $DIR/E0081.rs:20:1 @@ -29,14 +29,50 @@ LL | enum NegDisEnum { | ^^^^^^^^^^^^^^^ LL | LL | First = -1, - | -- first assignment of `-1` + | -- `-1` assigned here LL | LL | Second = -2, - | ----------- assigned discriminant for `Last` was incremented from this discriminant + | ----------- discriminant for `Last` incremented from this startpoint (`Second` + 1 variant later => `Last` = -1) LL | LL | Last, - | ---- second assignment of `-1` + | ---- `-1` assigned here -error: aborting due to 3 previous errors +error[E0081]: discriminant value `0` assigned more than once + --> $DIR/E0081.rs:30:1 + | +LL | enum MultipleDuplicates { + | ^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | V0, + | -- `0` assigned here +LL | +LL | V1 = 0, + | - `0` assigned here +... +LL | V4 = 0, + | - `0` assigned here +LL | +LL | V5 = -2, + | ------- discriminant for `V7` incremented from this startpoint (`V5` + 2 variants later => `V7` = 0) +... +LL | V7, + | -- `0` assigned here + +error[E0081]: discriminant value `-2` assigned more than once + --> $DIR/E0081.rs:30:1 + | +LL | enum MultipleDuplicates { + | ^^^^^^^^^^^^^^^^^^^^^^^ +... +LL | V5 = -2, + | -- `-2` assigned here +... +LL | V8 = -3, + | ------- discriminant for `V9` incremented from this startpoint (`V8` + 1 variant later => `V9` = -2) +LL | +LL | V9, + | -- `-2` assigned here + +error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0081`. diff --git a/src/test/ui/error-codes/E0107.stderr b/src/test/ui/error-codes/E0107.stderr index 5ca03b45d..03430f8fa 100644 --- a/src/test/ui/error-codes/E0107.stderr +++ b/src/test/ui/error-codes/E0107.stderr @@ -142,7 +142,7 @@ LL | pub trait T { help: replace the generic bounds with the associated types | LL | fn trait_bound_generic>(_i: I) { - | ~~~~~~ ~~~~~~~ + | +++ +++ error: aborting due to 10 previous errors diff --git a/src/test/ui/error-codes/E0117.rs b/src/test/ui/error-codes/E0117.rs index 22b486573..406d24e36 100644 --- a/src/test/ui/error-codes/E0117.rs +++ b/src/test/ui/error-codes/E0117.rs @@ -1,4 +1,4 @@ impl Drop for u32 {} //~ ERROR E0117 -//~| ERROR the `Drop` trait may only be implemented for structs, enums, and unions +//~| ERROR the `Drop` trait may only be implemented for local structs, enums, and unions fn main() {} diff --git a/src/test/ui/error-codes/E0117.stderr b/src/test/ui/error-codes/E0117.stderr index 76d9f5cc0..f144aa9f7 100644 --- a/src/test/ui/error-codes/E0117.stderr +++ b/src/test/ui/error-codes/E0117.stderr @@ -9,11 +9,11 @@ LL | impl Drop for u32 {} | = note: define and implement a trait or new type instead -error[E0120]: the `Drop` trait may only be implemented for structs, enums, and unions +error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions --> $DIR/E0117.rs:1:15 | LL | impl Drop for u32 {} - | ^^^ must be a struct, enum, or union + | ^^^ must be a struct, enum, or union in the current crate error: aborting due to 2 previous errors diff --git a/src/test/ui/error-codes/E0120.stderr b/src/test/ui/error-codes/E0120.stderr index 6c306455e..75778f1f9 100644 --- a/src/test/ui/error-codes/E0120.stderr +++ b/src/test/ui/error-codes/E0120.stderr @@ -1,8 +1,8 @@ -error[E0120]: the `Drop` trait may only be implemented for structs, enums, and unions +error[E0120]: the `Drop` trait may only be implemented for local structs, enums, and unions --> $DIR/E0120.rs:3:15 | LL | impl Drop for dyn MyTrait { - | ^^^^^^^^^^^ must be a struct, enum, or union + | ^^^^^^^^^^^ must be a struct, enum, or union in the current crate error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0271.stderr b/src/test/ui/error-codes/E0271.stderr index 9c9c7237d..1e2f43834 100644 --- a/src/test/ui/error-codes/E0271.stderr +++ b/src/test/ui/error-codes/E0271.stderr @@ -1,8 +1,10 @@ error[E0271]: type mismatch resolving `::AssociatedType == u32` - --> $DIR/E0271.rs:10:5 + --> $DIR/E0271.rs:10:9 | LL | foo(3_i8); - | ^^^ type mismatch resolving `::AssociatedType == u32` + | --- ^^^^ type mismatch resolving `::AssociatedType == u32` + | | + | required by a bound introduced by this call | note: expected this to be `u32` --> $DIR/E0271.rs:7:43 diff --git a/src/test/ui/error-codes/E0275.stderr b/src/test/ui/error-codes/E0275.stderr index dfffbb182..87cfaa489 100644 --- a/src/test/ui/error-codes/E0275.stderr +++ b/src/test/ui/error-codes/E0275.stderr @@ -5,13 +5,13 @@ LL | impl Foo for T where Bar: Foo {} | ^^^ | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`E0275`) -note: required because of the requirements on the impl of `Foo` for `Bar>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` +note: required for `Bar>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` to implement `Foo` --> $DIR/E0275.rs:5:9 | LL | impl Foo for T where Bar: Foo {} | ^^^ ^ = note: 127 redundant requirements hidden - = note: required because of the requirements on the impl of `Foo` for `Bar` + = note: required for `Bar` to implement `Foo` error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0277-2.stderr b/src/test/ui/error-codes/E0277-2.stderr index ca2cb8842..a2abf3793 100644 --- a/src/test/ui/error-codes/E0277-2.stderr +++ b/src/test/ui/error-codes/E0277-2.stderr @@ -1,8 +1,8 @@ error[E0277]: `*const u8` cannot be sent between threads safely - --> $DIR/E0277-2.rs:16:5 + --> $DIR/E0277-2.rs:16:15 | LL | is_send::(); - | ^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely + | ^^^ `*const u8` cannot be sent between threads safely | = help: within `Foo`, the trait `Send` is not implemented for `*const u8` note: required because it appears within the type `Baz` diff --git a/src/test/ui/error-codes/E0401.stderr b/src/test/ui/error-codes/E0401.stderr index 81715621d..b0e2ef5b6 100644 --- a/src/test/ui/error-codes/E0401.stderr +++ b/src/test/ui/error-codes/E0401.stderr @@ -4,9 +4,9 @@ error[E0401]: can't use generic parameters from outer function LL | fn foo(x: T) { | - type parameter from outer function LL | fn bfnr, W: Fn()>(y: T) { - | --------------------------- ^ use of generic parameter from outer function - | | - | help: try using a local generic parameter instead: `bfnr, W: Fn(), T>` + | - ^ use of generic parameter from outer function + | | + | help: try using a local generic parameter instead: `T,` error[E0401]: can't use generic parameters from outer function --> $DIR/E0401.rs:9:16 @@ -15,7 +15,7 @@ LL | fn foo(x: T) { | - type parameter from outer function ... LL | fn baz $DIR/E0565-2.rs:2:22 | LL | #[deprecated(since = b"1.29", note = "hi")] - | ^^^^^^^ help: consider removing the prefix: `"1.29"` + | -^^^^^^ + | | + | help: consider removing the prefix error: aborting due to previous error -- cgit v1.2.3