From 94a0819fe3a0d679c3042a77bfe6a2afc505daea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:28 +0200 Subject: Adding upstream version 1.66.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/E0017.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/E0094.rs | 2 ++ src/test/ui/error-codes/E0094.stderr | 2 +- 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/E0199.stderr | 6 ++++ src/test/ui/error-codes/E0200.stderr | 6 ++++ src/test/ui/error-codes/E0201.rs | 2 +- src/test/ui/error-codes/E0201.stderr | 33 ++++++++++++--------- 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/E0283.stderr | 4 +-- src/test/ui/error-codes/E0308.rs | 2 ++ src/test/ui/error-codes/E0308.stderr | 2 +- src/test/ui/error-codes/E0311.rs | 9 ++++++ src/test/ui/error-codes/E0311.stderr | 24 ++++++++++++++++ src/test/ui/error-codes/E0388.stderr | 2 +- src/test/ui/error-codes/E0401.stderr | 8 +++--- src/test/ui/error-codes/E0423.stderr | 22 +++++++------- src/test/ui/error-codes/E0520.stderr | 2 +- src/test/ui/error-codes/E0565-2.stderr | 4 ++- src/test/ui/error-codes/E0585.stderr | 2 +- src/test/ui/error-codes/E0771.stderr | 2 +- src/test/ui/error-codes/E0790.stderr | 20 ++++++------- 34 files changed, 204 insertions(+), 85 deletions(-) create mode 100644 src/test/ui/error-codes/E0311.rs create mode 100644 src/test/ui/error-codes/E0311.stderr (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/E0017.stderr b/src/test/ui/error-codes/E0017.stderr index 830e4db34..6e48f9582 100644 --- a/src/test/ui/error-codes/E0017.stderr +++ b/src/test/ui/error-codes/E0017.stderr @@ -4,7 +4,6 @@ warning: taking a mutable reference to a `const` item LL | const CR: &'static mut i32 = &mut C; | ^^^^^^ | - = note: `#[warn(const_item_mutation)]` on by default = note: each usage of a `const` item creates a new temporary = note: the mutable reference will refer to this temporary, not the original `const` item note: `const` item defined here @@ -12,6 +11,7 @@ note: `const` item defined here | LL | const C: i32 = 2; | ^^^^^^^^^^^^ + = note: `#[warn(const_item_mutation)]` on by default error[E0764]: mutable references are not allowed in the final value of constants --> $DIR/E0017.rs:5:30 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/E0094.rs b/src/test/ui/error-codes/E0094.rs index 0d58e5a28..a2ec932c1 100644 --- a/src/test/ui/error-codes/E0094.rs +++ b/src/test/ui/error-codes/E0094.rs @@ -1,5 +1,7 @@ #![feature(intrinsics)] + extern "rust-intrinsic" { + #[rustc_safe_intrinsic] fn size_of() -> usize; //~ ERROR E0094 } diff --git a/src/test/ui/error-codes/E0094.stderr b/src/test/ui/error-codes/E0094.stderr index da97f3a01..531cd4c78 100644 --- a/src/test/ui/error-codes/E0094.stderr +++ b/src/test/ui/error-codes/E0094.stderr @@ -1,5 +1,5 @@ error[E0094]: intrinsic has wrong number of type parameters: found 2, expected 1 - --> $DIR/E0094.rs:3:15 + --> $DIR/E0094.rs:5:15 | LL | fn size_of() -> usize; | ^^^^^^ expected 1 type parameter 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/E0199.stderr b/src/test/ui/error-codes/E0199.stderr index 3632d26cd..99d808c0d 100644 --- a/src/test/ui/error-codes/E0199.stderr +++ b/src/test/ui/error-codes/E0199.stderr @@ -3,6 +3,12 @@ error[E0199]: implementing the trait `Bar` is not unsafe | LL | unsafe impl Bar for Foo { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: remove `unsafe` from this trait implementation + | +LL - unsafe impl Bar for Foo { } +LL + impl Bar for Foo { } + | error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0200.stderr b/src/test/ui/error-codes/E0200.stderr index 677271aad..1fd86aece 100644 --- a/src/test/ui/error-codes/E0200.stderr +++ b/src/test/ui/error-codes/E0200.stderr @@ -3,6 +3,12 @@ error[E0200]: the trait `Bar` requires an `unsafe impl` declaration | LL | impl Bar for Foo { } | ^^^^^^^^^^^^^^^^^^^^ + | + = note: the trait `Bar` enforces invariants that the compiler can't check. Review the trait documentation and make sure this implementation upholds those invariants before adding the `unsafe` keyword +help: add `unsafe` to this trait implementation + | +LL | unsafe impl Bar for Foo { } + | ++++++ error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0201.rs b/src/test/ui/error-codes/E0201.rs index adefd4bcd..04b37091b 100644 --- a/src/test/ui/error-codes/E0201.rs +++ b/src/test/ui/error-codes/E0201.rs @@ -2,7 +2,7 @@ struct Foo(u8); impl Foo { fn bar(&self) -> bool { self.0 > 5 } - fn bar() {} //~ ERROR E0201 + fn bar() {} //~ ERROR E0592 } trait Baz { diff --git a/src/test/ui/error-codes/E0201.stderr b/src/test/ui/error-codes/E0201.stderr index 94e068941..608ff6917 100644 --- a/src/test/ui/error-codes/E0201.stderr +++ b/src/test/ui/error-codes/E0201.stderr @@ -1,28 +1,35 @@ -error[E0201]: duplicate definitions with name `bar`: - --> $DIR/E0201.rs:5:5 - | -LL | fn bar(&self) -> bool { self.0 > 5 } - | --------------------- previous definition of `bar` here -LL | fn bar() {} - | ^^^^^^^^ duplicate definition - error[E0201]: duplicate definitions with name `baz`: --> $DIR/E0201.rs:17:5 | +LL | fn baz(&self) -> bool; + | ---------------------- item in trait +... LL | fn baz(&self) -> bool { true } - | --------------------- previous definition of `baz` here + | ------------------------------ previous definition here LL | fn baz(&self) -> bool { self.0 > 5 } - | ^^^^^^^^^^^^^^^^^^^^^ duplicate definition + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definition error[E0201]: duplicate definitions with name `Quux`: --> $DIR/E0201.rs:18:5 | +LL | type Quux; + | ---------- item in trait +... LL | type Quux = u32; - | --------- previous definition of `Quux` here + | ---------------- previous definition here ... LL | type Quux = u32; - | ^^^^^^^^^ duplicate definition + | ^^^^^^^^^^^^^^^^ duplicate definition + +error[E0592]: duplicate definitions with name `bar` + --> $DIR/E0201.rs:5:5 + | +LL | fn bar(&self) -> bool { self.0 > 5 } + | --------------------- other definition for `bar` +LL | fn bar() {} + | ^^^^^^^^ duplicate definitions for `bar` error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0201`. +Some errors have detailed explanations: E0201, E0592. +For more information about an error, try `rustc --explain E0201`. 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/E0283.stderr b/src/test/ui/error-codes/E0283.stderr index 90a28874e..90316c6e9 100644 --- a/src/test/ui/error-codes/E0283.stderr +++ b/src/test/ui/error-codes/E0283.stderr @@ -9,8 +9,8 @@ LL | let cont: u32 = Generator::create(); | help: use a fully-qualified path to a specific available implementation (2 found) | -LL | let cont: u32 = <::Impl as Generator>::create(); - | ++++++++++ + +LL | let cont: u32 = ::create(); + | ++++++++ + error[E0283]: type annotations needed --> $DIR/E0283.rs:35:24 diff --git a/src/test/ui/error-codes/E0308.rs b/src/test/ui/error-codes/E0308.rs index fa79bee57..dd9e0b284 100644 --- a/src/test/ui/error-codes/E0308.rs +++ b/src/test/ui/error-codes/E0308.rs @@ -1,6 +1,8 @@ #![feature(intrinsics)] +#![feature(rustc_attrs)] extern "rust-intrinsic" { + #[rustc_safe_intrinsic] fn size_of(); //~ ERROR E0308 } diff --git a/src/test/ui/error-codes/E0308.stderr b/src/test/ui/error-codes/E0308.stderr index b71fb95e7..187b775f9 100644 --- a/src/test/ui/error-codes/E0308.stderr +++ b/src/test/ui/error-codes/E0308.stderr @@ -1,5 +1,5 @@ error[E0308]: intrinsic has wrong type - --> $DIR/E0308.rs:4:5 + --> $DIR/E0308.rs:6:5 | LL | fn size_of(); | ^^^^^^^^^^^^^^^^ expected `()`, found `usize` diff --git a/src/test/ui/error-codes/E0311.rs b/src/test/ui/error-codes/E0311.rs new file mode 100644 index 000000000..566b518b4 --- /dev/null +++ b/src/test/ui/error-codes/E0311.rs @@ -0,0 +1,9 @@ +fn no_restriction(x: &()) -> &() { + with_restriction::(x) //~ ERROR E0311 +} + +fn with_restriction<'a, T: 'a>(x: &'a ()) -> &'a () { + x +} + +fn main() {} diff --git a/src/test/ui/error-codes/E0311.stderr b/src/test/ui/error-codes/E0311.stderr new file mode 100644 index 000000000..9873b5ae6 --- /dev/null +++ b/src/test/ui/error-codes/E0311.stderr @@ -0,0 +1,24 @@ +error[E0311]: the parameter type `T` may not live long enough + --> $DIR/E0311.rs:2:5 + | +LL | with_restriction::(x) + | ^^^^^^^^^^^^^^^^^^^^^ + | +note: the parameter type `T` must be valid for the anonymous lifetime defined here... + --> $DIR/E0311.rs:1:25 + | +LL | fn no_restriction(x: &()) -> &() { + | ^^^ +note: ...so that the type `T` will meet its required lifetime bounds + --> $DIR/E0311.rs:2:5 + | +LL | with_restriction::(x) + | ^^^^^^^^^^^^^^^^^^^^^ +help: consider adding an explicit lifetime bound... + | +LL | fn no_restriction<'a, T: 'a>(x: &()) -> &() { + | +++ ++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0311`. diff --git a/src/test/ui/error-codes/E0388.stderr b/src/test/ui/error-codes/E0388.stderr index 106efc19a..b51aa263d 100644 --- a/src/test/ui/error-codes/E0388.stderr +++ b/src/test/ui/error-codes/E0388.stderr @@ -4,7 +4,6 @@ warning: taking a mutable reference to a `const` item LL | const CR: &'static mut i32 = &mut C; | ^^^^^^ | - = note: `#[warn(const_item_mutation)]` on by default = note: each usage of a `const` item creates a new temporary = note: the mutable reference will refer to this temporary, not the original `const` item note: `const` item defined here @@ -12,6 +11,7 @@ note: `const` item defined here | LL | const C: i32 = 2; | ^^^^^^^^^^^^ + = note: `#[warn(const_item_mutation)]` on by default error[E0764]: mutable references are not allowed in the final value of constants --> $DIR/E0388.rs:4:30 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/E0423.rs:14:8 + | +LL | if T {} == T {} { println!("Ok"); } + | ^ not a value + | +help: surround the struct literal with parentheses + | +LL | if (T {}) == T {} { println!("Ok"); } + | + + + error[E0423]: expected function, tuple struct or tuple variant, found struct `Foo` --> $DIR/E0423.rs:4:13 | @@ -47,17 +58,6 @@ help: a function with a similar name exists LL | let f = foo(); | ~~~ -error[E0423]: expected value, found struct `T` - --> $DIR/E0423.rs:14:8 - | -LL | if T {} == T {} { println!("Ok"); } - | ^ not a value - | -help: surround the struct literal with parentheses - | -LL | if (T {}) == T {} { println!("Ok"); } - | + + - error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0423`. diff --git a/src/test/ui/error-codes/E0520.stderr b/src/test/ui/error-codes/E0520.stderr index 65ebfcdbe..12ecead13 100644 --- a/src/test/ui/error-codes/E0520.stderr +++ b/src/test/ui/error-codes/E0520.stderr @@ -4,9 +4,9 @@ warning: the feature `specialization` is incomplete and may not be safe to use a LL | #![feature(specialization)] | ^^^^^^^^^^^^^^ | - = note: `#[warn(incomplete_features)]` on by default = note: see issue #31844 for more information = help: consider using `min_specialization` instead, which is more stable and complete + = note: `#[warn(incomplete_features)]` on by default error[E0520]: `fly` specializes an item from a parent `impl`, but that item is not marked `default` --> $DIR/E0520.rs:17:5 diff --git a/src/test/ui/error-codes/E0565-2.stderr b/src/test/ui/error-codes/E0565-2.stderr index bb30bd7be..097871bd3 100644 --- a/src/test/ui/error-codes/E0565-2.stderr +++ b/src/test/ui/error-codes/E0565-2.stderr @@ -2,7 +2,9 @@ error[E0565]: literal in `deprecated` value must be a string --> $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 diff --git a/src/test/ui/error-codes/E0585.stderr b/src/test/ui/error-codes/E0585.stderr index 7a31c4896..53c82fb41 100644 --- a/src/test/ui/error-codes/E0585.stderr +++ b/src/test/ui/error-codes/E0585.stderr @@ -4,7 +4,7 @@ error[E0585]: found a documentation comment that doesn't document anything LL | /// Hello! I'm useless... | ^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: doc comments must come before what they document, maybe a comment was intended with `//`? + = help: doc comments must come before what they document, if a comment was intended use `//` error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0771.stderr b/src/test/ui/error-codes/E0771.stderr index 3ab727f5f..b759399a9 100644 --- a/src/test/ui/error-codes/E0771.stderr +++ b/src/test/ui/error-codes/E0771.stderr @@ -12,8 +12,8 @@ warning: the feature `adt_const_params` is incomplete and may not be safe to use LL | #![feature(adt_const_params)] | ^^^^^^^^^^^^^^^^ | - = note: `#[warn(incomplete_features)]` on by default = note: see issue #95174 for more information + = note: `#[warn(incomplete_features)]` on by default error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/error-codes/E0790.stderr b/src/test/ui/error-codes/E0790.stderr index 6e173a968..f68c0e7d2 100644 --- a/src/test/ui/error-codes/E0790.stderr +++ b/src/test/ui/error-codes/E0790.stderr @@ -9,8 +9,8 @@ LL | MyTrait::my_fn(); | help: use the fully-qualified path to the only available implementation | -LL | <::inner::MyStruct as MyTrait>::my_fn(); - | +++++++++++++++++++++ + +LL | ::my_fn(); + | ++++++++++++ + error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type --> $DIR/E0790.rs:21:17 @@ -23,8 +23,8 @@ LL | let _ = MyTrait::MY_ASSOC_CONST; | help: use the fully-qualified path to the only available implementation | -LL | let _ = <::inner::MyStruct as MyTrait>::MY_ASSOC_CONST; - | +++++++++++++++++++++ + +LL | let _ = ::MY_ASSOC_CONST; + | ++++++++++++ + error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type --> $DIR/E0790.rs:26:5 @@ -37,8 +37,8 @@ LL | inner::MyTrait::my_fn(); | help: use the fully-qualified path to the only available implementation | -LL | inner::<::inner::MyStruct as MyTrait>::my_fn(); - | +++++++++++++++++++++ + +LL | inner::::my_fn(); + | ++++++++++++ + error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type --> $DIR/E0790.rs:30:13 @@ -51,8 +51,8 @@ LL | let _ = inner::MyTrait::MY_ASSOC_CONST; | help: use the fully-qualified path to the only available implementation | -LL | let _ = inner::<::inner::MyStruct as MyTrait>::MY_ASSOC_CONST; - | +++++++++++++++++++++ + +LL | let _ = inner::::MY_ASSOC_CONST; + | ++++++++++++ + error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type --> $DIR/E0790.rs:50:5 @@ -65,8 +65,8 @@ LL | MyTrait2::my_fn(); | help: use a fully-qualified path to a specific available implementation (2 found) | -LL | <::Impl1 as MyTrait2>::my_fn(); - | +++++++++++ + +LL | ::my_fn(); + | +++++++++ + error: aborting due to 5 previous errors -- cgit v1.2.3