diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs index e580910af7799..d4b5b6ee85c4b 100644 --- a/compiler/rustc_errors/src/diagnostic.rs +++ b/compiler/rustc_errors/src/diagnostic.rs @@ -974,7 +974,7 @@ impl<'a, G: EmissionGuarantee> Diag<'a, G> { msg, suggestion, applicability, - SuggestionStyle::ShowCode, + SuggestionStyle::ShowAlways, ); self } } diff --git a/tests/ui/argument-suggestions/issue-100154.stderr b/tests/ui/argument-suggestions/issue-100154.stderr index 966f56e2a1562..1496d994ef355 100644 --- a/tests/ui/argument-suggestions/issue-100154.stderr +++ b/tests/ui/argument-suggestions/issue-100154.stderr @@ -2,9 +2,7 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/issue-100154.rs:4:5 | LL | foo::<()>(()); - | ^^^------ help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: function defined here, with 0 generic parameters --> $DIR/issue-100154.rs:1:4 @@ -12,6 +10,11 @@ note: function defined here, with 0 generic parameters LL | fn foo(i: impl std::fmt::Display) {} | ^^^ = note: `impl Trait` cannot be explicitly specified as a generic argument +help: remove these generics + | +LL - foo::<()>(()); +LL + foo(()); + | error[E0277]: `()` doesn't implement `std::fmt::Display` --> $DIR/issue-100154.rs:4:11 diff --git a/tests/ui/argument-suggestions/issue-109831.stderr b/tests/ui/argument-suggestions/issue-109831.stderr index 7b9a3c9ef2c6c..1e90a524011f1 100644 --- a/tests/ui/argument-suggestions/issue-109831.stderr +++ b/tests/ui/argument-suggestions/issue-109831.stderr @@ -23,7 +23,12 @@ LL | struct A; | --------- similarly named unit struct `A` defined here ... LL | f(A, A, B, C); - | ^ help: a unit struct with a similar name exists: `A` + | ^ + | +help: a unit struct with a similar name exists + | +LL | f(A, A, B, A); + | ~ error[E0061]: this function takes 3 arguments but 4 arguments were supplied --> $DIR/issue-109831.rs:7:5 diff --git a/tests/ui/array-slice-vec/suggest-array-length.stderr b/tests/ui/array-slice-vec/suggest-array-length.stderr index fdab7ba7064e4..6a22b94d3a5d5 100644 --- a/tests/ui/array-slice-vec/suggest-array-length.stderr +++ b/tests/ui/array-slice-vec/suggest-array-length.stderr @@ -44,71 +44,99 @@ error[E0658]: using `_` for array lengths is unstable --> $DIR/suggest-array-length.rs:5:22 | LL | const Foo: [i32; _] = [1, 2, 3]; - | ^ help: consider specifying the array length: `3` + | ^ | = note: see issue #85077 for more information = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: consider specifying the array length + | +LL | const Foo: [i32; 3] = [1, 2, 3]; + | ~ error[E0658]: using `_` for array lengths is unstable --> $DIR/suggest-array-length.rs:8:26 | LL | const REF_FOO: &[u8; _] = &[1]; - | ^ help: consider specifying the array length: `1` + | ^ | = note: see issue #85077 for more information = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: consider specifying the array length + | +LL | const REF_FOO: &[u8; 1] = &[1]; + | ~ error[E0658]: using `_` for array lengths is unstable --> $DIR/suggest-array-length.rs:11:20 | LL | let foo: [i32; _] = [1, 2, 3]; - | ^ help: consider specifying the array length: `3` + | ^ | = note: see issue #85077 for more information = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: consider specifying the array length + | +LL | let foo: [i32; 3] = [1, 2, 3]; + | ~ error[E0658]: using `_` for array lengths is unstable --> $DIR/suggest-array-length.rs:14:20 | LL | let bar: [i32; _] = [0; 3]; - | ^ help: consider specifying the array length: `3` + | ^ | = note: see issue #85077 for more information = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: consider specifying the array length + | +LL | let bar: [i32; 3] = [0; 3]; + | ~ error[E0658]: using `_` for array lengths is unstable --> $DIR/suggest-array-length.rs:17:25 | LL | let ref_foo: &[i32; _] = &[1, 2, 3]; - | ^ help: consider specifying the array length: `3` + | ^ | = note: see issue #85077 for more information = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: consider specifying the array length + | +LL | let ref_foo: &[i32; 3] = &[1, 2, 3]; + | ~ error[E0658]: using `_` for array lengths is unstable --> $DIR/suggest-array-length.rs:20:25 | LL | let ref_bar: &[i32; _] = &[0; 3]; - | ^ help: consider specifying the array length: `3` + | ^ | = note: see issue #85077 for more information = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: consider specifying the array length + | +LL | let ref_bar: &[i32; 3] = &[0; 3]; + | ~ error[E0658]: using `_` for array lengths is unstable --> $DIR/suggest-array-length.rs:23:35 | LL | let multiple_ref_foo: &&[i32; _] = &&[1, 2, 3]; - | ^ help: consider specifying the array length: `3` + | ^ | = note: see issue #85077 for more information = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: consider specifying the array length + | +LL | let multiple_ref_foo: &&[i32; 3] = &&[1, 2, 3]; + | ~ error: aborting due to 14 previous errors diff --git a/tests/ui/assign-imm-local-twice.stderr b/tests/ui/assign-imm-local-twice.stderr index d92485de68fe7..5f642c927a544 100644 --- a/tests/ui/assign-imm-local-twice.stderr +++ b/tests/ui/assign-imm-local-twice.stderr @@ -1,14 +1,16 @@ error[E0384]: cannot assign twice to immutable variable `v` --> $DIR/assign-imm-local-twice.rs:7:5 | -LL | let v: isize; - | - help: consider making this binding mutable: `mut v` -... LL | v = 1; | ----- first assignment to `v` LL | println!("v={}", v); LL | v = 2; | ^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut v: isize; + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/associated-item/issue-87638.stderr b/tests/ui/associated-item/issue-87638.stderr index cf6083444b0e6..f2e5eda67c827 100644 --- a/tests/ui/associated-item/issue-87638.stderr +++ b/tests/ui/associated-item/issue-87638.stderr @@ -5,10 +5,12 @@ LL | type Target; | ------------ associated type `Target` defined here ... LL | let _: ::Output; - | ^^^^^^ - | | - | not found in `Trait` - | help: maybe you meant this associated type: `Target` + | ^^^^^^ not found in `Trait` + | +help: maybe you meant this associated type + | +LL | let _: ::Target; + | ~~~~~~ error[E0576]: cannot find method or associated constant `BAR` in trait `Trait` --> $DIR/issue-87638.rs:20:27 @@ -17,10 +19,12 @@ LL | const FOO: usize; | ----------------- associated constant `FOO` defined here ... LL | let _ = ::BAR; - | ^^^ - | | - | not found in `Trait` - | help: maybe you meant this associated constant: `FOO` + | ^^^ not found in `Trait` + | +help: maybe you meant this associated constant + | +LL | let _ = ::FOO; + | ~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/associated-types/defaults-specialization.stderr b/tests/ui/associated-types/defaults-specialization.stderr index 7ef433d859fa4..b4ed99f36f44a 100644 --- a/tests/ui/associated-types/defaults-specialization.stderr +++ b/tests/ui/associated-types/defaults-specialization.stderr @@ -12,10 +12,7 @@ error[E0053]: method `make` has an incompatible type for trait --> $DIR/defaults-specialization.rs:19:18 | LL | fn make() -> u8 { 0 } - | ^^ - | | - | expected associated type, found `u8` - | help: change the output type to match the trait: ` as Tr>::Ty` + | ^^ expected associated type, found `u8` | note: type in trait --> $DIR/defaults-specialization.rs:9:18 @@ -24,6 +21,10 @@ LL | fn make() -> Self::Ty { | ^^^^^^^^ = note: expected signature `fn() -> as Tr>::Ty` found signature `fn() -> u8` +help: change the output type to match the trait + | +LL | fn make() -> as Tr>::Ty { 0 } + | ~~~~~~~~~~~~~~~~ error[E0053]: method `make` has an incompatible type for trait --> $DIR/defaults-specialization.rs:35:18 @@ -32,10 +33,7 @@ LL | default type Ty = bool; | ----------------------- associated type is `default` and may be overridden LL | LL | fn make() -> bool { true } - | ^^^^ - | | - | expected associated type, found `bool` - | help: change the output type to match the trait: ` as Tr>::Ty` + | ^^^^ expected associated type, found `bool` | note: type in trait --> $DIR/defaults-specialization.rs:9:18 @@ -44,6 +42,10 @@ LL | fn make() -> Self::Ty { | ^^^^^^^^ = note: expected signature `fn() -> as Tr>::Ty` found signature `fn() -> bool` +help: change the output type to match the trait + | +LL | fn make() -> as Tr>::Ty { true } + | ~~~~~~~~~~~~~~~~ error[E0308]: mismatched types --> $DIR/defaults-specialization.rs:10:9 diff --git a/tests/ui/associated-types/issue-19883.stderr b/tests/ui/associated-types/issue-19883.stderr index 35184e852cfe1..e13783bca11a5 100644 --- a/tests/ui/associated-types/issue-19883.stderr +++ b/tests/ui/associated-types/issue-19883.stderr @@ -5,10 +5,12 @@ LL | type Output; | ------------ associated type `Output` defined here ... LL | >::Dst - | ^^^ - | | - | not found in `From` - | help: maybe you meant this associated type: `Output` + | ^^^ not found in `From` + | +help: maybe you meant this associated type + | +LL | >::Output + | ~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/associated-types/issue-22037.stderr b/tests/ui/associated-types/issue-22037.stderr index b02dad97d354e..e4a429119285d 100644 --- a/tests/ui/associated-types/issue-22037.stderr +++ b/tests/ui/associated-types/issue-22037.stderr @@ -4,10 +4,12 @@ error[E0576]: cannot find associated type `X` in trait `A` LL | type Output; | ------------ associated type `Output` defined here LL | fn a(&self) -> ::X; - | ^ - | | - | not found in `A` - | help: maybe you meant this associated type: `Output` + | ^ not found in `A` + | +help: maybe you meant this associated type + | +LL | fn a(&self) -> ::Output; + | ~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/associated-types/issue-22560.stderr b/tests/ui/associated-types/issue-22560.stderr index 46e6e3951a5bd..413c45df7b297 100644 --- a/tests/ui/associated-types/issue-22560.stderr +++ b/tests/ui/associated-types/issue-22560.stderr @@ -35,9 +35,13 @@ LL | trait Add { | ------------------- type parameter `Rhs` must be specified for this ... LL | type Test = dyn Add + Sub; - | ^^^ help: set the type parameter to the desired type: `Add` + | ^^^ | = note: because of the default `Self` reference, type parameters must be specified on object types +help: set the type parameter to the desired type + | +LL | type Test = dyn Add + Sub; + | ~~~~~~~~ error[E0393]: the type parameter `Rhs` must be explicitly specified --> $DIR/issue-22560.rs:9:23 @@ -46,9 +50,13 @@ LL | trait Sub { | ------------------- type parameter `Rhs` must be specified for this ... LL | type Test = dyn Add + Sub; - | ^^^ help: set the type parameter to the desired type: `Sub` + | ^^^ | = note: because of the default `Self` reference, type parameters must be specified on object types +help: set the type parameter to the desired type + | +LL | type Test = dyn Add + Sub; + | ~~~~~~~~ error: aborting due to 4 previous errors diff --git a/tests/ui/async-await/debug-ice-attempted-to-add-with-overflow.stderr b/tests/ui/async-await/debug-ice-attempted-to-add-with-overflow.stderr index eab5bea681cb1..f992976a33149 100644 --- a/tests/ui/async-await/debug-ice-attempted-to-add-with-overflow.stderr +++ b/tests/ui/async-await/debug-ice-attempted-to-add-with-overflow.stderr @@ -2,14 +2,16 @@ error[E0277]: `[usize; usize::MAX]` is not a future --> $DIR/debug-ice-attempted-to-add-with-overflow.rs:8:37 | LL | [0usize; 0xffff_ffff_ffff_ffff].await; - | -^^^^^ - | || - | |`[usize; usize::MAX]` is not a future - | help: remove the `.await` + | ^^^^^ `[usize; usize::MAX]` is not a future | = help: the trait `Future` is not implemented for `[usize; usize::MAX]`, which is required by `[usize; usize::MAX]: IntoFuture` = note: [usize; usize::MAX] must be a future or must implement `IntoFuture` to be awaited = note: required for `[usize; usize::MAX]` to implement `IntoFuture` +help: remove the `.await` + | +LL - [0usize; 0xffff_ffff_ffff_ffff].await; +LL + [0usize; 0xffff_ffff_ffff_ffff]; + | error[E0752]: `main` function is not allowed to be `async` --> $DIR/debug-ice-attempted-to-add-with-overflow.rs:6:1 diff --git a/tests/ui/async-await/drop-track-bad-field-in-fru.stderr b/tests/ui/async-await/drop-track-bad-field-in-fru.stderr index 53cdc9b61d32b..b21129bbc560c 100644 --- a/tests/ui/async-await/drop-track-bad-field-in-fru.stderr +++ b/tests/ui/async-await/drop-track-bad-field-in-fru.stderr @@ -10,14 +10,16 @@ error[E0277]: `Option<_>` is not a future --> $DIR/drop-track-bad-field-in-fru.rs:6:46 | LL | None { value: (), ..Default::default() }.await; - | -^^^^^ - | || - | |`Option<_>` is not a future - | help: remove the `.await` + | ^^^^^ `Option<_>` is not a future | = help: the trait `Future` is not implemented for `Option<_>`, which is required by `Option<_>: IntoFuture` = note: Option<_> must be a future or must implement `IntoFuture` to be awaited = note: required for `Option<_>` to implement `IntoFuture` +help: remove the `.await` + | +LL - None { value: (), ..Default::default() }.await; +LL + None { value: (), ..Default::default() }; + | error: aborting due to 2 previous errors diff --git a/tests/ui/async-await/in-trait/bad-signatures.stderr b/tests/ui/async-await/in-trait/bad-signatures.stderr index 127a343a93016..7ef2499d057a2 100644 --- a/tests/ui/async-await/in-trait/bad-signatures.stderr +++ b/tests/ui/async-await/in-trait/bad-signatures.stderr @@ -8,10 +8,12 @@ error: expected one of `:`, `@`, or `|`, found keyword `self` --> $DIR/bad-signatures.rs:5:23 | LL | async fn bar(&abc self); - | -----^^^^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^^^^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL | async fn bar(: ); + | ~~~~~~~~~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/async-await/issue-101715.stderr b/tests/ui/async-await/issue-101715.stderr index 3b429793b786f..da01e776c90be 100644 --- a/tests/ui/async-await/issue-101715.stderr +++ b/tests/ui/async-await/issue-101715.stderr @@ -2,14 +2,16 @@ error[E0277]: `()` is not a future --> $DIR/issue-101715.rs:11:10 | LL | .await - | -^^^^^ - | || - | |`()` is not a future - | help: remove the `.await` + | ^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()`, which is required by `(): IntoFuture` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required for `()` to implement `IntoFuture` +help: remove the `.await` + | +LL - .await +LL + + | error: aborting due to 1 previous error diff --git a/tests/ui/async-await/issue-61452.stderr b/tests/ui/async-await/issue-61452.stderr index 3f623ba8ad274..bdf0dcd5c7fd7 100644 --- a/tests/ui/async-await/issue-61452.stderr +++ b/tests/ui/async-await/issue-61452.stderr @@ -13,12 +13,14 @@ error[E0384]: cannot assign twice to immutable variable `x` --> $DIR/issue-61452.rs:9:5 | LL | pub async fn g(x: usize) { - | - - | | - | first assignment to `x` - | help: consider making this binding mutable: `mut x` + | - first assignment to `x` LL | x += 1; | ^^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | pub async fn g(mut x: usize) { + | ~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/async-await/no-async-const.stderr b/tests/ui/async-await/no-async-const.stderr index d692ba8f47375..51eaf903ceac4 100644 --- a/tests/ui/async-await/no-async-const.stderr +++ b/tests/ui/async-await/no-async-const.stderr @@ -2,12 +2,13 @@ error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found keyword `const --> $DIR/no-async-const.rs:4:11 | LL | pub async const fn x() {} - | ------^^^^^ - | | | - | | expected one of `extern`, `fn`, `safe`, or `unsafe` - | help: `const` must come before `async`: `const async` + | ^^^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `const` must come before `async` + | +LL | pub const async fn x() {} + | ~~~~~~~~~~~ error: functions cannot be both `const` and `async` --> $DIR/no-async-const.rs:4:5 diff --git a/tests/ui/async-await/no-unsafe-async.stderr b/tests/ui/async-await/no-unsafe-async.stderr index 49b112f9313d4..ce16932d2441e 100644 --- a/tests/ui/async-await/no-unsafe-async.stderr +++ b/tests/ui/async-await/no-unsafe-async.stderr @@ -2,23 +2,25 @@ error: expected one of `extern` or `fn`, found keyword `async` --> $DIR/no-unsafe-async.rs:7:12 | LL | unsafe async fn g() {} - | -------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `async` must come before `unsafe`: `async unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `async` must come before `unsafe` + | +LL | async unsafe fn g() {} + | ~~~~~~~~~~~~ error: expected one of `extern` or `fn`, found keyword `async` --> $DIR/no-unsafe-async.rs:11:8 | LL | unsafe async fn f() {} - | -------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `async` must come before `unsafe`: `async unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `async` must come before `unsafe` + | +LL | async unsafe fn f() {} + | ~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/async-await/unnecessary-await.stderr b/tests/ui/async-await/unnecessary-await.stderr index 8d81957653240..4cb0a68a96854 100644 --- a/tests/ui/async-await/unnecessary-await.stderr +++ b/tests/ui/async-await/unnecessary-await.stderr @@ -23,14 +23,16 @@ error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:28:10 | LL | e!().await; - | -^^^^^ - | || - | |`()` is not a future - | help: remove the `.await` + | ^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()`, which is required by `(): IntoFuture` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required for `()` to implement `IntoFuture` +help: remove the `.await` + | +LL - e!().await; +LL + e!(); + | error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:22:15 @@ -53,14 +55,16 @@ error[E0277]: `()` is not a future --> $DIR/unnecessary-await.rs:36:20 | LL | for x in [] {}.await - | -^^^^^ - | || - | |`()` is not a future - | help: remove the `.await` + | ^^^^^ `()` is not a future | = help: the trait `Future` is not implemented for `()`, which is required by `(): IntoFuture` = note: () must be a future or must implement `IntoFuture` to be awaited = note: required for `()` to implement `IntoFuture` +help: remove the `.await` + | +LL - for x in [] {}.await +LL + for x in [] {} + | error: aborting due to 4 previous errors diff --git a/tests/ui/blind/blind-item-block-middle.stderr b/tests/ui/blind/blind-item-block-middle.stderr index b2ae169013a62..e7ab9a1c2c91f 100644 --- a/tests/ui/blind/blind-item-block-middle.stderr +++ b/tests/ui/blind/blind-item-block-middle.stderr @@ -9,7 +9,11 @@ LL | let bar = 5; | | | expected integer, found `bar` | `bar` is interpreted as a unit struct, not a new binding - | help: introduce a new binding instead: `other_bar` + | +help: introduce a new binding instead + | +LL | let other_bar = 5; + | ~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr b/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr index a774820918712..b639822426291 100644 --- a/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr +++ b/tests/ui/borrowck/borrow-raw-address-of-mutability.stderr @@ -12,11 +12,13 @@ LL | let mut x = 0; error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/borrow-raw-address-of-mutability.rs:11:17 | -LL | let x = 0; - | - help: consider changing this to be mutable: `mut x` -LL | let mut f = || { LL | let y = &raw mut x; | ^^^^^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | let mut x = 0; + | ~~~~~ error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable --> $DIR/borrow-raw-address-of-mutability.rs:21:5 diff --git a/tests/ui/borrowck/borrowck-closures-unique.stderr b/tests/ui/borrowck/borrowck-closures-unique.stderr index 23d3cc0e76ff7..515a369c1f501 100644 --- a/tests/ui/borrowck/borrowck-closures-unique.stderr +++ b/tests/ui/borrowck/borrowck-closures-unique.stderr @@ -43,10 +43,13 @@ LL | c1; error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/borrowck-closures-unique.rs:43:38 | -LL | fn e(x: &'static mut isize) { - | - help: consider changing this to be mutable: `mut x` LL | let c1 = |y: &'static mut isize| x = y; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | fn e(mut x: &'static mut isize) { + | ~~~~~ error: aborting due to 4 previous errors diff --git a/tests/ui/borrowck/immutable-arg.stderr b/tests/ui/borrowck/immutable-arg.stderr index 84a480f641071..3b9df15a1f902 100644 --- a/tests/ui/borrowck/immutable-arg.stderr +++ b/tests/ui/borrowck/immutable-arg.stderr @@ -1,10 +1,13 @@ error[E0384]: cannot assign to immutable argument `_x` --> $DIR/immutable-arg.rs:2:5 | -LL | fn foo(_x: u32) { - | -- help: consider making this binding mutable: `mut _x` LL | _x = 4; | ^^^^^^ cannot assign to immutable argument + | +help: consider making this binding mutable + | +LL | fn foo(mut _x: u32) { + | ~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/borrowck/issue-111554.stderr b/tests/ui/borrowck/issue-111554.stderr index 6b7a42e495999..ac19529b6039d 100644 --- a/tests/ui/borrowck/issue-111554.stderr +++ b/tests/ui/borrowck/issue-111554.stderr @@ -19,10 +19,13 @@ LL | || bar(&mut self); error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable --> $DIR/issue-111554.rs:21:16 | -LL | pub fn quux(self) { - | ---- help: consider changing this to be mutable: `mut self` LL | || bar(&mut self); | ^^^^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | pub fn quux(mut self) { + | ~~~~~~~~ error: aborting due to 4 previous errors diff --git a/tests/ui/borrowck/issue-33819.stderr b/tests/ui/borrowck/issue-33819.stderr index 41c9d6aac760b..8703e159cd3c3 100644 --- a/tests/ui/borrowck/issue-33819.stderr +++ b/tests/ui/borrowck/issue-33819.stderr @@ -2,10 +2,13 @@ error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable --> $DIR/issue-33819.rs:4:34 | LL | Some(ref v) => { let a = &mut v; }, - | ^^^^^^ - | | - | cannot borrow as mutable - | help: try removing `&mut` here + | ^^^^^^ cannot borrow as mutable + | +help: try removing `&mut` here + | +LL - Some(ref v) => { let a = &mut v; }, +LL + Some(ref v) => { let a = ; }, + | error: aborting due to 1 previous error diff --git a/tests/ui/borrowck/issue-45199.stderr b/tests/ui/borrowck/issue-45199.stderr index 47aa30908270d..e57e38555c8c7 100644 --- a/tests/ui/borrowck/issue-45199.stderr +++ b/tests/ui/borrowck/issue-45199.stderr @@ -1,34 +1,40 @@ error[E0384]: cannot assign twice to immutable variable `b` --> $DIR/issue-45199.rs:6:5 | -LL | let b: Box; - | - help: consider making this binding mutable: `mut b` -... LL | b = Box::new(1); | - first assignment to `b` LL | b = Box::new(2); | ^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut b: Box; + | ~~~~~ error[E0384]: cannot assign twice to immutable variable `b` --> $DIR/issue-45199.rs:14:5 | LL | let b = Box::new(1); - | - - | | - | first assignment to `b` - | help: consider making this binding mutable: `mut b` + | - first assignment to `b` ... LL | b = Box::new(2); | ^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut b = Box::new(1); + | ~~~~~ error[E0384]: cannot assign to immutable argument `b` --> $DIR/issue-45199.rs:20:5 | -LL | fn test_args(b: Box) { - | - help: consider making this binding mutable: `mut b` -LL | LL | b = Box::new(2); | ^ cannot assign to immutable argument + | +help: consider making this binding mutable + | +LL | fn test_args(mut b: Box) { + | ~~~~~ error: aborting due to 3 previous errors diff --git a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr index 098a2964e9fc7..88e8ec60ad686 100644 --- a/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr +++ b/tests/ui/borrowck/issue-55492-borrowck-migrate-scans-parents.stderr @@ -44,56 +44,68 @@ LL | borrowck_closures_unique::e(addr_of_mut!(X)); error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:9:46 | -LL | pub fn e(x: &'static mut isize) { - | - help: consider changing this to be mutable: `mut x` -LL | static mut Y: isize = 3; LL | let mut c1 = |y: &'static mut isize| x = y; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | pub fn e(mut x: &'static mut isize) { + | ~~~~~ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:22:50 | -LL | pub fn ee(x: &'static mut isize) { - | - help: consider changing this to be mutable: `mut x` -... LL | let mut c2 = |y: &'static mut isize| x = y; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | pub fn ee(mut x: &'static mut isize) { + | ~~~~~ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:37:13 | -LL | pub fn capture_assign_whole(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -LL | || { LL | x = (1,); | ^^^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | pub fn capture_assign_whole(mut x: (i32,)) { + | ~~~~~ error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:43:13 | -LL | pub fn capture_assign_part(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -LL | || { LL | x.0 = 1; | ^^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | pub fn capture_assign_part(mut x: (i32,)) { + | ~~~~~ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:49:13 | -LL | pub fn capture_reborrow_whole(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -LL | || { LL | &mut x; | ^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | pub fn capture_reborrow_whole(mut x: (i32,)) { + | ~~~~~ error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable --> $DIR/issue-55492-borrowck-migrate-scans-parents.rs:55:13 | -LL | pub fn capture_reborrow_part(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -LL | || { LL | &mut x.0; | ^^^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | pub fn capture_reborrow_part(mut x: (i32,)) { + | ~~~~~ error: aborting due to 6 previous errors; 3 warnings emitted diff --git a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr index c0b6dcd1512f7..c50e3fb640597 100644 --- a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr +++ b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr @@ -2,15 +2,18 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59 | LL | async fn buy_lock(coroutine: &Mutex) -> LockedMarket<'_> { - | ^^^^^^^^^^^^---- help: remove these generics - | | - | expected 0 lifetime arguments + | ^^^^^^^^^^^^ expected 0 lifetime arguments | note: struct defined here, with 0 lifetime parameters --> $DIR/issue-82126-mismatched-subst-and-hir.rs:24:8 | LL | struct LockedMarket(T); | ^^^^^^^^^^^^ +help: remove these generics + | +LL - async fn buy_lock(coroutine: &Mutex) -> LockedMarket<'_> { +LL + async fn buy_lock(coroutine: &Mutex) -> LockedMarket { + | error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied --> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59 @@ -32,9 +35,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59 | LL | async fn buy_lock(coroutine: &Mutex) -> LockedMarket<'_> { - | ^^^^^^^^^^^^---- help: remove these generics - | | - | expected 0 lifetime arguments + | ^^^^^^^^^^^^ expected 0 lifetime arguments | note: struct defined here, with 0 lifetime parameters --> $DIR/issue-82126-mismatched-subst-and-hir.rs:24:8 @@ -42,6 +43,11 @@ note: struct defined here, with 0 lifetime parameters LL | struct LockedMarket(T); | ^^^^^^^^^^^^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: remove these generics + | +LL - async fn buy_lock(coroutine: &Mutex) -> LockedMarket<'_> { +LL + async fn buy_lock(coroutine: &Mutex) -> LockedMarket { + | error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied --> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59 diff --git a/tests/ui/borrowck/mutability-errors.stderr b/tests/ui/borrowck/mutability-errors.stderr index b39e57d70ec65..e02e509ac0406 100644 --- a/tests/ui/borrowck/mutability-errors.stderr +++ b/tests/ui/borrowck/mutability-errors.stderr @@ -262,74 +262,90 @@ LL | fn imm_local(mut x: (i32,)) { error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/mutability-errors.rs:60:9 | -LL | fn imm_capture(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -LL | || { LL | x = (1,); | ^^^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | fn imm_capture(mut x: (i32,)) { + | ~~~~~ error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable --> $DIR/mutability-errors.rs:61:9 | -LL | fn imm_capture(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -... LL | x.0 = 1; | ^^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | fn imm_capture(mut x: (i32,)) { + | ~~~~~ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/mutability-errors.rs:62:9 | -LL | fn imm_capture(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -... LL | &mut x; | ^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | fn imm_capture(mut x: (i32,)) { + | ~~~~~ error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable --> $DIR/mutability-errors.rs:63:9 | -LL | fn imm_capture(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -... LL | &mut x.0; | ^^^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | fn imm_capture(mut x: (i32,)) { + | ~~~~~ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/mutability-errors.rs:66:9 | -LL | fn imm_capture(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -... LL | x = (1,); | ^^^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | fn imm_capture(mut x: (i32,)) { + | ~~~~~ error[E0594]: cannot assign to `x.0`, as `x` is not declared as mutable --> $DIR/mutability-errors.rs:67:9 | -LL | fn imm_capture(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -... LL | x.0 = 1; | ^^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | fn imm_capture(mut x: (i32,)) { + | ~~~~~ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/mutability-errors.rs:68:9 | -LL | fn imm_capture(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -... LL | &mut x; | ^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | fn imm_capture(mut x: (i32,)) { + | ~~~~~ error[E0596]: cannot borrow `x.0` as mutable, as `x` is not declared as mutable --> $DIR/mutability-errors.rs:69:9 | -LL | fn imm_capture(x: (i32,)) { - | - help: consider changing this to be mutable: `mut x` -... LL | &mut x.0; | ^^^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | fn imm_capture(mut x: (i32,)) { + | ~~~~~ error[E0594]: cannot assign to immutable static item `X` --> $DIR/mutability-errors.rs:76:5 diff --git a/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.stderr b/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.stderr index 349546606a57e..f65926d81c475 100644 --- a/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.stderr +++ b/tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.stderr @@ -2,19 +2,23 @@ error[E0433]: failed to resolve: use of undeclared type `E` --> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:6:17 | LL | let mut a = E::StructVar { boxed: Box::new(5_i32) }; - | ^ - | | - | use of undeclared type `E` - | help: a trait with a similar name exists: `Eq` + | ^ use of undeclared type `E` + | +help: a trait with a similar name exists + | +LL | let mut a = Eq::StructVar { boxed: Box::new(5_i32) }; + | ~~ error[E0433]: failed to resolve: use of undeclared type `E` --> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:9:9 | LL | E::StructVar { box boxed } => { } - | ^ - | | - | use of undeclared type `E` - | help: a trait with a similar name exists: `Eq` + | ^ use of undeclared type `E` + | +help: a trait with a similar name exists + | +LL | Eq::StructVar { box boxed } => { } + | ~~ error: aborting due to 2 previous errors diff --git a/tests/ui/borrowck/tainted-promoteds.stderr b/tests/ui/borrowck/tainted-promoteds.stderr index a5c448fdcdbef..8224a3a2002ae 100644 --- a/tests/ui/borrowck/tainted-promoteds.stderr +++ b/tests/ui/borrowck/tainted-promoteds.stderr @@ -2,12 +2,14 @@ error[E0384]: cannot assign twice to immutable variable `a` --> $DIR/tainted-promoteds.rs:7:5 | LL | let a = 0; - | - - | | - | first assignment to `a` - | help: consider making this binding mutable: `mut a` + | - first assignment to `a` LL | a = &0 * &1 * &2 * &3; | ^^^^^^^^^^^^^^^^^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut a = 0; + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/cannot-mutate-captured-non-mut-var.stderr b/tests/ui/cannot-mutate-captured-non-mut-var.stderr index 2d6e83c9e82f9..567b8cb25b8d2 100644 --- a/tests/ui/cannot-mutate-captured-non-mut-var.stderr +++ b/tests/ui/cannot-mutate-captured-non-mut-var.stderr @@ -1,18 +1,24 @@ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/cannot-mutate-captured-non-mut-var.rs:9:25 | -LL | let x = 1; - | - help: consider changing this to be mutable: `mut x` LL | to_fn_once(move|| { x = 2; }); | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut x = 1; + | ~~~~~ error[E0596]: cannot borrow `s` as mutable, as it is not declared as mutable --> $DIR/cannot-mutate-captured-non-mut-var.rs:13:25 | -LL | let s = std::io::stdin(); - | - help: consider changing this to be mutable: `mut s` LL | to_fn_once(move|| { s.read_to_end(&mut Vec::new()); }); | ^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | let mut s = std::io::stdin(); + | ~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/cast/cast-to-slice.stderr b/tests/ui/cast/cast-to-slice.stderr index 8f862c0001401..93ab026765e25 100644 --- a/tests/ui/cast/cast-to-slice.stderr +++ b/tests/ui/cast/cast-to-slice.stderr @@ -2,17 +2,23 @@ error[E0620]: cast to unsized type: `&[u8]` as `[char]` --> $DIR/cast-to-slice.rs:2:5 | LL | "example".as_bytes() as [char]; - | ^^^^^^^^^^^^^^^^^^^^^^^^------ - | | - | help: try casting to a reference instead: `&[char]` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: try casting to a reference instead + | +LL | "example".as_bytes() as &[char]; + | ~~~~~~~ error[E0620]: cast to unsized type: `&[u8]` as `[char]` --> $DIR/cast-to-slice.rs:6:5 | LL | arr as [char]; - | ^^^^^^^------ - | | - | help: try casting to a reference instead: `&[char]` + | ^^^^^^^^^^^^^ + | +help: try casting to a reference instead + | +LL | arr as &[char]; + | ~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/cast/cast-to-unsized-trait-object-suggestion.stderr b/tests/ui/cast/cast-to-unsized-trait-object-suggestion.stderr index 3b5b8ea69c195..be68e4dcc4629 100644 --- a/tests/ui/cast/cast-to-unsized-trait-object-suggestion.stderr +++ b/tests/ui/cast/cast-to-unsized-trait-object-suggestion.stderr @@ -2,17 +2,23 @@ error[E0620]: cast to unsized type: `&{integer}` as `dyn Send` --> $DIR/cast-to-unsized-trait-object-suggestion.rs:2:5 | LL | &1 as dyn Send; - | ^^^^^^-------- - | | - | help: try casting to a reference instead: `&dyn Send` + | ^^^^^^^^^^^^^^ + | +help: try casting to a reference instead + | +LL | &1 as &dyn Send; + | ~~~~~~~~~ error[E0620]: cast to unsized type: `Box<{integer}>` as `dyn Send` --> $DIR/cast-to-unsized-trait-object-suggestion.rs:3:5 | LL | Box::new(1) as dyn Send; - | ^^^^^^^^^^^^^^^-------- - | | - | help: you can cast to a `Box` instead: `Box` + | ^^^^^^^^^^^^^^^^^^^^^^^ + | +help: you can cast to a `Box` instead + | +LL | Box::new(1) as Box; + | ~~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/closures/2229_closure_analysis/array_subslice.stderr b/tests/ui/closures/2229_closure_analysis/array_subslice.stderr index 888c60d5e91fb..e4c8dd2993482 100644 --- a/tests/ui/closures/2229_closure_analysis/array_subslice.stderr +++ b/tests/ui/closures/2229_closure_analysis/array_subslice.stderr @@ -1,11 +1,13 @@ error[E0596]: cannot borrow `x[..]` as mutable, as `x` is not declared as mutable --> $DIR/array_subslice.rs:7:21 | -LL | pub fn subslice_array(x: [u8; 3]) { - | - help: consider changing this to be mutable: `mut x` -... LL | let [ref y, ref mut z @ ..] = x; | ^^^^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | pub fn subslice_array(mut x: [u8; 3]) { + | ~~~~~ error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable --> $DIR/array_subslice.rs:10:5 diff --git a/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.stderr b/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.stderr index 98414fa8a3d5f..61c9eebd8bce0 100644 --- a/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.stderr +++ b/tests/ui/closures/2229_closure_analysis/diagnostics/cant-mutate-imm.stderr @@ -1,20 +1,24 @@ error[E0594]: cannot assign to `z.0.0.0`, as it is not declared as mutable --> $DIR/cant-mutate-imm.rs:12:9 | -LL | let z = (y, 10); - | - help: consider changing this to be mutable: `mut z` -... LL | z.0.0.0 = 20; | ^^^^^^^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut z = (y, 10); + | ~~~~~ error[E0594]: cannot assign to `*bx.0`, as it is not declared as mutable --> $DIR/cant-mutate-imm.rs:24:9 | -LL | let bx = Box::new(x); - | -- help: consider changing this to be mutable: `mut bx` -... LL | bx.0 = 20; | ^^^^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut bx = Box::new(x); + | ~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/closures/closure-immutable-outer-variable.stderr b/tests/ui/closures/closure-immutable-outer-variable.stderr index 23bd0020db6b3..d0a2ac52e7222 100644 --- a/tests/ui/closures/closure-immutable-outer-variable.stderr +++ b/tests/ui/closures/closure-immutable-outer-variable.stderr @@ -1,10 +1,13 @@ error[E0594]: cannot assign to `y`, as it is not declared as mutable --> $DIR/closure-immutable-outer-variable.rs:11:26 | -LL | let y = true; - | - help: consider changing this to be mutable: `mut y` LL | foo(Box::new(move || y = !y) as Box<_>); | ^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut y = true; + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/closures/issue-90871.stderr b/tests/ui/closures/issue-90871.stderr index ef1cb213f73be..a58688a1f8051 100644 --- a/tests/ui/closures/issue-90871.stderr +++ b/tests/ui/closures/issue-90871.stderr @@ -2,10 +2,15 @@ error[E0412]: cannot find type `n` in this scope --> $DIR/issue-90871.rs:4:22 | LL | type_ascribe!(2, n([u8; || 1])) - | ^ help: a trait with a similar name exists: `Fn` + | ^ --> $SRC_DIR/core/src/ops/function.rs:LL:COL | = note: similarly named trait `Fn` defined here + | +help: a trait with a similar name exists + | +LL | type_ascribe!(2, Fn([u8; || 1])) + | ~~ error[E0308]: mismatched types --> $DIR/issue-90871.rs:4:29 diff --git a/tests/ui/coercion/issue-73886.stderr b/tests/ui/coercion/issue-73886.stderr index a6f8ba65ab51a..4f6a9e92b16c4 100644 --- a/tests/ui/coercion/issue-73886.stderr +++ b/tests/ui/coercion/issue-73886.stderr @@ -8,9 +8,13 @@ error[E0605]: non-primitive cast: `u32` as `Option<_>` --> $DIR/issue-73886.rs:4:13 | LL | let _ = 7u32 as Option<_>; - | ^^^^^^^^^^^^^^^^^ help: consider using the `From` trait instead: `Option<_>::from(7u32)` + | ^^^^^^^^^^^^^^^^^ | = note: an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object +help: consider using the `From` trait instead + | +LL | let _ = Option<_>::from(7u32); + | ~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/command-line-diagnostics.stderr b/tests/ui/command-line-diagnostics.stderr index b719a00ad5ddd..e5127a7eaa1ac 100644 --- a/tests/ui/command-line-diagnostics.stderr +++ b/tests/ui/command-line-diagnostics.stderr @@ -2,12 +2,14 @@ error[E0384]: cannot assign twice to immutable variable `x` --> $DIR/command-line-diagnostics.rs:6:5 | LL | let x = 42; - | - - | | - | first assignment to `x` - | help: consider making this binding mutable: `mut x` + | - first assignment to `x` LL | x = 43; | ^^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut x = 42; + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/compare-method/bad-self-type.stderr b/tests/ui/compare-method/bad-self-type.stderr index a87b713c2b4bd..29ebbc5dffb11 100644 --- a/tests/ui/compare-method/bad-self-type.stderr +++ b/tests/ui/compare-method/bad-self-type.stderr @@ -2,22 +2,20 @@ error[E0053]: method `poll` has an incompatible type for trait --> $DIR/bad-self-type.rs:10:13 | LL | fn poll(self, _: &mut Context<'_>) -> Poll<()> { - | ^^^^ - | | - | expected `Pin<&mut MyFuture>`, found `MyFuture` - | help: change the self-receiver type to match the trait: `self: Pin<&mut MyFuture>` + | ^^^^ expected `Pin<&mut MyFuture>`, found `MyFuture` | = note: expected signature `fn(Pin<&mut MyFuture>, &mut Context<'_>) -> Poll<_>` found signature `fn(MyFuture, &mut Context<'_>) -> Poll<_>` +help: change the self-receiver type to match the trait + | +LL | fn poll(self: Pin<&mut MyFuture>, _: &mut Context<'_>) -> Poll<()> { + | ~~~~~~~~~~~~~~~~~~~~~~~~ error[E0053]: method `foo` has an incompatible type for trait --> $DIR/bad-self-type.rs:22:18 | LL | fn foo(self: Box) {} - | ------^^^^^^^^^ - | | | - | | expected `MyFuture`, found `Box` - | help: change the self-receiver type to match the trait: `self` + | ^^^^^^^^^ expected `MyFuture`, found `Box` | note: type in trait --> $DIR/bad-self-type.rs:17:12 @@ -26,6 +24,10 @@ LL | fn foo(self); | ^^^^ = note: expected signature `fn(MyFuture)` found signature `fn(Box)` +help: change the self-receiver type to match the trait + | +LL | fn foo(self) {} + | ~~~~ error[E0053]: method `bar` has an incompatible type for trait --> $DIR/bad-self-type.rs:24:17 diff --git a/tests/ui/compare-method/issue-90444.stderr b/tests/ui/compare-method/issue-90444.stderr index 52e23d03b148b..f05c9939c0096 100644 --- a/tests/ui/compare-method/issue-90444.stderr +++ b/tests/ui/compare-method/issue-90444.stderr @@ -2,25 +2,27 @@ error[E0053]: method `from` has an incompatible type for trait --> $DIR/issue-90444.rs:3:16 | LL | fn from(_: fn((), (), &mut ())) -> Self { - | ^^^^^^^^^^^^^^^^^^^ - | | - | types differ in mutability - | help: change the parameter type to match the trait: `for<'a> fn((), (), &'a ())` + | ^^^^^^^^^^^^^^^^^^^ types differ in mutability | = note: expected signature `fn(for<'a> fn((), (), &'a ())) -> A` found signature `fn(for<'a> fn((), (), &'a mut ())) -> A` +help: change the parameter type to match the trait + | +LL | fn from(_: for<'a> fn((), (), &'a ())) -> Self { + | ~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0053]: method `from` has an incompatible type for trait --> $DIR/issue-90444.rs:11:16 | LL | fn from(_: fn((), (), u64)) -> Self { - | ^^^^^^^^^^^^^^^ - | | - | expected `u32`, found `u64` - | help: change the parameter type to match the trait: `fn((), (), u32)` + | ^^^^^^^^^^^^^^^ expected `u32`, found `u64` | = note: expected signature `fn(fn((), (), u32)) -> B` found signature `fn(fn((), (), u64)) -> B` +help: change the parameter type to match the trait + | +LL | fn from(_: fn((), (), u32)) -> Self { + | ~~~~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/compare-method/reordered-type-param.stderr b/tests/ui/compare-method/reordered-type-param.stderr index 8a439acee13de..1e8266e213d7f 100644 --- a/tests/ui/compare-method/reordered-type-param.stderr +++ b/tests/ui/compare-method/reordered-type-param.stderr @@ -2,10 +2,8 @@ error[E0053]: method `b` has an incompatible type for trait --> $DIR/reordered-type-param.rs:16:30 | LL | fn b(&self, _x: G) -> G { panic!() } - | - - ^ - | | | | - | | | expected type parameter `F`, found type parameter `G` - | | | help: change the parameter type to match the trait: `F` + | - - ^ expected type parameter `F`, found type parameter `G` + | | | | | found type parameter | expected type parameter | @@ -18,6 +16,10 @@ LL | fn b(&self, x: C) -> C; found signature `fn(&E, G) -> G` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters +help: change the parameter type to match the trait + | +LL | fn b(&self, _x: F) -> G { panic!() } + | ~ error: aborting due to 1 previous error diff --git a/tests/ui/compiletest-self-test/ui-testing-optout.stderr b/tests/ui/compiletest-self-test/ui-testing-optout.stderr index 652c472c0bcfe..693fd16b72574 100644 --- a/tests/ui/compiletest-self-test/ui-testing-optout.stderr +++ b/tests/ui/compiletest-self-test/ui-testing-optout.stderr @@ -11,7 +11,12 @@ error[E0412]: cannot find type `D` in this scope | ----------- similarly named type alias `A` defined here ... 7 | type C = D; - | ^ help: a type alias with a similar name exists: `A` + | ^ + | +help: a type alias with a similar name exists + | +7 | type C = A; + | ~ error[E0412]: cannot find type `F` in this scope --> $DIR/ui-testing-optout.rs:92:10 @@ -20,7 +25,12 @@ error[E0412]: cannot find type `F` in this scope | ----------- similarly named type alias `A` defined here ... 92 | type E = F; - | ^ help: a type alias with a similar name exists: `A` + | ^ + | +help: a type alias with a similar name exists + | +92 | type E = A; + | ~ error: aborting due to 3 previous errors diff --git a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr index 3dd0823389cde..10ce41c744ae9 100644 --- a/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr +++ b/tests/ui/conditional-compilation/cfg-attr-syntax-validation.stderr @@ -50,9 +50,13 @@ error[E0565]: literal in `cfg` predicate value must be a string --> $DIR/cfg-attr-syntax-validation.rs:25:11 | LL | #[cfg(a = b"hi")] - | -^^^^ - | | - | help: consider removing the prefix + | ^^^^^ + | +help: consider removing the prefix + | +LL - #[cfg(a = b"hi")] +LL + #[cfg(a = "hi")] + | error: expected unsuffixed literal, found `concat!("nonexistent")` --> $DIR/cfg-attr-syntax-validation.rs:30:25 diff --git a/tests/ui/confuse-field-and-method/issue-2392.stderr b/tests/ui/confuse-field-and-method/issue-2392.stderr index 440fbb27c0040..64e3521b46e07 100644 --- a/tests/ui/confuse-field-and-method/issue-2392.stderr +++ b/tests/ui/confuse-field-and-method/issue-2392.stderr @@ -19,9 +19,13 @@ LL | struct Obj where F: FnOnce() -> u32 { | ------------- method `not_closure` not found for this struct ... LL | o_closure.not_closure(); - | ^^^^^^^^^^^-- help: remove the arguments - | | - | field, not a method + | ^^^^^^^^^^^ field, not a method + | +help: remove the arguments + | +LL - o_closure.not_closure(); +LL + o_closure.not_closure; + | error[E0599]: no method named `closure` found for struct `Obj` in the current scope --> $DIR/issue-2392.rs:42:12 @@ -86,9 +90,13 @@ LL | struct Obj where F: FnOnce() -> u32 { | ------------- method `not_closure` not found for this struct ... LL | w.wrap.not_closure(); - | ^^^^^^^^^^^-- help: remove the arguments - | | - | field, not a method + | ^^^^^^^^^^^ field, not a method + | +help: remove the arguments + | +LL - w.wrap.not_closure(); +LL + w.wrap.not_closure; + | error[E0599]: no method named `closure` found for struct `Obj` in the current scope --> $DIR/issue-2392.rs:58:24 diff --git a/tests/ui/const-generics/adt_const_params/transmutable-ice-110969.stderr b/tests/ui/const-generics/adt_const_params/transmutable-ice-110969.stderr index a8fc742e89f54..91a1053bb6d15 100644 --- a/tests/ui/const-generics/adt_const_params/transmutable-ice-110969.stderr +++ b/tests/ui/const-generics/adt_const_params/transmutable-ice-110969.stderr @@ -2,9 +2,13 @@ error[E0107]: trait takes at most 2 generic arguments but 3 generic arguments we --> $DIR/transmutable-ice-110969.rs:11:14 | LL | Dst: BikeshedIntrinsicFrom, - | ^^^^^^^^^^^^^^^^^^^^^ ------ help: remove this generic argument - | | - | expected at most 2 generic arguments + | ^^^^^^^^^^^^^^^^^^^^^ expected at most 2 generic arguments + | +help: remove this generic argument + | +LL - Dst: BikeshedIntrinsicFrom, +LL + Dst: BikeshedIntrinsicFrom, + | error[E0308]: mismatched types --> $DIR/transmutable-ice-110969.rs:25:74 diff --git a/tests/ui/const-generics/early/invalid-const-arguments.stderr b/tests/ui/const-generics/early/invalid-const-arguments.stderr index cee34e3b71593..2435b3ffdf9f5 100644 --- a/tests/ui/const-generics/early/invalid-const-arguments.stderr +++ b/tests/ui/const-generics/early/invalid-const-arguments.stderr @@ -49,9 +49,12 @@ error[E0747]: type provided when a constant was expected --> $DIR/invalid-const-arguments.rs:10:19 | LL | impl Foo for B {} - | - ^ - | | - | help: consider changing this type parameter to a const parameter: `const N: u8` + | ^ + | +help: consider changing this type parameter to a const parameter + | +LL | impl Foo for B {} + | ~~~~~~~~~~~ error[E0747]: unresolved item provided when a constant was expected --> $DIR/invalid-const-arguments.rs:14:32 diff --git a/tests/ui/const-generics/generic_arg_infer/in-signature.stderr b/tests/ui/const-generics/generic_arg_infer/in-signature.stderr index fcac95732d12e..b74772920f625 100644 --- a/tests/ui/const-generics/generic_arg_infer/in-signature.stderr +++ b/tests/ui/const-generics/generic_arg_infer/in-signature.stderr @@ -2,29 +2,36 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/in-signature.rs:7:21 | LL | fn arr_fn() -> [u8; _] { - | -----^- - | | | - | | not allowed in type signatures - | help: replace with the correct return type: `[u8; 3]` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn arr_fn() -> [u8; 3] { + | ~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/in-signature.rs:12:24 | LL | fn ty_fn() -> Bar { - | ---------^- - | | | - | | not allowed in type signatures - | help: replace with the correct return type: `Bar` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn ty_fn() -> Bar { + | ~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/in-signature.rs:17:25 | LL | fn ty_fn_mixed() -> Bar<_, _> { - | ----^--^- - | | | | - | | | not allowed in type signatures - | | not allowed in type signatures - | help: replace with the correct return type: `Bar` + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn ty_fn_mixed() -> Bar { + | ~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants --> $DIR/in-signature.rs:22:15 @@ -42,37 +49,45 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/in-signature.rs:26:14 | LL | const TY_CT: Bar = Bar::(0); - | ^^^^^^^^^^^ - | | - | not allowed in type signatures - | help: replace with the correct type: `Bar` + | ^^^^^^^^^^^ not allowed in type signatures + | +help: replace with the correct type + | +LL | const TY_CT: Bar = Bar::(0); + | ~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/in-signature.rs:28:19 | LL | static TY_STATIC: Bar = Bar::(0); - | ^^^^^^^^^^^ - | | - | not allowed in type signatures - | help: replace with the correct type: `Bar` + | ^^^^^^^^^^^ not allowed in type signatures + | +help: replace with the correct type + | +LL | static TY_STATIC: Bar = Bar::(0); + | ~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants --> $DIR/in-signature.rs:30:20 | LL | const TY_CT_MIXED: Bar<_, _> = Bar::(0); - | ^^^^^^^^^ - | | - | not allowed in type signatures - | help: replace with the correct type: `Bar` + | ^^^^^^^^^ not allowed in type signatures + | +help: replace with the correct type + | +LL | const TY_CT_MIXED: Bar = Bar::(0); + | ~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/in-signature.rs:32:25 | LL | static TY_STATIC_MIXED: Bar<_, _> = Bar::(0); - | ^^^^^^^^^ - | | - | not allowed in type signatures - | help: replace with the correct type: `Bar` + | ^^^^^^^^^ not allowed in type signatures + | +help: replace with the correct type + | +LL | static TY_STATIC_MIXED: Bar = Bar::(0); + | ~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types --> $DIR/in-signature.rs:51:23 diff --git a/tests/ui/const-generics/generic_arg_infer/infer-arg-test.stderr b/tests/ui/const-generics/generic_arg_infer/infer-arg-test.stderr index 6d8dd017734c0..f891bbea21ef3 100644 --- a/tests/ui/const-generics/generic_arg_infer/infer-arg-test.stderr +++ b/tests/ui/const-generics/generic_arg_infer/infer-arg-test.stderr @@ -23,15 +23,18 @@ error[E0107]: struct takes 2 generic arguments but 3 generic arguments were supp --> $DIR/infer-arg-test.rs:18:10 | LL | let a: All<_, _, _>; - | ^^^ - help: remove this generic argument - | | - | expected 2 generic arguments + | ^^^ expected 2 generic arguments | note: struct defined here, with 2 generic parameters: `T`, `N` --> $DIR/infer-arg-test.rs:3:8 | LL | struct All<'a, T, const N: usize> { | ^^^ - -------------- +help: remove this generic argument + | +LL - let a: All<_, _, _>; +LL + let a: All<_, _, >; + | error: aborting due to 4 previous errors diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr index 0c29d94ed5b4a..78d32b57f87f3 100644 --- a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr +++ b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr @@ -2,15 +2,18 @@ error[E0107]: function takes 1 generic argument but 2 generic arguments were sup --> $DIR/issue_114151.rs:17:5 | LL | foo::<_, L>([(); L + 1 + L]); - | ^^^ - help: remove this generic argument - | | - | expected 1 generic argument + | ^^^ expected 1 generic argument | note: function defined here, with 1 generic parameter: `N` --> $DIR/issue_114151.rs:4:4 | LL | fn foo( | ^^^ -------------- +help: remove this generic argument + | +LL - foo::<_, L>([(); L + 1 + L]); +LL + foo::<_, >([(); L + 1 + L]); + | error[E0308]: mismatched types --> $DIR/issue_114151.rs:17:18 diff --git a/tests/ui/const-generics/generic_const_exprs/error_in_ty.stderr b/tests/ui/const-generics/generic_const_exprs/error_in_ty.stderr index 0e40255bcf59b..59be4cf681b12 100644 --- a/tests/ui/const-generics/generic_const_exprs/error_in_ty.stderr +++ b/tests/ui/const-generics/generic_const_exprs/error_in_ty.stderr @@ -2,9 +2,14 @@ error[E0425]: cannot find value `x` in this scope --> $DIR/error_in_ty.rs:6:31 | LL | pub struct A {} - | - ^ help: a const parameter with a similar name exists: `z` + | - ^ | | | similarly named const parameter `z` defined here + | +help: a const parameter with a similar name exists + | +LL | pub struct A {} + | ~ error: `[usize; x]` is forbidden as the type of a const generic parameter --> $DIR/error_in_ty.rs:6:23 diff --git a/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr b/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr index be79450a3ce31..99984c232360c 100644 --- a/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr +++ b/tests/ui/const-generics/generic_const_exprs/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.stderr @@ -20,24 +20,32 @@ error[E0393]: the type parameter `Rhs` must be explicitly specified --> $DIR/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.rs:16:27 | LL | ) -> impl Iterator { - | ^^^^^^^^^ help: set the type parameter to the desired type: `SubAssign` + | ^^^^^^^^^ --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | = note: type parameter `Rhs` must be specified for this | = note: because of the default `Self` reference, type parameters must be specified on object types +help: set the type parameter to the desired type + | +LL | ) -> impl Iterator> { + | ~~~~~~~~~~~~~~ error[E0393]: the type parameter `Rhs` must be explicitly specified --> $DIR/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.rs:16:27 | LL | ) -> impl Iterator { - | ^^^^^^^^^ help: set the type parameter to the desired type: `SubAssign` + | ^^^^^^^^^ --> $SRC_DIR/core/src/ops/arith.rs:LL:COL | = note: type parameter `Rhs` must be specified for this | = note: because of the default `Self` reference, type parameters must be specified on object types = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: set the type parameter to the desired type + | +LL | ) -> impl Iterator> { + | ~~~~~~~~~~~~~~ error[E0277]: `()` is not an iterator --> $DIR/expected-type-of-closure-body-to-be-a-closure-or-coroutine-ice-113776.rs:16:6 diff --git a/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr b/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr index a470c36134cf4..6bd6eb4e00e6c 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr @@ -18,15 +18,18 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/issue-102768.rs:9:30 | LL | fn f2<'a>(arg: Box = &'a ()>>) {} - | ^--- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/issue-102768.rs:5:10 | LL | type Y<'a>; | ^ +help: remove these generics + | +LL - fn f2<'a>(arg: Box = &'a ()>>) {} +LL + fn f2<'a>(arg: Box>) {} + | error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied --> $DIR/issue-102768.rs:9:30 @@ -49,9 +52,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/issue-102768.rs:9:30 | LL | fn f2<'a>(arg: Box = &'a ()>>) {} - | ^--- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/issue-102768.rs:5:10 @@ -59,6 +60,11 @@ note: associated type defined here, with 0 generic parameters LL | type Y<'a>; | ^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: remove these generics + | +LL - fn f2<'a>(arg: Box = &'a ()>>) {} +LL + fn f2<'a>(arg: Box>) {} + | error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied --> $DIR/issue-102768.rs:9:30 @@ -81,9 +87,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/issue-102768.rs:9:30 | LL | fn f2<'a>(arg: Box = &'a ()>>) {} - | ^--- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/issue-102768.rs:5:10 @@ -91,6 +95,11 @@ note: associated type defined here, with 0 generic parameters LL | type Y<'a>; | ^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: remove these generics + | +LL - fn f2<'a>(arg: Box = &'a ()>>) {} +LL + fn f2<'a>(arg: Box>) {} + | error[E0038]: the trait `X` cannot be made into an object --> $DIR/issue-102768.rs:9:24 diff --git a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr index 39f022fbee9db..3201246e0401f 100644 --- a/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr +++ b/tests/ui/const-generics/generic_const_exprs/unevaluated-const-ice-119731.stderr @@ -20,7 +20,12 @@ LL | pub type v11 = [[usize; v4]; v4]; | --------------------------------- similarly named type alias `v11` defined here ... LL | pub const fn v21() -> v18 {} - | ^^^ help: a type alias with a similar name exists: `v11` + | ^^^ + | +help: a type alias with a similar name exists + | +LL | pub const fn v21() -> v11 {} + | ~~~ error[E0412]: cannot find type `v18` in this scope --> $DIR/unevaluated-const-ice-119731.rs:30:31 @@ -29,7 +34,12 @@ LL | pub type v11 = [[usize; v4]; v4]; | --------------------------------- similarly named type alias `v11` defined here ... LL | pub const fn v21() -> v18 { - | ^^^ help: a type alias with a similar name exists: `v11` + | ^^^ + | +help: a type alias with a similar name exists + | +LL | pub const fn v21() -> v11 { + | ~~~ error[E0422]: cannot find struct, variant or union type `v18` in this scope --> $DIR/unevaluated-const-ice-119731.rs:32:13 @@ -38,7 +48,12 @@ LL | pub type v11 = [[usize; v4]; v4]; | --------------------------------- similarly named type alias `v11` defined here ... LL | v18 { _p: () } - | ^^^ help: a type alias with a similar name exists: `v11` + | ^^^ + | +help: a type alias with a similar name exists + | +LL | v11 { _p: () } + | ~~~ warning: type `v11` should have an upper camel case name --> $DIR/unevaluated-const-ice-119731.rs:9:14 diff --git a/tests/ui/const-generics/incorrect-number-of-const-args.stderr b/tests/ui/const-generics/incorrect-number-of-const-args.stderr index 01ac4e69a057e..97eb47275c2b2 100644 --- a/tests/ui/const-generics/incorrect-number-of-const-args.stderr +++ b/tests/ui/const-generics/incorrect-number-of-const-args.stderr @@ -20,15 +20,18 @@ error[E0107]: function takes 2 generic arguments but 3 generic arguments were su --> $DIR/incorrect-number-of-const-args.rs:9:5 | LL | foo::<0, 0, 0>(); - | ^^^ - help: remove this generic argument - | | - | expected 2 generic arguments + | ^^^ expected 2 generic arguments | note: function defined here, with 2 generic parameters: `X`, `Y` --> $DIR/incorrect-number-of-const-args.rs:1:4 | LL | fn foo() -> usize { | ^^^ -------------- -------------- +help: remove this generic argument + | +LL - foo::<0, 0, 0>(); +LL + foo::<0, 0, >(); + | error: aborting due to 2 previous errors diff --git a/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr b/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr index 4a649d8a7e881..d4f899f837733 100644 --- a/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr +++ b/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr @@ -27,15 +27,18 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli --> $DIR/invalid-const-arg-for-type-param.rs:12:5 | LL | S::<0>; - | ^----- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: struct defined here, with 0 generic parameters --> $DIR/invalid-const-arg-for-type-param.rs:3:8 | LL | struct S; | ^ +help: remove these generics + | +LL - S::<0>; +LL + S; + | error: aborting due to 3 previous errors diff --git a/tests/ui/const-generics/invalid-constant-in-args.stderr b/tests/ui/const-generics/invalid-constant-in-args.stderr index 158b9722ee61b..ed715257ac1c3 100644 --- a/tests/ui/const-generics/invalid-constant-in-args.stderr +++ b/tests/ui/const-generics/invalid-constant-in-args.stderr @@ -2,9 +2,13 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl --> $DIR/invalid-constant-in-args.rs:4:12 | LL | let _: Cell<&str, "a"> = Cell::new(""); - | ^^^^ --- help: remove this generic argument - | | - | expected 1 generic argument + | ^^^^ expected 1 generic argument + | +help: remove this generic argument + | +LL - let _: Cell<&str, "a"> = Cell::new(""); +LL + let _: Cell<&str, > = Cell::new(""); + | error: aborting due to 1 previous error diff --git a/tests/ui/const-generics/kind_mismatch.stderr b/tests/ui/const-generics/kind_mismatch.stderr index 80968ebea6876..df44260552199 100644 --- a/tests/ui/const-generics/kind_mismatch.stderr +++ b/tests/ui/const-generics/kind_mismatch.stderr @@ -2,17 +2,23 @@ error[E0747]: type provided when a constant was expected --> $DIR/kind_mismatch.rs:11:38 | LL | impl ContainsKey for KeyHolder {} - | - ^ - | | - | help: consider changing this type parameter to a const parameter: `const K: u8` + | ^ + | +help: consider changing this type parameter to a const parameter + | +LL | impl ContainsKey for KeyHolder {} + | ~~~~~~~~~~~ error[E0747]: type provided when a constant was expected --> $DIR/kind_mismatch.rs:11:21 | LL | impl ContainsKey for KeyHolder {} - | - ^ - | | - | help: consider changing this type parameter to a const parameter: `const K: u8` + | ^ + | +help: consider changing this type parameter to a const parameter + | +LL | impl ContainsKey for KeyHolder {} + | ~~~~~~~~~~~ error[E0277]: the trait bound `KeyHolder<0>: SubsetExcept<_>` is not satisfied --> $DIR/kind_mismatch.rs:22:45 diff --git a/tests/ui/const-generics/suggest_const_for_array.stderr b/tests/ui/const-generics/suggest_const_for_array.stderr index a617bf2bb0d96..8c00f0e16a137 100644 --- a/tests/ui/const-generics/suggest_const_for_array.stderr +++ b/tests/ui/const-generics/suggest_const_for_array.stderr @@ -2,13 +2,23 @@ error[E0747]: type provided when a constant was expected --> $DIR/suggest_const_for_array.rs:6:13 | LL | example::<[usize; 3]>(); - | ^^^^^^^^^^ help: array type provided where a `usize` was expected, try: `{ 3 }` + | ^^^^^^^^^^ + | +help: array type provided where a `usize` was expected, try + | +LL | example::<{ 3 }>(); + | ~~~~~ error[E0747]: type provided when a constant was expected --> $DIR/suggest_const_for_array.rs:8:13 | LL | example::<[usize; 4+5]>(); - | ^^^^^^^^^^^^ help: array type provided where a `usize` was expected, try: `{ 4+5 }` + | ^^^^^^^^^^^^ + | +help: array type provided where a `usize` was expected, try + | +LL | example::<{ 4+5 }>(); + | ~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/constructor-lifetime-args.stderr b/tests/ui/constructor-lifetime-args.stderr index a18123fe19cba..9e0bc3c6c1a6e 100644 --- a/tests/ui/constructor-lifetime-args.stderr +++ b/tests/ui/constructor-lifetime-args.stderr @@ -20,15 +20,18 @@ error[E0107]: struct takes 2 lifetime arguments but 3 lifetime arguments were su --> $DIR/constructor-lifetime-args.rs:19:5 | LL | S::<'static, 'static, 'static>(&0, &0); - | ^ ------- help: remove this lifetime argument - | | - | expected 2 lifetime arguments + | ^ expected 2 lifetime arguments | note: struct defined here, with 2 lifetime parameters: `'a`, `'b` --> $DIR/constructor-lifetime-args.rs:9:8 | LL | struct S<'a, 'b>(&'a u8, &'b u8); | ^ -- -- +help: remove this lifetime argument + | +LL - S::<'static, 'static, 'static>(&0, &0); +LL + S::<'static, 'static, >(&0, &0); + | error[E0107]: enum takes 2 lifetime arguments but 1 lifetime argument was supplied --> $DIR/constructor-lifetime-args.rs:22:8 @@ -52,15 +55,18 @@ error[E0107]: enum takes 2 lifetime arguments but 3 lifetime arguments were supp --> $DIR/constructor-lifetime-args.rs:24:8 | LL | E::V::<'static, 'static, 'static>(&0); - | ^ ------- help: remove this lifetime argument - | | - | expected 2 lifetime arguments + | ^ expected 2 lifetime arguments | note: enum defined here, with 2 lifetime parameters: `'a`, `'b` --> $DIR/constructor-lifetime-args.rs:10:6 | LL | enum E<'a, 'b> { | ^ -- -- +help: remove this lifetime argument + | +LL - E::V::<'static, 'static, 'static>(&0); +LL + E::V::<'static, 'static, >(&0); + | error: aborting due to 4 previous errors diff --git a/tests/ui/consts/const-blocks/trait-error.stderr b/tests/ui/consts/const-blocks/trait-error.stderr index 8f00f14dfb900..83b9fbc9423ac 100644 --- a/tests/ui/consts/const-blocks/trait-error.stderr +++ b/tests/ui/consts/const-blocks/trait-error.stderr @@ -2,10 +2,7 @@ error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/trait-error.rs:5:6 | LL | [Foo(String::new()); 4]; - | ^^^^^^^^^^^^^^^^^^ - | | - | the trait `Copy` is not implemented for `String`, which is required by `Foo: Copy` - | help: create an inline `const` block: `const { Foo(String::new()) }` + | ^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`, which is required by `Foo: Copy` | note: required for `Foo` to implement `Copy` --> $DIR/trait-error.rs:1:10 @@ -14,6 +11,10 @@ LL | #[derive(Copy, Clone)] | ^^^^ unsatisfied trait bound introduced in this `derive` macro = note: the `Copy` trait is required because this value will be copied for each element of the array = note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info) +help: create an inline `const` block + | +LL | [const { Foo(String::new()) }; 4]; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/consts/const-fn-in-vec.stderr b/tests/ui/consts/const-fn-in-vec.stderr index 7c6b3bee9404b..dc502982abbb9 100644 --- a/tests/ui/consts/const-fn-in-vec.stderr +++ b/tests/ui/consts/const-fn-in-vec.stderr @@ -2,36 +2,39 @@ error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:1:47 | LL | static _MAYBE_STRINGS: [Option; 5] = [None; 5]; - | ^^^^ - | | - | the trait `Copy` is not implemented for `String`, which is required by `Option: Copy` - | help: create an inline `const` block: `const { None }` + | ^^^^ the trait `Copy` is not implemented for `String`, which is required by `Option: Copy` | = note: required for `Option` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array +help: create an inline `const` block + | +LL | static _MAYBE_STRINGS: [Option; 5] = [const { None }; 5]; + | ~~~~~~~~~~~~~~ error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:7:34 | LL | let _strings: [String; 5] = [String::new(); 5]; - | ^^^^^^^^^^^^^ - | | - | the trait `Copy` is not implemented for `String` - | help: create an inline `const` block: `const { String::new() }` + | ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String` | = note: the `Copy` trait is required because this value will be copied for each element of the array +help: create an inline `const` block + | +LL | let _strings: [String; 5] = [const { String::new() }; 5]; + | ~~~~~~~~~~~~~~~~~~~~~~~ error[E0277]: the trait bound `String: Copy` is not satisfied --> $DIR/const-fn-in-vec.rs:9:48 | LL | let _maybe_strings: [Option; 5] = [None; 5]; - | ^^^^ - | | - | the trait `Copy` is not implemented for `String`, which is required by `Option: Copy` - | help: create an inline `const` block: `const { None }` + | ^^^^ the trait `Copy` is not implemented for `String`, which is required by `Option: Copy` | = note: required for `Option` to implement `Copy` = note: the `Copy` trait is required because this value will be copied for each element of the array +help: create an inline `const` block + | +LL | let _maybe_strings: [Option; 5] = [const { None }; 5]; + | ~~~~~~~~~~~~~~ error: aborting due to 3 previous errors diff --git a/tests/ui/consts/effect_param.stderr b/tests/ui/consts/effect_param.stderr index dba5d49b7921e..3777e20e4c0ad 100644 --- a/tests/ui/consts/effect_param.stderr +++ b/tests/ui/consts/effect_param.stderr @@ -2,33 +2,49 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/effect_param.rs:11:9 | LL | i8::checked_sub::(42, 43); - | ^^^^^^^^^^^--------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^^ expected 0 generic arguments + | +help: remove these generics + | +LL - i8::checked_sub::(42, 43); +LL + i8::checked_sub(42, 43); + | error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied --> $DIR/effect_param.rs:13:9 | LL | i8::checked_sub::(42, 43); - | ^^^^^^^^^^^-------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^^ expected 0 generic arguments + | +help: remove these generics + | +LL - i8::checked_sub::(42, 43); +LL + i8::checked_sub(42, 43); + | error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied --> $DIR/effect_param.rs:4:9 | LL | i8::checked_sub::(42, 43); - | ^^^^^^^^^^^-------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^^ expected 0 generic arguments + | +help: remove these generics + | +LL - i8::checked_sub::(42, 43); +LL + i8::checked_sub(42, 43); + | error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied --> $DIR/effect_param.rs:6:9 | LL | i8::checked_sub::(42, 43); - | ^^^^^^^^^^^--------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^^ expected 0 generic arguments + | +help: remove these generics + | +LL - i8::checked_sub::(42, 43); +LL + i8::checked_sub(42, 43); + | error: aborting due to 4 previous errors diff --git a/tests/ui/consts/issue-104768.stderr b/tests/ui/consts/issue-104768.stderr index 8a4a41e4d68a8..29f8e6f522ef0 100644 --- a/tests/ui/consts/issue-104768.stderr +++ b/tests/ui/consts/issue-104768.stderr @@ -2,10 +2,12 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/issue-104768.rs:1:10 | LL | const A: &_ = 0_u32; - | ^^ - | | - | not allowed in type signatures - | help: replace with the correct type: `u32` + | ^^ not allowed in type signatures + | +help: replace with the correct type + | +LL | const A: u32 = 0_u32; + | ~~~ error: aborting due to 1 previous error diff --git a/tests/ui/consts/issue-39974.stderr b/tests/ui/consts/issue-39974.stderr index 114c4cfeaf7c0..8522e7e57c944 100644 --- a/tests/ui/consts/issue-39974.stderr +++ b/tests/ui/consts/issue-39974.stderr @@ -2,10 +2,12 @@ error[E0308]: mismatched types --> $DIR/issue-39974.rs:1:21 | LL | const LENGTH: f64 = 2; - | ^ - | | - | expected `f64`, found integer - | help: use a float literal: `2.0` + | ^ expected `f64`, found integer + | +help: use a float literal + | +LL | const LENGTH: f64 = 2.0; + | ~~~ error[E0308]: mismatched types --> $DIR/issue-39974.rs:5:19 diff --git a/tests/ui/consts/missing_assoc_const_type.stderr b/tests/ui/consts/missing_assoc_const_type.stderr index 28af1f0f321e6..5d3400a38e2ad 100644 --- a/tests/ui/consts/missing_assoc_const_type.stderr +++ b/tests/ui/consts/missing_assoc_const_type.stderr @@ -2,7 +2,12 @@ error: missing type for `const` item --> $DIR/missing_assoc_const_type.rs:12:17 | LL | const FIRST: = 10; - | ^ help: provide a type for the associated constant: `u8` + | ^ + | +help: provide a type for the associated constant + | +LL | const FIRST: u8 = 10; + | ++ error: aborting due to 1 previous error diff --git a/tests/ui/consts/missing_assoc_const_type2.stderr b/tests/ui/consts/missing_assoc_const_type2.stderr index 1255ca2d102b5..02621122bf5fc 100644 --- a/tests/ui/consts/missing_assoc_const_type2.stderr +++ b/tests/ui/consts/missing_assoc_const_type2.stderr @@ -2,7 +2,12 @@ error: missing type for `const` item --> $DIR/missing_assoc_const_type2.rs:12:17 | LL | const FIRST: = 10; - | ^ help: provide a type for the associated constant: `u8` + | ^ + | +help: provide a type for the associated constant + | +LL | const FIRST: u8 = 10; + | ++ error: aborting due to 1 previous error diff --git a/tests/ui/coroutine/unresolved-ct-var.stderr b/tests/ui/coroutine/unresolved-ct-var.stderr index 8b87bac05acb2..6fde35a05fe9e 100644 --- a/tests/ui/coroutine/unresolved-ct-var.stderr +++ b/tests/ui/coroutine/unresolved-ct-var.stderr @@ -2,15 +2,18 @@ error[E0277]: `[(); _]` is not a future --> $DIR/unresolved-ct-var.rs:6:45 | LL | let s = std::array::from_fn(|_| ()).await; - | ----------------------------^^^^^ - | | || - | | |`[(); _]` is not a future - | | help: remove the `.await` + | --------------------------- ^^^^^ `[(); _]` is not a future + | | | this call returns `[(); _]` | = help: the trait `Future` is not implemented for `[(); _]`, which is required by `[(); _]: IntoFuture` = note: [(); _] must be a future or must implement `IntoFuture` to be awaited = note: required for `[(); _]` to implement `IntoFuture` +help: remove the `.await` + | +LL - let s = std::array::from_fn(|_| ()).await; +LL + let s = std::array::from_fn(|_| ()); + | error: aborting due to 1 previous error diff --git a/tests/ui/cross-crate/unit-struct.stderr b/tests/ui/cross-crate/unit-struct.stderr index a7e3e4685a997..cc2f0799dadd3 100644 --- a/tests/ui/cross-crate/unit-struct.stderr +++ b/tests/ui/cross-crate/unit-struct.stderr @@ -2,12 +2,17 @@ error[E0423]: expected value, found struct `xcrate_unit_struct::StructWithFields --> $DIR/unit-struct.rs:9:13 | LL | let _ = xcrate_unit_struct::StructWithFields; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `xcrate_unit_struct::StructWithFields { foo: val }` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ::: $DIR/auxiliary/xcrate_unit_struct.rs:20:1 | LL | pub struct StructWithFields { | --------------------------- `xcrate_unit_struct::StructWithFields` defined here + | +help: use struct literal syntax instead + | +LL | let _ = xcrate_unit_struct::StructWithFields { foo: val }; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0423]: expected value, found struct `xcrate_unit_struct::StructWithPrivFields` --> $DIR/unit-struct.rs:11:13 diff --git a/tests/ui/delegation/bad-resolve.stderr b/tests/ui/delegation/bad-resolve.stderr index 883ff523bcfea..475b8ba186cf9 100644 --- a/tests/ui/delegation/bad-resolve.stderr +++ b/tests/ui/delegation/bad-resolve.stderr @@ -46,7 +46,12 @@ LL | fn bar() {} | -------- similarly named associated function `bar` defined here ... LL | reuse ::baz; - | ^^^ help: an associated function with a similar name exists: `bar` + | ^^^ + | +help: an associated function with a similar name exists + | +LL | reuse ::bar; + | ~~~ error[E0425]: cannot find function `foo` in this scope --> $DIR/bad-resolve.rs:35:11 diff --git a/tests/ui/deprecation/deprecation-sanity.stderr b/tests/ui/deprecation/deprecation-sanity.stderr index 383212ad9b4b8..830ad69c5681a 100644 --- a/tests/ui/deprecation/deprecation-sanity.stderr +++ b/tests/ui/deprecation/deprecation-sanity.stderr @@ -44,9 +44,13 @@ error[E0565]: literal in `deprecated` value must be a string --> $DIR/deprecation-sanity.rs:19:25 | LL | #[deprecated(note = b"test")] - | -^^^^^^ - | | - | help: consider removing the prefix + | ^^^^^^^ + | +help: consider removing the prefix + | +LL - #[deprecated(note = b"test")] +LL + #[deprecated(note = "test")] + | error[E0565]: item in `deprecated` must be a key/value pair --> $DIR/deprecation-sanity.rs:22:18 diff --git a/tests/ui/derives/deriving-meta-unknown-trait.stderr b/tests/ui/derives/deriving-meta-unknown-trait.stderr index 28753b8f9f288..9ddfd5c8b2da0 100644 --- a/tests/ui/derives/deriving-meta-unknown-trait.stderr +++ b/tests/ui/derives/deriving-meta-unknown-trait.stderr @@ -2,21 +2,30 @@ error: cannot find derive macro `Eqr` in this scope --> $DIR/deriving-meta-unknown-trait.rs:1:10 | LL | #[derive(Eqr)] - | ^^^ help: a derive macro with a similar name exists: `Eq` + | ^^^ --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named derive macro `Eq` defined here + | +help: a derive macro with a similar name exists + | +LL | #[derive(Eq)] + | ~~ error: cannot find derive macro `Eqr` in this scope --> $DIR/deriving-meta-unknown-trait.rs:1:10 | LL | #[derive(Eqr)] - | ^^^ help: a derive macro with a similar name exists: `Eq` + | ^^^ --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named derive macro `Eq` defined here | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: a derive macro with a similar name exists + | +LL | #[derive(Eq)] + | ~~ error: aborting due to 2 previous errors diff --git a/tests/ui/did_you_mean/issue-34337.stderr b/tests/ui/did_you_mean/issue-34337.stderr index c727a565dbe34..dda045b3dd559 100644 --- a/tests/ui/did_you_mean/issue-34337.stderr +++ b/tests/ui/did_you_mean/issue-34337.stderr @@ -2,10 +2,13 @@ error[E0596]: cannot borrow `key` as mutable, as it is not declared as mutable --> $DIR/issue-34337.rs:6:9 | LL | get(&mut key); - | ^^^^^^^^ - | | - | cannot borrow as mutable - | help: try removing `&mut` here + | ^^^^^^^^ cannot borrow as mutable + | +help: try removing `&mut` here + | +LL - get(&mut key); +LL + get(); + | error: aborting due to 1 previous error diff --git a/tests/ui/did_you_mean/issue-37139.stderr b/tests/ui/did_you_mean/issue-37139.stderr index a07d83b31db1d..ff05c31c11f8d 100644 --- a/tests/ui/did_you_mean/issue-37139.stderr +++ b/tests/ui/did_you_mean/issue-37139.stderr @@ -2,10 +2,13 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/issue-37139.rs:12:18 | LL | test(&mut x); - | ^^^^^^ - | | - | cannot borrow as mutable - | help: try removing `&mut` here + | ^^^^^^ cannot borrow as mutable + | +help: try removing `&mut` here + | +LL - test(&mut x); +LL + test(); + | error: aborting due to 1 previous error diff --git a/tests/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr b/tests/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr index 6f853ccab378a..2a26dad7a9374 100644 --- a/tests/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr +++ b/tests/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr @@ -2,31 +2,40 @@ error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:2:24 | LL | let sixteen: f32 = 16; - | --- ^^ - | | | - | | expected `f32`, found integer - | | help: use a float literal: `16.0` + | --- ^^ expected `f32`, found integer + | | | expected due to this + | +help: use a float literal + | +LL | let sixteen: f32 = 16.0; + | ~~~~ error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:5:38 | LL | let a_million_and_seventy: f64 = 1_000_070; - | --- ^^^^^^^^^ - | | | - | | expected `f64`, found integer - | | help: use a float literal: `1_000_070.0` + | --- ^^^^^^^^^ expected `f64`, found integer + | | | expected due to this + | +help: use a float literal + | +LL | let a_million_and_seventy: f64 = 1_000_070.0; + | ~~~~~~~~~~~ error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:8:30 | LL | let negative_nine: f32 = -9; - | --- ^^ - | | | - | | expected `f32`, found integer - | | help: use a float literal: `-9.0` + | --- ^^ expected `f32`, found integer + | | | expected due to this + | +help: use a float literal + | +LL | let negative_nine: f32 = -9.0; + | ~~~~ error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:15:30 diff --git a/tests/ui/did_you_mean/println-typo.stderr b/tests/ui/did_you_mean/println-typo.stderr index a1e0b1f1ba4f1..c2d6201fc60f1 100644 --- a/tests/ui/did_you_mean/println-typo.stderr +++ b/tests/ui/did_you_mean/println-typo.stderr @@ -2,10 +2,15 @@ error: cannot find macro `prinltn` in this scope --> $DIR/println-typo.rs:4:5 | LL | prinltn!(); - | ^^^^^^^ help: a macro with a similar name exists: `println` + | ^^^^^^^ --> $SRC_DIR/std/src/macros.rs:LL:COL | = note: similarly named macro `println` defined here + | +help: a macro with a similar name exists + | +LL | println!(); + | ~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/empty/empty-struct-braces-expr.stderr b/tests/ui/empty/empty-struct-braces-expr.stderr index 4604ebeaa8b98..384ef37f030da 100644 --- a/tests/ui/empty/empty-struct-braces-expr.stderr +++ b/tests/ui/empty/empty-struct-braces-expr.stderr @@ -104,25 +104,34 @@ error[E0599]: no variant or associated item named `Empty3` found for enum `empty --> $DIR/empty-struct-braces-expr.rs:25:19 | LL | let xe3 = XE::Empty3; - | ^^^^^^ - | | - | variant or associated item not found in `XE` - | help: there is a variant with a similar name: `XEmpty3` + | ^^^^^^ variant or associated item not found in `XE` + | +help: there is a variant with a similar name + | +LL | let xe3 = XE::XEmpty3; + | ~~~~~~~ error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope --> $DIR/empty-struct-braces-expr.rs:26:19 | LL | let xe3 = XE::Empty3(); - | ^^^^^^ - | | - | variant or associated item not found in `XE` - | help: there is a variant with a similar name: `XEmpty3` + | ^^^^^^ variant or associated item not found in `XE` + | +help: there is a variant with a similar name + | +LL | let xe3 = XE::XEmpty3(); + | ~~~~~~~ error[E0599]: no variant named `Empty1` found for enum `empty_struct::XE` --> $DIR/empty-struct-braces-expr.rs:28:9 | LL | XE::Empty1 {}; - | ^^^^^^ help: there is a variant with a similar name: `XEmpty3` + | ^^^^^^ + | +help: there is a variant with a similar name + | +LL | XE::XEmpty3 {}; + | ~~~~~~~ error: aborting due to 9 previous errors diff --git a/tests/ui/empty/empty-struct-tuple-pat.stderr b/tests/ui/empty/empty-struct-tuple-pat.stderr index 45001c7975324..05eee9e53d82e 100644 --- a/tests/ui/empty/empty-struct-tuple-pat.stderr +++ b/tests/ui/empty/empty-struct-tuple-pat.stderr @@ -29,7 +29,12 @@ LL | Empty4() | -------- `E::Empty4` defined here ... LL | E::Empty4 => () - | ^^^^^^^^^ help: use the tuple variant pattern syntax instead: `E::Empty4()` + | ^^^^^^^^^ + | +help: use the tuple variant pattern syntax instead + | +LL | E::Empty4() => () + | ~~~~~~~~~~~ error[E0532]: expected unit struct, unit variant or constant, found tuple variant `XE::XEmpty5` --> $DIR/empty-struct-tuple-pat.rs:33:9 diff --git a/tests/ui/empty/empty-struct-unit-pat.stderr b/tests/ui/empty/empty-struct-unit-pat.stderr index 5c0b4cffa9469..145568f7877cf 100644 --- a/tests/ui/empty/empty-struct-unit-pat.stderr +++ b/tests/ui/empty/empty-struct-unit-pat.stderr @@ -95,7 +95,12 @@ LL | Empty4 | ------ `E::Empty4` defined here ... LL | E::Empty4() => () - | ^^^^^^^^^^^ help: use this syntax instead: `E::Empty4` + | ^^^^^^^^^^^ + | +help: use this syntax instead + | +LL | E::Empty4 => () + | ~~~~~~~~~ error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XEmpty4` --> $DIR/empty-struct-unit-pat.rs:41:9 @@ -126,7 +131,12 @@ LL | Empty4 | ------ `E::Empty4` defined here ... LL | E::Empty4(..) => () - | ^^^^^^^^^^^^^ help: use this syntax instead: `E::Empty4` + | ^^^^^^^^^^^^^ + | +help: use this syntax instead + | +LL | E::Empty4 => () + | ~~~~~~~~~ error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XEmpty4` --> $DIR/empty-struct-unit-pat.rs:50:9 diff --git a/tests/ui/error-codes/E0107.stderr b/tests/ui/error-codes/E0107.stderr index 3f540eb08bc7c..c6317270f9b12 100644 --- a/tests/ui/error-codes/E0107.stderr +++ b/tests/ui/error-codes/E0107.stderr @@ -20,113 +20,137 @@ error[E0107]: enum takes 0 lifetime arguments but 1 lifetime argument was suppli --> $DIR/E0107.rs:17:10 | LL | bar: Bar<'a>, - | ^^^---- help: remove these generics - | | - | expected 0 lifetime arguments + | ^^^ expected 0 lifetime arguments | note: enum defined here, with 0 lifetime parameters --> $DIR/E0107.rs:6:6 | LL | enum Bar { | ^^^ +help: remove these generics + | +LL - bar: Bar<'a>, +LL + bar: Bar, + | error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were supplied --> $DIR/E0107.rs:21:11 | LL | foo2: Foo<'a, 'b, 'c>, - | ^^^ ------ help: remove these lifetime arguments - | | - | expected 1 lifetime argument + | ^^^ expected 1 lifetime argument | note: struct defined here, with 1 lifetime parameter: `'a` --> $DIR/E0107.rs:1:8 | LL | struct Foo<'a>(&'a str); | ^^^ -- +help: remove these lifetime arguments + | +LL - foo2: Foo<'a, 'b, 'c>, +LL + foo2: Foo<'a, >, + | error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied --> $DIR/E0107.rs:25:11 | LL | qux1: Qux<'a, 'b, i32>, - | ^^^ -- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^ expected 1 lifetime argument | note: struct defined here, with 1 lifetime parameter: `'a` --> $DIR/E0107.rs:3:8 | LL | struct Qux<'a, T>(&'a T); | ^^^ -- +help: remove this lifetime argument + | +LL - qux1: Qux<'a, 'b, i32>, +LL + qux1: Qux<'a, , i32>, + | error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied --> $DIR/E0107.rs:29:11 | LL | qux2: Qux<'a, i32, 'b>, - | ^^^ -- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^ expected 1 lifetime argument | note: struct defined here, with 1 lifetime parameter: `'a` --> $DIR/E0107.rs:3:8 | LL | struct Qux<'a, T>(&'a T); | ^^^ -- +help: remove this lifetime argument + | +LL - qux2: Qux<'a, i32, 'b>, +LL + qux2: Qux<'a, i32, >, + | error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were supplied --> $DIR/E0107.rs:33:11 | LL | qux3: Qux<'a, 'b, 'c, i32>, - | ^^^ ------ help: remove these lifetime arguments - | | - | expected 1 lifetime argument + | ^^^ expected 1 lifetime argument | note: struct defined here, with 1 lifetime parameter: `'a` --> $DIR/E0107.rs:3:8 | LL | struct Qux<'a, T>(&'a T); | ^^^ -- +help: remove these lifetime arguments + | +LL - qux3: Qux<'a, 'b, 'c, i32>, +LL + qux3: Qux<'a, , i32>, + | error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were supplied --> $DIR/E0107.rs:37:11 | LL | qux4: Qux<'a, i32, 'b, 'c>, - | ^^^ ------ help: remove these lifetime arguments - | | - | expected 1 lifetime argument + | ^^^ expected 1 lifetime argument | note: struct defined here, with 1 lifetime parameter: `'a` --> $DIR/E0107.rs:3:8 | LL | struct Qux<'a, T>(&'a T); | ^^^ -- +help: remove these lifetime arguments + | +LL - qux4: Qux<'a, i32, 'b, 'c>, +LL + qux4: Qux<'a, i32, >, + | error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were supplied --> $DIR/E0107.rs:41:11 | LL | qux5: Qux<'a, 'b, i32, 'c>, - | ^^^ -- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^ expected 1 lifetime argument | note: struct defined here, with 1 lifetime parameter: `'a` --> $DIR/E0107.rs:3:8 | LL | struct Qux<'a, T>(&'a T); | ^^^ -- +help: remove this lifetime argument + | +LL - qux5: Qux<'a, 'b, i32, 'c>, +LL + qux5: Qux<'a, , i32, 'c>, + | error[E0107]: struct takes 0 lifetime arguments but 2 lifetime arguments were supplied --> $DIR/E0107.rs:45:11 | LL | quux: Quux<'a, i32, 'b>, - | ^^^^ -- help: remove this lifetime argument - | | - | expected 0 lifetime arguments + | ^^^^ expected 0 lifetime arguments | note: struct defined here, with 0 lifetime parameters --> $DIR/E0107.rs:4:8 | LL | struct Quux(T); | ^^^^ +help: remove this lifetime argument + | +LL - quux: Quux<'a, i32, 'b>, +LL + quux: Quux<, i32, 'b>, + | error[E0107]: trait takes 0 generic arguments but 2 generic arguments were supplied --> $DIR/E0107.rs:55:27 diff --git a/tests/ui/error-codes/E0121.stderr b/tests/ui/error-codes/E0121.stderr index 023d7e011bf3a..6d2cf467435d2 100644 --- a/tests/ui/error-codes/E0121.stderr +++ b/tests/ui/error-codes/E0121.stderr @@ -2,19 +2,23 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/E0121.rs:1:13 | LL | fn foo() -> _ { 5 } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `i32` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn foo() -> i32 { 5 } + | ~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/E0121.rs:3:13 | LL | static BAR: _ = "test"; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `&str` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | static BAR: &str = "test"; + | ~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/error-codes/E0393.stderr b/tests/ui/error-codes/E0393.stderr index 4083fa23e87aa..49945c85a4d7f 100644 --- a/tests/ui/error-codes/E0393.stderr +++ b/tests/ui/error-codes/E0393.stderr @@ -5,9 +5,13 @@ LL | trait A {} | --------------- type parameter `T` must be specified for this LL | LL | fn together_we_will_rule_the_galaxy(son: &dyn A) {} - | ^ help: set the type parameter to the desired type: `A` + | ^ | = note: because of the default `Self` reference, type parameters must be specified on object types +help: set the type parameter to the desired type + | +LL | fn together_we_will_rule_the_galaxy(son: &dyn A) {} + | ~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0565-2.stderr b/tests/ui/error-codes/E0565-2.stderr index 42199351c3da2..4f3820b52119e 100644 --- a/tests/ui/error-codes/E0565-2.stderr +++ b/tests/ui/error-codes/E0565-2.stderr @@ -2,9 +2,13 @@ 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 + | ^^^^^^^ + | +help: consider removing the prefix + | +LL - #[deprecated(since = b"1.29", note = "hi")] +LL + #[deprecated(since = "1.29", note = "hi")] + | error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0604.stderr b/tests/ui/error-codes/E0604.stderr index e91f74d6b3fd6..d7c944d53d046 100644 --- a/tests/ui/error-codes/E0604.stderr +++ b/tests/ui/error-codes/E0604.stderr @@ -2,10 +2,12 @@ error[E0604]: only `u8` can be cast as `char`, not `u32` --> $DIR/E0604.rs:2:5 | LL | 1u32 as char; - | ^^^^^^^^^^^^ - | | - | invalid cast - | help: try `char::from_u32` instead: `char::from_u32(1u32)` + | ^^^^^^^^^^^^ invalid cast + | +help: try `char::from_u32` instead + | +LL | char::from_u32(1u32); + | ~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/error-codes/E0620.stderr b/tests/ui/error-codes/E0620.stderr index 644ba813c9608..bdb28eee74100 100644 --- a/tests/ui/error-codes/E0620.stderr +++ b/tests/ui/error-codes/E0620.stderr @@ -2,9 +2,12 @@ error[E0620]: cast to unsized type: `&[usize; 2]` as `[usize]` --> $DIR/E0620.rs:2:16 | LL | let _foo = &[1_usize, 2] as [usize]; - | ^^^^^^^^^^^^^^^^^------- - | | - | help: try casting to a reference instead: `&[usize]` + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: try casting to a reference instead + | +LL | let _foo = &[1_usize, 2] as &[usize]; + | ~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/error-festival.stderr b/tests/ui/error-festival.stderr index 9d75671c4e6b4..f42b753d89b72 100644 --- a/tests/ui/error-festival.stderr +++ b/tests/ui/error-festival.stderr @@ -2,7 +2,12 @@ error[E0425]: cannot find value `y` in this scope --> $DIR/error-festival.rs:14:5 | LL | y = 2; - | ^ help: a local variable with a similar name exists: `x` + | ^ + | +help: a local variable with a similar name exists + | +LL | x = 2; + | ~ error[E0603]: constant `FOO` is private --> $DIR/error-festival.rs:22:10 @@ -48,10 +53,12 @@ error[E0604]: only `u8` can be cast as `char`, not `u32` --> $DIR/error-festival.rs:25:5 | LL | 0u32 as char; - | ^^^^^^^^^^^^ - | | - | invalid cast - | help: try `char::from_u32` instead: `char::from_u32(0u32)` + | ^^^^^^^^^^^^ invalid cast + | +help: try `char::from_u32` instead + | +LL | char::from_u32(0u32); + | ~~~~~~~~~~~~~~~~~~~~ error[E0605]: non-primitive cast: `u8` as `Vec` --> $DIR/error-festival.rs:29:5 diff --git a/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr b/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr index 7aa66be0d0977..56c5b227ffd4e 100644 --- a/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr +++ b/tests/ui/errors/remap-path-prefix-reverse.local-self.stderr @@ -2,12 +2,17 @@ error[E0423]: expected value, found struct `remapped_dep::SomeStruct` --> $DIR/remap-path-prefix-reverse.rs:16:13 | LL | let _ = remapped_dep::SomeStruct; // ~ERROR E0423 - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `remapped_dep::SomeStruct {}` + | ^^^^^^^^^^^^^^^^^^^^^^^^ | ::: remapped-aux/remapped_dep.rs:4:1 | LL | pub struct SomeStruct {} // This line should be show as part of the error. | --------------------- `remapped_dep::SomeStruct` defined here + | +help: use struct literal syntax instead + | +LL | let _ = remapped_dep::SomeStruct {}; // ~ERROR E0423 + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr b/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr index 7aa66be0d0977..56c5b227ffd4e 100644 --- a/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr +++ b/tests/ui/errors/remap-path-prefix-reverse.remapped-self.stderr @@ -2,12 +2,17 @@ error[E0423]: expected value, found struct `remapped_dep::SomeStruct` --> $DIR/remap-path-prefix-reverse.rs:16:13 | LL | let _ = remapped_dep::SomeStruct; // ~ERROR E0423 - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `remapped_dep::SomeStruct {}` + | ^^^^^^^^^^^^^^^^^^^^^^^^ | ::: remapped-aux/remapped_dep.rs:4:1 | LL | pub struct SomeStruct {} // This line should be show as part of the error. | --------------------- `remapped_dep::SomeStruct` defined here + | +help: use struct literal syntax instead + | +LL | let _ = remapped_dep::SomeStruct {}; // ~ERROR E0423 + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/expr/if/bad-if-let-suggestion.stderr b/tests/ui/expr/if/bad-if-let-suggestion.stderr index 0d1f895bd82bf..59bce4af7ecb2 100644 --- a/tests/ui/expr/if/bad-if-let-suggestion.stderr +++ b/tests/ui/expr/if/bad-if-let-suggestion.stderr @@ -27,7 +27,12 @@ LL | fn a() { | ------ similarly named function `a` defined here ... LL | if (i + j) = i {} - | ^ help: a function with a similar name exists: `a` + | ^ + | +help: a function with a similar name exists + | +LL | if (a + j) = i {} + | ~ error[E0425]: cannot find value `j` in this scope --> $DIR/bad-if-let-suggestion.rs:9:13 @@ -36,7 +41,12 @@ LL | fn a() { | ------ similarly named function `a` defined here ... LL | if (i + j) = i {} - | ^ help: a function with a similar name exists: `a` + | ^ + | +help: a function with a similar name exists + | +LL | if (i + a) = i {} + | ~ error[E0425]: cannot find value `i` in this scope --> $DIR/bad-if-let-suggestion.rs:9:18 @@ -45,7 +55,12 @@ LL | fn a() { | ------ similarly named function `a` defined here ... LL | if (i + j) = i {} - | ^ help: a function with a similar name exists: `a` + | ^ + | +help: a function with a similar name exists + | +LL | if (i + j) = a {} + | ~ error[E0425]: cannot find value `x` in this scope --> $DIR/bad-if-let-suggestion.rs:16:8 @@ -54,7 +69,12 @@ LL | fn a() { | ------ similarly named function `a` defined here ... LL | if x[0] = 1 {} - | ^ help: a function with a similar name exists: `a` + | ^ + | +help: a function with a similar name exists + | +LL | if a[0] = 1 {} + | ~ error[E0308]: mismatched types --> $DIR/bad-if-let-suggestion.rs:2:8 diff --git a/tests/ui/expr/issue-22933-2.stderr b/tests/ui/expr/issue-22933-2.stderr index 8cda8598f3c4f..dadc31213621c 100644 --- a/tests/ui/expr/issue-22933-2.stderr +++ b/tests/ui/expr/issue-22933-2.stderr @@ -5,10 +5,12 @@ LL | enum Delicious { | -------------- variant or associated item `PIE` not found for this enum ... LL | ApplePie = Delicious::Apple as isize | Delicious::PIE as isize, - | ^^^ - | | - | variant or associated item not found in `Delicious` - | help: there is a variant with a similar name: `Pie` + | ^^^ variant or associated item not found in `Delicious` + | +help: there is a variant with a similar name + | +LL | ApplePie = Delicious::Apple as isize | Delicious::Pie as isize, + | ~~~ error: aborting due to 1 previous error diff --git a/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-missing-impl.stderr b/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-missing-impl.stderr index 00b8c0eef989a..7944d86e55d20 100644 --- a/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-missing-impl.stderr +++ b/tests/ui/feature-gates/feature-gate-dispatch-from-dyn-missing-impl.stderr @@ -1,9 +1,6 @@ error[E0038]: the trait `Trait` cannot be made into an object --> $DIR/feature-gate-dispatch-from-dyn-missing-impl.rs:32:25 | -LL | fn ptr(self: Ptr); - | --------- help: consider changing method `ptr`'s `self` parameter to be `&self`: `&Self` -... LL | Ptr(Box::new(4)) as Ptr; | ^^^^^^^^^^^^^^ `Trait` cannot be made into an object | @@ -15,13 +12,14 @@ LL | trait Trait { LL | fn ptr(self: Ptr); | ^^^^^^^^^ ...because method `ptr`'s `self` parameter cannot be dispatched on = help: only type `i32` implements the trait, consider using it directly instead +help: consider changing method `ptr`'s `self` parameter to be `&self` + | +LL | fn ptr(self: &Self); + | ~~~~~ error[E0038]: the trait `Trait` cannot be made into an object --> $DIR/feature-gate-dispatch-from-dyn-missing-impl.rs:32:5 | -LL | fn ptr(self: Ptr); - | --------- help: consider changing method `ptr`'s `self` parameter to be `&self`: `&Self` -... LL | Ptr(Box::new(4)) as Ptr; | ^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object | @@ -34,6 +32,10 @@ LL | fn ptr(self: Ptr); | ^^^^^^^^^ ...because method `ptr`'s `self` parameter cannot be dispatched on = help: only type `i32` implements the trait, consider using it directly instead = note: required for the cast from `Ptr<{integer}>` to `Ptr` +help: consider changing method `ptr`'s `self` parameter to be `&self` + | +LL | fn ptr(self: &Self); + | ~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr b/tests/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr index 97370f0489b56..717274f061ec6 100644 --- a/tests/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr +++ b/tests/ui/feature-gates/feature-gate-generic_arg_infer.normal.stderr @@ -14,11 +14,15 @@ error[E0658]: using `_` for array lengths is unstable --> $DIR/feature-gate-generic_arg_infer.rs:14:18 | LL | let _y: [u8; _] = [0; 3]; - | ^ help: consider specifying the array length: `3` + | ^ | = note: see issue #85077 for more information = help: add `#![feature(generic_arg_infer)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: consider specifying the array length + | +LL | let _y: [u8; 3] = [0; 3]; + | ~ error[E0747]: type provided when a constant was expected --> $DIR/feature-gate-generic_arg_infer.rs:20:20 diff --git a/tests/ui/feature-gates/feature-gate-negate-unsigned.stderr b/tests/ui/feature-gates/feature-gate-negate-unsigned.stderr index d1f4ed5cb04b8..696326157ce29 100644 --- a/tests/ui/feature-gates/feature-gate-negate-unsigned.stderr +++ b/tests/ui/feature-gates/feature-gate-negate-unsigned.stderr @@ -2,12 +2,13 @@ error[E0600]: cannot apply unary operator `-` to type `usize` --> $DIR/feature-gate-negate-unsigned.rs:10:23 | LL | let _max: usize = -1; - | ^^ - | | - | cannot apply unary operator `-` - | help: you may have meant the maximum value of `usize`: `usize::MAX` + | ^^ cannot apply unary operator `-` | = note: unsigned values cannot be negated +help: you may have meant the maximum value of `usize` + | +LL | let _max: usize = usize::MAX; + | ~~~~~~~~~~ error[E0600]: cannot apply unary operator `-` to type `u8` --> $DIR/feature-gate-negate-unsigned.rs:14:14 diff --git a/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr b/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr index 1b9febd431d6f..06a606b09dc97 100644 --- a/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr +++ b/tests/ui/feature-gates/feature-gate-unboxed-closures-manual-impls.stderr @@ -89,13 +89,14 @@ error[E0053]: method `call` has an incompatible type for trait --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:13:32 | LL | extern "rust-call" fn call(self, args: ()) -> () {} - | ^^^^ - | | - | expected `&Foo`, found `Foo` - | help: change the self-receiver type to match the trait: `&self` + | ^^^^ expected `&Foo`, found `Foo` | = note: expected signature `extern "rust-call" fn(&Foo, ()) -> _` found signature `extern "rust-call" fn(Foo, ())` +help: change the self-receiver type to match the trait + | +LL | extern "rust-call" fn call(&self, args: ()) -> () {} + | ~~~~~ error[E0183]: manual implementations of `FnOnce` are experimental --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:18:6 @@ -158,13 +159,14 @@ error[E0053]: method `call_mut` has an incompatible type for trait --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:30:36 | LL | extern "rust-call" fn call_mut(&self, args: ()) -> () {} - | ^^^^^ - | | - | types differ in mutability - | help: change the self-receiver type to match the trait: `&mut self` + | ^^^^^ types differ in mutability | = note: expected signature `extern "rust-call" fn(&mut Bar, ()) -> _` found signature `extern "rust-call" fn(&Bar, ())` +help: change the self-receiver type to match the trait + | +LL | extern "rust-call" fn call_mut(&mut self, args: ()) -> () {} + | ~~~~~~~~~ error[E0046]: not all trait items implemented, missing: `Output` --> $DIR/feature-gate-unboxed-closures-manual-impls.rs:35:1 diff --git a/tests/ui/fmt/format-args-capture-issue-102057.stderr b/tests/ui/fmt/format-args-capture-issue-102057.stderr index f2d625e7f8dc8..0ac5684c09a15 100644 --- a/tests/ui/fmt/format-args-capture-issue-102057.stderr +++ b/tests/ui/fmt/format-args-capture-issue-102057.stderr @@ -14,31 +14,56 @@ error[E0425]: cannot find value `b` in this scope --> $DIR/format-args-capture-issue-102057.rs:9:22 | LL | format!("\x7Ba} {b}"); - | ^ help: a local variable with a similar name exists: `a` + | ^ + | +help: a local variable with a similar name exists + | +LL | format!("\x7Ba} {a}"); + | ~ error[E0425]: cannot find value `b` in this scope --> $DIR/format-args-capture-issue-102057.rs:11:25 | LL | format!("\x7Ba\x7D {b}"); - | ^ help: a local variable with a similar name exists: `a` + | ^ + | +help: a local variable with a similar name exists + | +LL | format!("\x7Ba\x7D {a}"); + | ~ error[E0425]: cannot find value `b` in this scope --> $DIR/format-args-capture-issue-102057.rs:13:25 | LL | format!("\x7Ba} \x7Bb}"); - | ^ help: a local variable with a similar name exists: `a` + | ^ + | +help: a local variable with a similar name exists + | +LL | format!("\x7Ba} \x7Ba}"); + | ~ error[E0425]: cannot find value `b` in this scope --> $DIR/format-args-capture-issue-102057.rs:15:28 | LL | format!("\x7Ba\x7D \x7Bb}"); - | ^ help: a local variable with a similar name exists: `a` + | ^ + | +help: a local variable with a similar name exists + | +LL | format!("\x7Ba\x7D \x7Ba}"); + | ~ error[E0425]: cannot find value `b` in this scope --> $DIR/format-args-capture-issue-102057.rs:17:28 | LL | format!("\x7Ba\x7D \x7Bb\x7D"); - | ^ help: a local variable with a similar name exists: `a` + | ^ + | +help: a local variable with a similar name exists + | +LL | format!("\x7Ba\x7D \x7Ba\x7D"); + | ~ error: aborting due to 7 previous errors diff --git a/tests/ui/fmt/format-args-capture-issue-94010.stderr b/tests/ui/fmt/format-args-capture-issue-94010.stderr index ed90dc855360a..92946be532298 100644 --- a/tests/ui/fmt/format-args-capture-issue-94010.stderr +++ b/tests/ui/fmt/format-args-capture-issue-94010.stderr @@ -4,7 +4,12 @@ error[E0425]: cannot find value `foo` in this scope LL | const FOO: i32 = 123; | --------------------- similarly named constant `FOO` defined here LL | println!("{foo:X}"); - | ^^^ help: a constant with a similar name exists (notice the capitalization): `FOO` + | ^^^ + | +help: a constant with a similar name exists (notice the capitalization difference) + | +LL | println!("{FOO:X}"); + | ~~~ error[E0425]: cannot find value `foo` in this scope --> $DIR/format-args-capture-issue-94010.rs:5:18 @@ -13,7 +18,12 @@ LL | const FOO: i32 = 123; | --------------------- similarly named constant `FOO` defined here ... LL | println!("{:.foo$}", 0); - | ^^^ help: a constant with a similar name exists (notice the capitalization): `FOO` + | ^^^ + | +help: a constant with a similar name exists (notice the capitalization difference) + | +LL | println!("{:.FOO$}", 0); + | ~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/fn/issue-80179.stderr b/tests/ui/fn/issue-80179.stderr index f5d6c44db7511..9d3577ff7b8d0 100644 --- a/tests/ui/fn/issue-80179.stderr +++ b/tests/ui/fn/issue-80179.stderr @@ -2,21 +2,24 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/issue-80179.rs:10:24 | LL | fn returns_fn_ptr() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `fn() -> i32` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn returns_fn_ptr() -> fn() -> i32 { + | ~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/issue-80179.rs:18:25 | LL | fn returns_closure() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl Fn() -> i32` + | ^ not allowed in type signatures | = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html +help: replace with an appropriate return type + | +LL | fn returns_closure() -> impl Fn() -> i32 { + | ~~~~~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/fn/suggest-return-closure.stderr b/tests/ui/fn/suggest-return-closure.stderr index d276ce8be2ba5..b2ce1e92d9893 100644 --- a/tests/ui/fn/suggest-return-closure.stderr +++ b/tests/ui/fn/suggest-return-closure.stderr @@ -2,43 +2,48 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/suggest-return-closure.rs:1:17 | LL | fn fn_once() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl FnOnce()` + | ^ not allowed in type signatures | = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html +help: replace with an appropriate return type + | +LL | fn fn_once() -> impl FnOnce() { + | ~~~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/suggest-return-closure.rs:13:16 | LL | fn fn_mut() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl FnMut(char)` + | ^ not allowed in type signatures | = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html +help: replace with an appropriate return type + | +LL | fn fn_mut() -> impl FnMut(char) { + | ~~~~~~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/suggest-return-closure.rs:32:13 | LL | fn fun() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl Fn() -> i32` + | ^ not allowed in type signatures | = note: for more information on `Fn` traits and closure types, see https://doc.rust-lang.org/book/ch13-01-closures.html +help: replace with an appropriate return type + | +LL | fn fun() -> impl Fn() -> i32 { + | ~~~~~~~~~~~~~~~~ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/suggest-return-closure.rs:23:9 | -LL | let x = String::new(); - | - help: consider changing this to be mutable: `mut x` -... LL | x.push(c); | ^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | let mut x = String::new(); + | ~~~~~ error[E0597]: `x` does not live long enough --> $DIR/suggest-return-closure.rs:23:9 diff --git a/tests/ui/fn/suggest-return-future.stderr b/tests/ui/fn/suggest-return-future.stderr index a4c8b5d8c4b5d..dd43e99b083f2 100644 --- a/tests/ui/fn/suggest-return-future.stderr +++ b/tests/ui/fn/suggest-return-future.stderr @@ -2,19 +2,23 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/suggest-return-future.rs:7:13 | LL | fn foo() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl Future` + | ^ not allowed in type signatures + | +help: replace with an appropriate return type + | +LL | fn foo() -> impl Future { + | ~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/suggest-return-future.rs:15:13 | LL | fn bar() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl Future` + | ^ not allowed in type signatures + | +help: replace with an appropriate return type + | +LL | fn bar() -> impl Future { + | ~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/generic-associated-types/equality-bound.stderr b/tests/ui/generic-associated-types/equality-bound.stderr index a054c06caebde..e598c3d2f8f68 100644 --- a/tests/ui/generic-associated-types/equality-bound.stderr +++ b/tests/ui/generic-associated-types/equality-bound.stderr @@ -114,28 +114,43 @@ error[E0412]: cannot find type `A` in this scope --> $DIR/equality-bound.rs:20:79 | LL | fn from_iter(_: T) -> Self where T: IntoIterator, IntoIterator::Item = A, - | ^ help: a struct with a similar name exists: `K` + | ^ ... LL | struct K {} | -------- similarly named struct `K` defined here + | +help: a struct with a similar name exists + | +LL | fn from_iter(_: T) -> Self where T: IntoIterator, IntoIterator::Item = K, + | ~ error[E0412]: cannot find type `A` in this scope --> $DIR/equality-bound.rs:31:68 | LL | fn from_iter(_: T) -> Self where T: IntoIterator, T::Item = A, - | ^ help: a struct with a similar name exists: `K` + | ^ ... LL | struct K {} | -------- similarly named struct `K` defined here + | +help: a struct with a similar name exists + | +LL | fn from_iter(_: T) -> Self where T: IntoIterator, T::Item = K, + | ~ error[E0412]: cannot find type `A` in this scope --> $DIR/equality-bound.rs:42:76 | LL | fn from_iter(_: T) -> Self where IntoIterator::Item = A, - | ^ help: a struct with a similar name exists: `K` + | ^ ... LL | struct K {} | -------- similarly named struct `K` defined here + | +help: a struct with a similar name exists + | +LL | fn from_iter(_: T) -> Self where IntoIterator::Item = K, + | ~ error[E0412]: cannot find type `A` in this scope --> $DIR/equality-bound.rs:53:65 @@ -144,7 +159,12 @@ LL | struct K {} | -------- similarly named struct `K` defined here ... LL | fn from_iter(_: T) -> Self where T::Item = A, - | ^ help: a struct with a similar name exists: `K` + | ^ + | +help: a struct with a similar name exists + | +LL | fn from_iter(_: T) -> Self where T::Item = K, + | ~ error[E0412]: cannot find type `A` in this scope --> $DIR/equality-bound.rs:64:62 @@ -153,7 +173,12 @@ LL | struct K {} | -------- similarly named struct `K` defined here ... LL | fn from_iter(_: T) -> Self where IntoIterator::Item = A, T: IntoIterator, - | ^ help: a struct with a similar name exists: `K` + | ^ + | +help: a struct with a similar name exists + | +LL | fn from_iter(_: T) -> Self where IntoIterator::Item = K, T: IntoIterator, + | ~ error[E0412]: cannot find type `A` in this scope --> $DIR/equality-bound.rs:75:51 @@ -162,16 +187,23 @@ LL | struct K {} | -------- similarly named struct `K` defined here ... LL | fn from_iter(_: T) -> Self where T::Item = A, T: IntoIterator, - | ^ help: a struct with a similar name exists: `K` + | ^ + | +help: a struct with a similar name exists + | +LL | fn from_iter(_: T) -> Self where T::Item = K, T: IntoIterator, + | ~ error[E0433]: failed to resolve: use of undeclared type `I` --> $DIR/equality-bound.rs:9:41 | LL | fn sum3(i: J) -> i32 where I::Item = i32 { - | ^ - | | - | use of undeclared type `I` - | help: a type parameter with a similar name exists: `J` + | ^ use of undeclared type `I` + | +help: a type parameter with a similar name exists + | +LL | fn sum3(i: J) -> i32 where J::Item = i32 { + | ~ error: aborting due to 16 previous errors diff --git a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr index fcd3e7d9aace8..18f37207ee557 100644 --- a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr +++ b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr @@ -43,15 +43,18 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 | LL | fn foo<'a>(arg: Box>) {} - | ^---- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 | LL | type Y<'a>; | ^ +help: remove these generics + | +LL - fn foo<'a>(arg: Box>) {} +LL + fn foo<'a>(arg: Box>) {} + | error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 @@ -74,9 +77,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 | LL | fn foo<'a>(arg: Box>) {} - | ^---- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 @@ -84,6 +85,11 @@ note: associated type defined here, with 0 generic parameters LL | type Y<'a>; | ^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: remove these generics + | +LL - fn foo<'a>(arg: Box>) {} +LL + fn foo<'a>(arg: Box>) {} + | error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 @@ -106,9 +112,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 | LL | fn foo<'a>(arg: Box>) {} - | ^---- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 @@ -116,6 +120,11 @@ note: associated type defined here, with 0 generic parameters LL | type Y<'a>; | ^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: remove these generics + | +LL - fn foo<'a>(arg: Box>) {} +LL + fn foo<'a>(arg: Box>) {} + | error[E0224]: at least one trait is required for an object type --> $DIR/gat-trait-path-parenthesised-args.rs:5:29 diff --git a/tests/ui/generic-associated-types/issue-70304.stderr b/tests/ui/generic-associated-types/issue-70304.stderr index 9b02c1b076837..19f1a864073ad 100644 --- a/tests/ui/generic-associated-types/issue-70304.stderr +++ b/tests/ui/generic-associated-types/issue-70304.stderr @@ -20,12 +20,14 @@ error: missing required bound on `Cursor` --> $DIR/issue-70304.rs:2:5 | LL | type Cursor<'a>: DocCursor<'a>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'a` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Cursor<'a>: DocCursor<'a> where Self: 'a; + | ++++++++++++++ error: aborting due to 3 previous errors diff --git a/tests/ui/generic-associated-types/issue-80433.stderr b/tests/ui/generic-associated-types/issue-80433.stderr index 8ab6fdcb81573..6f17df6f0239c 100644 --- a/tests/ui/generic-associated-types/issue-80433.stderr +++ b/tests/ui/generic-associated-types/issue-80433.stderr @@ -2,12 +2,14 @@ error: missing required bound on `Output` --> $DIR/issue-80433.rs:7:5 | LL | type Output<'a>; - | ^^^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'a` + | ^^^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Output<'a> where Self: 'a; + | ++++++++++++++ error[E0107]: missing generics for associated type `TestMut::Output` --> $DIR/issue-80433.rs:21:47 diff --git a/tests/ui/generic-associated-types/issue-86787.stderr b/tests/ui/generic-associated-types/issue-86787.stderr index 00795abbd05d4..b937cda56a3a2 100644 --- a/tests/ui/generic-associated-types/issue-86787.stderr +++ b/tests/ui/generic-associated-types/issue-86787.stderr @@ -2,12 +2,14 @@ error: missing required bound on `TRef` --> $DIR/issue-86787.rs:10:5 | LL | type TRef<'a>; - | ^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'a` + | ^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type TRef<'a> where Self: 'a; + | ++++++++++++++ error[E0276]: impl has stricter requirements than trait --> $DIR/issue-86787.rs:25:37 diff --git a/tests/ui/generic-associated-types/parameter_number_and_kind.stderr b/tests/ui/generic-associated-types/parameter_number_and_kind.stderr index 4523044b5886b..9eb0b8ca641cb 100644 --- a/tests/ui/generic-associated-types/parameter_number_and_kind.stderr +++ b/tests/ui/generic-associated-types/parameter_number_and_kind.stderr @@ -2,15 +2,18 @@ error[E0107]: associated type takes 1 lifetime argument but 2 lifetime arguments --> $DIR/parameter_number_and_kind.rs:11:24 | LL | type FErr1 = Self::E<'static, 'static>; - | ^ ------- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^ expected 1 lifetime argument | note: associated type defined here, with 1 lifetime parameter: `'a` --> $DIR/parameter_number_and_kind.rs:8:10 | LL | type E<'a, T>; | ^ -- +help: remove this lifetime argument + | +LL - type FErr1 = Self::E<'static, 'static>; +LL + type FErr1 = Self::E<'static, >; + | error[E0107]: associated type takes 1 generic argument but 0 generic arguments were supplied --> $DIR/parameter_number_and_kind.rs:11:24 @@ -32,15 +35,18 @@ error[E0107]: associated type takes 1 generic argument but 2 generic arguments w --> $DIR/parameter_number_and_kind.rs:14:27 | LL | type FErr2 = Self::E<'static, T, u32>; - | ^ --- help: remove this generic argument - | | - | expected 1 generic argument + | ^ expected 1 generic argument | note: associated type defined here, with 1 generic parameter: `T` --> $DIR/parameter_number_and_kind.rs:8:10 | LL | type E<'a, T>; | ^ - +help: remove this generic argument + | +LL - type FErr2 = Self::E<'static, T, u32>; +LL + type FErr2 = Self::E<'static, T, >; + | error: aborting due to 3 previous errors diff --git a/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr b/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr index 2090f75aed328..f73022922a5b3 100644 --- a/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr +++ b/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr @@ -18,15 +18,18 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/trait-path-type-error-once-implemented.rs:6:29 | LL | fn f2<'a>(arg : Box = &'a ()>>) {} - | ^--- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/trait-path-type-error-once-implemented.rs:2:10 | LL | type Y<'a>; | ^ +help: remove these generics + | +LL - fn f2<'a>(arg : Box = &'a ()>>) {} +LL + fn f2<'a>(arg : Box>) {} + | error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied --> $DIR/trait-path-type-error-once-implemented.rs:6:29 @@ -49,9 +52,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/trait-path-type-error-once-implemented.rs:6:29 | LL | fn f2<'a>(arg : Box = &'a ()>>) {} - | ^--- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/trait-path-type-error-once-implemented.rs:2:10 @@ -59,6 +60,11 @@ note: associated type defined here, with 0 generic parameters LL | type Y<'a>; | ^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: remove these generics + | +LL - fn f2<'a>(arg : Box = &'a ()>>) {} +LL + fn f2<'a>(arg : Box>) {} + | error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied --> $DIR/trait-path-type-error-once-implemented.rs:6:29 @@ -81,9 +87,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/trait-path-type-error-once-implemented.rs:6:29 | LL | fn f2<'a>(arg : Box = &'a ()>>) {} - | ^--- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/trait-path-type-error-once-implemented.rs:2:10 @@ -91,6 +95,11 @@ note: associated type defined here, with 0 generic parameters LL | type Y<'a>; | ^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: remove these generics + | +LL - fn f2<'a>(arg : Box = &'a ()>>) {} +LL + fn f2<'a>(arg : Box>) {} + | error[E0038]: the trait `X` cannot be made into an object --> $DIR/trait-path-type-error-once-implemented.rs:6:23 diff --git a/tests/ui/generic-associated-types/self-outlives-lint.stderr b/tests/ui/generic-associated-types/self-outlives-lint.stderr index 9e9b2e18abeb8..5d7963a21acf1 100644 --- a/tests/ui/generic-associated-types/self-outlives-lint.stderr +++ b/tests/ui/generic-associated-types/self-outlives-lint.stderr @@ -2,177 +2,209 @@ error: missing required bound on `Item` --> $DIR/self-outlives-lint.rs:7:5 | LL | type Item<'x>; - | ^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'x` + | ^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Item<'x> where Self: 'x; + | ++++++++++++++ error: missing required bound on `Out` --> $DIR/self-outlives-lint.rs:23:5 | LL | type Out<'x>; - | ^^^^^^^^^^^^- - | | - | help: add the required where clause: `where T: 'x` + | ^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Out<'x> where T: 'x; + | +++++++++++ error: missing required bound on `Out` --> $DIR/self-outlives-lint.rs:37:5 | LL | type Out<'x>; - | ^^^^^^^^^^^^- - | | - | help: add the required where clause: `where T: 'x` + | ^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Out<'x> where T: 'x; + | +++++++++++ error: missing required bounds on `Out` --> $DIR/self-outlives-lint.rs:44:5 | LL | type Out<'x, 'y>; - | ^^^^^^^^^^^^^^^^- - | | - | help: add the required where clauses: `where T: 'x, U: 'y` + | ^^^^^^^^^^^^^^^^^ | = note: these bounds are currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clauses + | +LL | type Out<'x, 'y> where T: 'x, U: 'y; + | ++++++++++++++++++ error: missing required bound on `Out` --> $DIR/self-outlives-lint.rs:59:5 | LL | type Out<'x, D>; - | ^^^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where D: 'x` + | ^^^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Out<'x, D> where D: 'x; + | +++++++++++ error: missing required bound on `Out` --> $DIR/self-outlives-lint.rs:75:5 | LL | type Out<'x, D>; - | ^^^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where D: 'x` + | ^^^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Out<'x, D> where D: 'x; + | +++++++++++ error: missing required bound on `Out` --> $DIR/self-outlives-lint.rs:90:5 | LL | type Out<'x, D>; - | ^^^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where D: 'x` + | ^^^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Out<'x, D> where D: 'x; + | +++++++++++ error: missing required bounds on `Bar` --> $DIR/self-outlives-lint.rs:112:5 | LL | type Bar<'b>; - | ^^^^^^^^^^^^- - | | - | help: add the required where clauses: `where Self: 'a, Self: 'b` + | ^^^^^^^^^^^^^ | = note: these bounds are currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clauses + | +LL | type Bar<'b> where Self: 'a, Self: 'b; + | ++++++++++++++++++++++++ error: missing required bound on `Bar` --> $DIR/self-outlives-lint.rs:120:5 | LL | type Bar<'b>; - | ^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'b` + | ^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Bar<'b> where Self: 'b; + | ++++++++++++++ error: missing required bound on `Bar` --> $DIR/self-outlives-lint.rs:127:5 | LL | type Bar<'b>; - | ^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'b` + | ^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Bar<'b> where Self: 'b; + | ++++++++++++++ error: missing required bound on `Iterator` --> $DIR/self-outlives-lint.rs:142:5 | LL | type Iterator<'a>: Iterator>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'a` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Iterator<'a>: Iterator> where Self: 'a; + | ++++++++++++++ error: missing required bound on `Item` --> $DIR/self-outlives-lint.rs:140:5 | LL | type Item<'a>; - | ^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'a` + | ^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Item<'a> where Self: 'a; + | ++++++++++++++ error: missing required bound on `Item` --> $DIR/self-outlives-lint.rs:148:5 | LL | type Item<'a>; - | ^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'a` + | ^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Item<'a> where Self: 'a; + | ++++++++++++++ error: missing required bound on `Bar` --> $DIR/self-outlives-lint.rs:157:5 | LL | type Bar<'a, 'b>; - | ^^^^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where 'b: 'a` + | ^^^^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Bar<'a, 'b> where 'b: 'a; + | ++++++++++++ error: missing required bound on `Fut` --> $DIR/self-outlives-lint.rs:173:5 | LL | type Fut<'out>; - | ^^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where 'ctx: 'out` + | ^^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Fut<'out> where 'ctx: 'out; + | ++++++++++++++++ error: missing required bound on `Item` --> $DIR/self-outlives-lint.rs:213:5 | LL | type Item<'a>; - | ^^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'a` + | ^^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Item<'a> where Self: 'a; + | ++++++++++++++ error: aborting due to 16 previous errors diff --git a/tests/ui/generic-const-items/assoc-const-missing-type.stderr b/tests/ui/generic-const-items/assoc-const-missing-type.stderr index 6f35c0958d45c..e7b8f2121169a 100644 --- a/tests/ui/generic-const-items/assoc-const-missing-type.stderr +++ b/tests/ui/generic-const-items/assoc-const-missing-type.stderr @@ -13,7 +13,12 @@ error: missing type for `const` item --> $DIR/assoc-const-missing-type.rs:12:15 | LL | const K = (); - | ^ help: provide a type for the associated constant: `()` + | ^ + | +help: provide a type for the associated constant + | +LL | const K () = (); + | ++ error[E0195]: lifetime parameters or bounds on const `Q` do not match the trait declaration --> $DIR/assoc-const-missing-type.rs:16:12 @@ -28,7 +33,12 @@ error: missing type for `const` item --> $DIR/assoc-const-missing-type.rs:16:12 | LL | const Q = ""; - | ^ help: provide a type for the associated constant: `: &str` + | ^ + | +help: provide a type for the associated constant + | +LL | const Q: &str = ""; + | ++++++ error[E0308]: mismatched types --> $DIR/assoc-const-missing-type.rs:12:18 diff --git a/tests/ui/generics/bad-mid-path-type-params.stderr b/tests/ui/generics/bad-mid-path-type-params.stderr index 71e15dd4c9264..7f4ba781e6ab3 100644 --- a/tests/ui/generics/bad-mid-path-type-params.stderr +++ b/tests/ui/generics/bad-mid-path-type-params.stderr @@ -2,71 +2,86 @@ error[E0107]: associated function takes 1 generic argument but 2 generic argumen --> $DIR/bad-mid-path-type-params.rs:30:16 | LL | let _ = S::new::(1, 1.0); - | ^^^ --- help: remove this generic argument - | | - | expected 1 generic argument + | ^^^ expected 1 generic argument | note: associated function defined here, with 1 generic parameter: `U` --> $DIR/bad-mid-path-type-params.rs:6:8 | LL | fn new(x: T, _: U) -> S { | ^^^ - +help: remove this generic argument + | +LL - let _ = S::new::(1, 1.0); +LL + let _ = S::new::(1, 1.0); + | error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied --> $DIR/bad-mid-path-type-params.rs:33:13 | LL | let _ = S::<'a,isize>::new::(1, 1.0); - | ^ -- help: remove this lifetime argument - | | - | expected 0 lifetime arguments + | ^ expected 0 lifetime arguments | note: struct defined here, with 0 lifetime parameters --> $DIR/bad-mid-path-type-params.rs:1:8 | LL | struct S { | ^ +help: remove this lifetime argument + | +LL - let _ = S::<'a,isize>::new::(1, 1.0); +LL + let _ = S::<,isize>::new::(1, 1.0); + | error[E0107]: associated function takes 1 generic argument but 2 generic arguments were supplied --> $DIR/bad-mid-path-type-params.rs:36:24 | LL | let _: S2 = Trait::new::(1, 1.0); - | ^^^ --- help: remove this generic argument - | | - | expected 1 generic argument + | ^^^ expected 1 generic argument | note: associated function defined here, with 1 generic parameter: `U` --> $DIR/bad-mid-path-type-params.rs:14:8 | LL | fn new(x: T, y: U) -> Self; | ^^^ - +help: remove this generic argument + | +LL - let _: S2 = Trait::new::(1, 1.0); +LL + let _: S2 = Trait::new::(1, 1.0); + | error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was supplied --> $DIR/bad-mid-path-type-params.rs:39:17 | LL | let _: S2 = Trait::<'a,isize>::new::(1, 1.0); - | ^^^^^ -- help: remove this lifetime argument - | | - | expected 0 lifetime arguments + | ^^^^^ expected 0 lifetime arguments | note: trait defined here, with 0 lifetime parameters --> $DIR/bad-mid-path-type-params.rs:13:7 | LL | trait Trait { | ^^^^^ +help: remove this lifetime argument + | +LL - let _: S2 = Trait::<'a,isize>::new::(1, 1.0); +LL + let _: S2 = Trait::<,isize>::new::(1, 1.0); + | error[E0107]: associated function takes 1 generic argument but 2 generic arguments were supplied --> $DIR/bad-mid-path-type-params.rs:39:36 | LL | let _: S2 = Trait::<'a,isize>::new::(1, 1.0); - | ^^^ --- help: remove this generic argument - | | - | expected 1 generic argument + | ^^^ expected 1 generic argument | note: associated function defined here, with 1 generic parameter: `U` --> $DIR/bad-mid-path-type-params.rs:14:8 | LL | fn new(x: T, y: U) -> Self; | ^^^ - +help: remove this generic argument + | +LL - let _: S2 = Trait::<'a,isize>::new::(1, 1.0); +LL + let _: S2 = Trait::<'a,isize>::new::(1, 1.0); + | error: aborting due to 5 previous errors diff --git a/tests/ui/generics/foreign-generic-mismatch.stderr b/tests/ui/generics/foreign-generic-mismatch.stderr index 5322b3f919d2d..7e8e854d64248 100644 --- a/tests/ui/generics/foreign-generic-mismatch.stderr +++ b/tests/ui/generics/foreign-generic-mismatch.stderr @@ -20,15 +20,18 @@ error[E0107]: function takes 1 lifetime argument but 2 lifetime arguments were s --> $DIR/foreign-generic-mismatch.rs:8:31 | LL | foreign_generic_mismatch::lt_arg::<'static, 'static>(); - | ^^^^^^ ------- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^^^^ expected 1 lifetime argument | note: function defined here, with 1 lifetime parameter: `'a` --> $DIR/auxiliary/foreign-generic-mismatch.rs:3:8 | LL | pub fn lt_arg<'a: 'a>() {} | ^^^^^^ -- +help: remove this lifetime argument + | +LL - foreign_generic_mismatch::lt_arg::<'static, 'static>(); +LL + foreign_generic_mismatch::lt_arg::<'static, >(); + | error: aborting due to 2 previous errors diff --git a/tests/ui/generics/generic-arg-mismatch-recover.stderr b/tests/ui/generics/generic-arg-mismatch-recover.stderr index f549a7180fc66..cb25fa7af40aa 100644 --- a/tests/ui/generics/generic-arg-mismatch-recover.stderr +++ b/tests/ui/generics/generic-arg-mismatch-recover.stderr @@ -2,43 +2,52 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup --> $DIR/generic-arg-mismatch-recover.rs:6:5 | LL | Foo::<'static, 'static, ()>(&0); - | ^^^ ------- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^ expected 1 lifetime argument | note: struct defined here, with 1 lifetime parameter: `'a` --> $DIR/generic-arg-mismatch-recover.rs:1:8 | LL | struct Foo<'a, T: 'a>(&'a T); | ^^^ -- +help: remove this lifetime argument + | +LL - Foo::<'static, 'static, ()>(&0); +LL + Foo::<'static, , ()>(&0); + | error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied --> $DIR/generic-arg-mismatch-recover.rs:9:5 | LL | Bar::<'static, 'static, ()>(&()); - | ^^^ ------- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^ expected 1 lifetime argument | note: struct defined here, with 1 lifetime parameter: `'a` --> $DIR/generic-arg-mismatch-recover.rs:3:8 | LL | struct Bar<'a>(&'a ()); | ^^^ -- +help: remove this lifetime argument + | +LL - Bar::<'static, 'static, ()>(&()); +LL + Bar::<'static, , ()>(&()); + | error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied --> $DIR/generic-arg-mismatch-recover.rs:9:5 | LL | Bar::<'static, 'static, ()>(&()); - | ^^^ -- help: remove this generic argument - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: struct defined here, with 0 generic parameters --> $DIR/generic-arg-mismatch-recover.rs:3:8 | LL | struct Bar<'a>(&'a ()); | ^^^ +help: remove this generic argument + | +LL - Bar::<'static, 'static, ()>(&()); +LL + Bar::<'static, 'static, >(&()); + | error: aborting due to 3 previous errors diff --git a/tests/ui/generics/generic-impl-more-params-with-defaults.stderr b/tests/ui/generics/generic-impl-more-params-with-defaults.stderr index c5812abfd3dfa..edbe7a5e139cb 100644 --- a/tests/ui/generics/generic-impl-more-params-with-defaults.stderr +++ b/tests/ui/generics/generic-impl-more-params-with-defaults.stderr @@ -2,15 +2,18 @@ error[E0107]: struct takes at most 2 generic arguments but 3 generic arguments w --> $DIR/generic-impl-more-params-with-defaults.rs:13:5 | LL | Vec::::new(); - | ^^^ ---- help: remove this generic argument - | | - | expected at most 2 generic arguments + | ^^^ expected at most 2 generic arguments | note: struct defined here, with at most 2 generic parameters: `T`, `A` --> $DIR/generic-impl-more-params-with-defaults.rs:5:8 | LL | struct Vec( | ^^^ - -------- +help: remove this generic argument + | +LL - Vec::::new(); +LL + Vec::::new(); + | error: aborting due to 1 previous error diff --git a/tests/ui/generics/generic-type-more-params-with-defaults.stderr b/tests/ui/generics/generic-type-more-params-with-defaults.stderr index c44f6b7ddc02d..27752af1ad6cb 100644 --- a/tests/ui/generics/generic-type-more-params-with-defaults.stderr +++ b/tests/ui/generics/generic-type-more-params-with-defaults.stderr @@ -2,15 +2,18 @@ error[E0107]: struct takes at most 2 generic arguments but 3 generic arguments w --> $DIR/generic-type-more-params-with-defaults.rs:9:12 | LL | let _: Vec; - | ^^^ ---- help: remove this generic argument - | | - | expected at most 2 generic arguments + | ^^^ expected at most 2 generic arguments | note: struct defined here, with at most 2 generic parameters: `T`, `A` --> $DIR/generic-type-more-params-with-defaults.rs:5:8 | LL | struct Vec( | ^^^ - -------- +help: remove this generic argument + | +LL - let _: Vec; +LL + let _: Vec; + | error: aborting due to 1 previous error diff --git a/tests/ui/generics/wrong-number-of-args.stderr b/tests/ui/generics/wrong-number-of-args.stderr index e04408a0fdf36..9df759bf29b11 100644 --- a/tests/ui/generics/wrong-number-of-args.stderr +++ b/tests/ui/generics/wrong-number-of-args.stderr @@ -171,71 +171,86 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/wrong-number-of-args.rs:6:14 | LL | type B = Ty<'static>; - | ^^--------- help: remove these generics - | | - | expected 0 lifetime arguments + | ^^ expected 0 lifetime arguments | note: struct defined here, with 0 lifetime parameters --> $DIR/wrong-number-of-args.rs:2:12 | LL | struct Ty; | ^^ +help: remove these generics + | +LL - type B = Ty<'static>; +LL + type B = Ty; + | error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied --> $DIR/wrong-number-of-args.rs:10:14 | LL | type C = Ty<'static, usize>; - | ^^ ------- help: remove this lifetime argument - | | - | expected 0 lifetime arguments + | ^^ expected 0 lifetime arguments | note: struct defined here, with 0 lifetime parameters --> $DIR/wrong-number-of-args.rs:2:12 | LL | struct Ty; | ^^ +help: remove this lifetime argument + | +LL - type C = Ty<'static, usize>; +LL + type C = Ty<, usize>; + | error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied --> $DIR/wrong-number-of-args.rs:10:14 | LL | type C = Ty<'static, usize>; - | ^^ ----- help: remove this generic argument - | | - | expected 0 generic arguments + | ^^ expected 0 generic arguments | note: struct defined here, with 0 generic parameters --> $DIR/wrong-number-of-args.rs:2:12 | LL | struct Ty; | ^^ +help: remove this generic argument + | +LL - type C = Ty<'static, usize>; +LL + type C = Ty<'static, >; + | error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied --> $DIR/wrong-number-of-args.rs:16:14 | LL | type D = Ty<'static, usize, { 0 }>; - | ^^ ------- help: remove this lifetime argument - | | - | expected 0 lifetime arguments + | ^^ expected 0 lifetime arguments | note: struct defined here, with 0 lifetime parameters --> $DIR/wrong-number-of-args.rs:2:12 | LL | struct Ty; | ^^ +help: remove this lifetime argument + | +LL - type D = Ty<'static, usize, { 0 }>; +LL + type D = Ty<, usize, { 0 }>; + | error[E0107]: struct takes 0 generic arguments but 2 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:16:14 | LL | type D = Ty<'static, usize, { 0 }>; - | ^^ ------------ help: remove these generic arguments - | | - | expected 0 generic arguments + | ^^ expected 0 generic arguments | note: struct defined here, with 0 generic parameters --> $DIR/wrong-number-of-args.rs:2:12 | LL | struct Ty; | ^^ +help: remove these generic arguments + | +LL - type D = Ty<'static, usize, { 0 }>; +LL + type D = Ty<'static, >; + | error[E0107]: missing generics for struct `type_and_type::Ty` --> $DIR/wrong-number-of-args.rs:26:14 @@ -275,15 +290,18 @@ error[E0107]: struct takes 2 generic arguments but 3 generic arguments were supp --> $DIR/wrong-number-of-args.rs:36:14 | LL | type D = Ty; - | ^^ ---- help: remove this generic argument - | | - | expected 2 generic arguments + | ^^ expected 2 generic arguments | note: struct defined here, with 2 generic parameters: `A`, `B` --> $DIR/wrong-number-of-args.rs:24:12 | LL | struct Ty(A, B); | ^^ - - +help: remove this generic argument + | +LL - type D = Ty; +LL + type D = Ty; + | error[E0107]: struct takes 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:40:14 @@ -353,29 +371,35 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup --> $DIR/wrong-number-of-args.rs:70:14 | LL | type F = Ty<'static, usize, 'static, usize>; - | ^^ ------- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^ expected 1 lifetime argument | note: struct defined here, with 1 lifetime parameter: `'a` --> $DIR/wrong-number-of-args.rs:46:12 | LL | struct Ty<'a, T>(&'a T); | ^^ -- +help: remove this lifetime argument + | +LL - type F = Ty<'static, usize, 'static, usize>; +LL + type F = Ty<'static, usize, , usize>; + | error[E0107]: struct takes 1 generic argument but 2 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:70:14 | LL | type F = Ty<'static, usize, 'static, usize>; - | ^^ ----- help: remove this generic argument - | | - | expected 1 generic argument + | ^^ expected 1 generic argument | note: struct defined here, with 1 generic parameter: `T` --> $DIR/wrong-number-of-args.rs:46:12 | LL | struct Ty<'a, T>(&'a T); | ^^ - +help: remove this generic argument + | +LL - type F = Ty<'static, usize, 'static, usize>; +LL + type F = Ty<'static, usize, 'static, >; + | error[E0107]: missing generics for struct `type_and_type_and_type::Ty` --> $DIR/wrong-number-of-args.rs:80:14 @@ -415,15 +439,18 @@ error[E0107]: struct takes at most 3 generic arguments but 4 generic arguments w --> $DIR/wrong-number-of-args.rs:92:14 | LL | type E = Ty; - | ^^ --- help: remove this generic argument - | | - | expected at most 3 generic arguments + | ^^ expected at most 3 generic arguments | note: struct defined here, with at most 3 generic parameters: `A`, `B`, `C` --> $DIR/wrong-number-of-args.rs:78:12 | LL | struct Ty(A, B, C); | ^^ - - ---------------- +help: remove this generic argument + | +LL - type E = Ty; +LL + type E = Ty; + | error[E0107]: struct takes at least 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:96:14 @@ -445,29 +472,35 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/wrong-number-of-args.rs:116:22 | LL | type A = Box>; - | ^^^^^^^^^^------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/wrong-number-of-args.rs:104:11 | LL | trait NonGeneric { | ^^^^^^^^^^ +help: remove these generics + | +LL - type A = Box>; +LL + type A = Box; + | error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supplied --> $DIR/wrong-number-of-args.rs:125:22 | LL | type C = Box>; - | ^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^^^^^^^^^^^^^ expected 1 lifetime argument | note: trait defined here, with 1 lifetime parameter: `'a` --> $DIR/wrong-number-of-args.rs:108:11 | LL | trait GenericLifetime<'a> { | ^^^^^^^^^^^^^^^ -- +help: remove this lifetime argument + | +LL - type C = Box>; +LL + type C = Box>; + | error[E0107]: missing generics for trait `GenericType` --> $DIR/wrong-number-of-args.rs:129:22 @@ -489,15 +522,18 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli --> $DIR/wrong-number-of-args.rs:133:22 | LL | type E = Box>; - | ^^^^^^^^^^^ ----- help: remove this generic argument - | | - | expected 1 generic argument + | ^^^^^^^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `A` --> $DIR/wrong-number-of-args.rs:112:11 | LL | trait GenericType { | ^^^^^^^^^^^ - +help: remove this generic argument + | +LL - type E = Box>; +LL + type E = Box>; + | error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:142:22 @@ -519,43 +555,52 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/wrong-number-of-args.rs:153:26 | LL | type A = Box>; - | ^^^^^^^^^^^^------------------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/wrong-number-of-args.rs:149:15 | LL | trait NonGenericAT { | ^^^^^^^^^^^^ +help: remove these generics + | +LL - type A = Box>; +LL + type A = Box; + | error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supplied --> $DIR/wrong-number-of-args.rs:168:26 | LL | type B = Box>; - | ^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^^^^^^^^^^^^^^^ expected 1 lifetime argument | note: trait defined here, with 1 lifetime parameter: `'a` --> $DIR/wrong-number-of-args.rs:159:15 | LL | trait GenericLifetimeAT<'a> { | ^^^^^^^^^^^^^^^^^ -- +help: remove this lifetime argument + | +LL - type B = Box>; +LL + type B = Box>; + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/wrong-number-of-args.rs:172:26 | LL | type C = Box>; - | ^^^^^^^^^^^^^^^^^ -- help: remove this generic argument - | | - | expected 0 generic arguments + | ^^^^^^^^^^^^^^^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/wrong-number-of-args.rs:159:15 | LL | trait GenericLifetimeAT<'a> { | ^^^^^^^^^^^^^^^^^ +help: remove this generic argument + | +LL - type C = Box>; +LL + type C = Box>; + | error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:185:26 @@ -577,29 +622,35 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli --> $DIR/wrong-number-of-args.rs:189:26 | LL | type B = Box>; - | ^^^^^^^^^^^^^ -- help: remove this generic argument - | | - | expected 1 generic argument + | ^^^^^^^^^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `A` --> $DIR/wrong-number-of-args.rs:181:15 | LL | trait GenericTypeAT { | ^^^^^^^^^^^^^ - +help: remove this generic argument + | +LL - type B = Box>; +LL + type B = Box>; + | error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was supplied --> $DIR/wrong-number-of-args.rs:193:26 | LL | type C = Box>; - | ^^^^^^^^^^^^^--------------------- help: remove these generics - | | - | expected 0 lifetime arguments + | ^^^^^^^^^^^^^ expected 0 lifetime arguments | note: trait defined here, with 0 lifetime parameters --> $DIR/wrong-number-of-args.rs:181:15 | LL | trait GenericTypeAT { | ^^^^^^^^^^^^^ +help: remove these generics + | +LL - type C = Box>; +LL + type C = Box; + | error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:193:26 @@ -653,15 +704,18 @@ error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supp --> $DIR/wrong-number-of-args.rs:216:26 | LL | type C = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^^^^^^^^^^^^^^^^^^^ expected 1 lifetime argument | note: trait defined here, with 1 lifetime parameter: `'a` --> $DIR/wrong-number-of-args.rs:201:15 | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ -- +help: remove this lifetime argument + | +LL - type C = Box>; +LL + type C = Box>; + | error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:216:26 @@ -683,71 +737,86 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli --> $DIR/wrong-number-of-args.rs:227:26 | LL | type E = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ -- help: remove this generic argument - | | - | expected 1 generic argument + | ^^^^^^^^^^^^^^^^^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `A` --> $DIR/wrong-number-of-args.rs:201:15 | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ - +help: remove this generic argument + | +LL - type E = Box>; +LL + type E = Box>; + | error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supplied --> $DIR/wrong-number-of-args.rs:234:26 | LL | type F = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^^^^^^^^^^^^^^^^^^^ expected 1 lifetime argument | note: trait defined here, with 1 lifetime parameter: `'a` --> $DIR/wrong-number-of-args.rs:201:15 | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ -- +help: remove this lifetime argument + | +LL - type F = Box>; +LL + type F = Box>; + | error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:238:26 | LL | type G = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ -- help: remove this generic argument - | | - | expected 1 generic argument + | ^^^^^^^^^^^^^^^^^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `A` --> $DIR/wrong-number-of-args.rs:201:15 | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ - +help: remove this generic argument + | +LL - type G = Box>; +LL + type G = Box>; + | error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supplied --> $DIR/wrong-number-of-args.rs:242:26 | LL | type H = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^^^^^^^^^^^^^^^^^^^ expected 1 lifetime argument | note: trait defined here, with 1 lifetime parameter: `'a` --> $DIR/wrong-number-of-args.rs:201:15 | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ -- +help: remove this lifetime argument + | +LL - type H = Box>; +LL + type H = Box>; + | error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:242:26 | LL | type H = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ -- help: remove this generic argument - | | - | expected 1 generic argument + | ^^^^^^^^^^^^^^^^^^^^^ expected 1 generic argument | note: trait defined here, with 1 generic parameter: `A` --> $DIR/wrong-number-of-args.rs:201:15 | LL | trait GenericLifetimeTypeAT<'a, A> { | ^^^^^^^^^^^^^^^^^^^^^ - +help: remove this generic argument + | +LL - type H = Box>; +LL + type H = Box>; + | error[E0107]: trait takes 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:254:26 @@ -787,15 +856,18 @@ error[E0107]: trait takes 2 generic arguments but 3 generic arguments were suppl --> $DIR/wrong-number-of-args.rs:262:26 | LL | type C = Box>; - | ^^^^^^^^^^^^^^^^^ -- help: remove this generic argument - | | - | expected 2 generic arguments + | ^^^^^^^^^^^^^^^^^ expected 2 generic arguments | note: trait defined here, with 2 generic parameters: `A`, `B` --> $DIR/wrong-number-of-args.rs:250:15 | LL | trait GenericTypeTypeAT { | ^^^^^^^^^^^^^^^^^ - - +help: remove this generic argument + | +LL - type C = Box>; +LL + type C = Box>; + | error[E0107]: trait takes 2 lifetime arguments but 1 lifetime argument was supplied --> $DIR/wrong-number-of-args.rs:277:26 @@ -911,9 +983,13 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/wrong-number-of-args.rs:318:18 | LL | type C = HashMap<'static>; - | ^^^^^^^--------- help: remove these generics - | | - | expected 0 lifetime arguments + | ^^^^^^^ expected 0 lifetime arguments + | +help: remove these generics + | +LL - type C = HashMap<'static>; +LL + type C = HashMap; + | error[E0107]: struct takes at least 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:318:18 @@ -930,9 +1006,13 @@ error[E0107]: struct takes at most 3 generic arguments but 4 generic arguments w --> $DIR/wrong-number-of-args.rs:324:18 | LL | type D = HashMap; - | ^^^^^^^ --- help: remove this generic argument - | | - | expected at most 3 generic arguments + | ^^^^^^^ expected at most 3 generic arguments + | +help: remove this generic argument + | +LL - type D = HashMap; +LL + type D = HashMap; + | error[E0107]: struct takes at least 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:328:18 @@ -973,9 +1053,13 @@ error[E0107]: enum takes 0 lifetime arguments but 1 lifetime argument was suppli --> $DIR/wrong-number-of-args.rs:342:18 | LL | type C = Result<'static>; - | ^^^^^^--------- help: remove these generics - | | - | expected 0 lifetime arguments + | ^^^^^^ expected 0 lifetime arguments + | +help: remove these generics + | +LL - type C = Result<'static>; +LL + type C = Result; + | error[E0107]: enum takes 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:342:18 @@ -992,9 +1076,13 @@ error[E0107]: enum takes 2 generic arguments but 3 generic arguments were suppli --> $DIR/wrong-number-of-args.rs:348:18 | LL | type D = Result; - | ^^^^^^ ---- help: remove this generic argument - | | - | expected 2 generic arguments + | ^^^^^^ expected 2 generic arguments + | +help: remove this generic argument + | +LL - type D = Result; +LL + type D = Result; + | error[E0107]: enum takes 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:352:18 diff --git a/tests/ui/hygiene/rustc-macro-transparency.stderr b/tests/ui/hygiene/rustc-macro-transparency.stderr index 1d2a1e1249864..849cb47b4896b 100644 --- a/tests/ui/hygiene/rustc-macro-transparency.stderr +++ b/tests/ui/hygiene/rustc-macro-transparency.stderr @@ -11,10 +11,12 @@ LL | struct SemiTransparent; | ----------------------- similarly named unit struct `SemiTransparent` defined here ... LL | semitransparent; - | ^^^^^^^^^^^^^^^ - | | - | not a value - | help: a unit struct with a similar name exists: `SemiTransparent` + | ^^^^^^^^^^^^^^^ not a value + | +help: a unit struct with a similar name exists + | +LL | SemiTransparent; + | ~~~~~~~~~~~~~~~ error[E0423]: expected value, found macro `opaque` --> $DIR/rustc-macro-transparency.rs:30:5 diff --git a/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr b/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr index e8cd16bc30168..d184110c45345 100644 --- a/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr +++ b/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr @@ -2,9 +2,7 @@ error[E0107]: function takes 1 generic argument but 2 generic arguments were sup --> $DIR/explicit-generic-args-for-impl.rs:4:5 | LL | foo::("".to_string()); - | ^^^ ------ help: remove this generic argument - | | - | expected 1 generic argument + | ^^^ expected 1 generic argument | note: function defined here, with 1 generic parameter: `T` --> $DIR/explicit-generic-args-for-impl.rs:1:4 @@ -12,6 +10,11 @@ note: function defined here, with 1 generic parameter: `T` LL | fn foo(_f: impl AsRef) {} | ^^^ - = note: `impl Trait` cannot be explicitly specified as a generic argument +help: remove this generic argument + | +LL - foo::("".to_string()); +LL + foo::("".to_string()); + | error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/impl-generic-mismatch-ab.stderr b/tests/ui/impl-trait/impl-generic-mismatch-ab.stderr index 7046e729e1834..90c31c9e3fc19 100644 --- a/tests/ui/impl-trait/impl-generic-mismatch-ab.stderr +++ b/tests/ui/impl-trait/impl-generic-mismatch-ab.stderr @@ -2,10 +2,8 @@ error[E0053]: method `foo` has an incompatible type for trait --> $DIR/impl-generic-mismatch-ab.rs:8:32 | LL | fn foo(&self, a: &impl Debug, b: &B) { } - | - ^^^^^^^^^^^ - | | | - | | expected type parameter `B`, found type parameter `impl Debug` - | | help: change the parameter type to match the trait: `&B` + | - ^^^^^^^^^^^ expected type parameter `B`, found type parameter `impl Debug` + | | | expected type parameter | note: type in trait @@ -17,6 +15,10 @@ LL | fn foo(&self, a: &A, b: &impl Debug); found signature `fn(&(), &impl Debug, &B)` = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters +help: change the parameter type to match the trait + | +LL | fn foo(&self, a: &B, b: &B) { } + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr b/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr index 8e61a65abe4be..e32c59a75c699 100644 --- a/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr +++ b/tests/ui/impl-trait/in-assoc-type-unconstrained.stderr @@ -27,10 +27,7 @@ LL | type Ty = impl Sized; | ---------- the expected opaque type LL | LL | fn method() -> () {} - | ^^ - | | - | expected opaque type, found `()` - | help: change the output type to match the trait: `<() as compare_method::Trait>::Ty` + | ^^ expected opaque type, found `()` | note: type in trait --> $DIR/in-assoc-type-unconstrained.rs:17:24 @@ -44,6 +41,10 @@ note: this item must have the opaque type in its signature in order to be able t | LL | fn method() -> () {} | ^^^^^^ +help: change the output type to match the trait + | +LL | fn method() -> <() as compare_method::Trait>::Ty {} + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: unconstrained opaque type --> $DIR/in-assoc-type-unconstrained.rs:20:19 diff --git a/tests/ui/impl-trait/in-trait/gat-outlives.stderr b/tests/ui/impl-trait/in-trait/gat-outlives.stderr index 8ec4b0ab2ee56..4599cada34dc5 100644 --- a/tests/ui/impl-trait/in-trait/gat-outlives.stderr +++ b/tests/ui/impl-trait/in-trait/gat-outlives.stderr @@ -2,23 +2,27 @@ error: missing required bound on `Gat` --> $DIR/gat-outlives.rs:6:5 | LL | type Gat<'a>; - | ^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'a` + | ^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Gat<'a> where Self: 'a; + | ++++++++++++++ error: missing required bound on `Gat` --> $DIR/gat-outlives.rs:12:5 | LL | type Gat<'a>; - | ^^^^^^^^^^^^- - | | - | help: add the required where clause: `where Self: 'a` + | ^^^^^^^^^^^^^ | = note: this bound is currently required to ensure that impls have maximum flexibility = note: we are soliciting feedback, see issue #87479 for more information +help: add the required where clause + | +LL | type Gat<'a> where Self: 'a; + | ++++++++++++++ error: aborting due to 2 previous errors diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr index 2231205327cb0..6f6b787b6fe1b 100644 --- a/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr +++ b/tests/ui/impl-trait/in-trait/method-signature-matches.lt.stderr @@ -2,10 +2,8 @@ error[E0053]: method `early` has an incompatible type for trait --> $DIR/method-signature-matches.rs:55:27 | LL | fn early<'late, T>(_: &'late ()) {} - | - ^^^^^^^^^ - | | | - | | expected type parameter `T`, found `()` - | | help: change the parameter type to match the trait: `&T` + | - ^^^^^^^^^ expected type parameter `T`, found `()` + | | | expected this type parameter | note: type in trait @@ -15,6 +13,10 @@ LL | fn early<'early, T>(x: &'early T) -> impl Sized; | ^^^^^^^^^ = note: expected signature `fn(&T)` found signature `fn(&'late ())` +help: change the parameter type to match the trait + | +LL | fn early<'late, T>(_: &T) {} + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr index ec2a126865d5c..9e18517e48c55 100644 --- a/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr +++ b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch.stderr @@ -2,10 +2,7 @@ error[E0053]: method `owo` has an incompatible type for trait --> $DIR/method-signature-matches.rs:11:15 | LL | fn owo(_: u8) {} - | ^^ - | | - | expected `()`, found `u8` - | help: change the parameter type to match the trait: `()` + | ^^ expected `()`, found `u8` | note: type in trait --> $DIR/method-signature-matches.rs:6:15 @@ -14,6 +11,10 @@ LL | fn owo(x: ()) -> impl Sized; | ^^ = note: expected signature `fn(())` found signature `fn(u8)` +help: change the parameter type to match the trait + | +LL | fn owo(_: ()) {} + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr index 4d3e64e8050f9..c01d7322d117e 100644 --- a/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr +++ b/tests/ui/impl-trait/in-trait/method-signature-matches.mismatch_async.stderr @@ -2,10 +2,7 @@ error[E0053]: method `owo` has an incompatible type for trait --> $DIR/method-signature-matches.rs:22:21 | LL | async fn owo(_: u8) {} - | ^^ - | | - | expected `()`, found `u8` - | help: change the parameter type to match the trait: `()` + | ^^ expected `()`, found `u8` | note: type in trait --> $DIR/method-signature-matches.rs:17:21 @@ -14,6 +11,10 @@ LL | async fn owo(x: ()) {} | ^^ = note: expected signature `fn(()) -> _` found signature `fn(u8) -> _` +help: change the parameter type to match the trait + | +LL | async fn owo(_: ()) {} + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/impl-trait/in-trait/opaque-and-lifetime-mismatch.stderr b/tests/ui/impl-trait/in-trait/opaque-and-lifetime-mismatch.stderr index d7fc40fa3426f..aba82084f2258 100644 --- a/tests/ui/impl-trait/in-trait/opaque-and-lifetime-mismatch.stderr +++ b/tests/ui/impl-trait/in-trait/opaque-and-lifetime-mismatch.stderr @@ -38,29 +38,35 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli --> $DIR/opaque-and-lifetime-mismatch.rs:4:17 | LL | fn bar() -> Wrapper; - | ^^^^^^^ ---------- help: remove this generic argument - | | - | expected 0 generic arguments + | ^^^^^^^ expected 0 generic arguments | note: struct defined here, with 0 generic parameters --> $DIR/opaque-and-lifetime-mismatch.rs:1:8 | LL | struct Wrapper<'rom>(&'rom ()); | ^^^^^^^ +help: remove this generic argument + | +LL - fn bar() -> Wrapper; +LL + fn bar() -> Wrapper<>; + | error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied --> $DIR/opaque-and-lifetime-mismatch.rs:18:17 | LL | fn foo() -> Wrapper; - | ^^^^^^^ ---------- help: remove this generic argument - | | - | expected 0 generic arguments + | ^^^^^^^ expected 0 generic arguments | note: struct defined here, with 0 generic parameters --> $DIR/opaque-and-lifetime-mismatch.rs:1:8 | LL | struct Wrapper<'rom>(&'rom ()); | ^^^^^^^ +help: remove this generic argument + | +LL - fn foo() -> Wrapper; +LL + fn foo() -> Wrapper<>; + | error[E0053]: method `bar` has an incompatible return type for trait --> $DIR/opaque-and-lifetime-mismatch.rs:10:17 @@ -75,10 +81,7 @@ error[E0053]: method `bar` has an incompatible type for trait --> $DIR/opaque-and-lifetime-mismatch.rs:10:17 | LL | fn bar() -> i32 { - | ^^^ - | | - | expected `Wrapper<'static>`, found `i32` - | help: change the output type to match the trait: `Wrapper<'static>` + | ^^^ expected `Wrapper<'static>`, found `i32` | note: type in trait --> $DIR/opaque-and-lifetime-mismatch.rs:4:17 @@ -87,20 +90,27 @@ LL | fn bar() -> Wrapper; | ^^^^^^^^^^^^^^^^^^^ = note: expected signature `fn() -> Wrapper<'static>` found signature `fn() -> i32` +help: change the output type to match the trait + | +LL | fn bar() -> Wrapper<'static> { + | ~~~~~~~~~~~~~~~~ error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied --> $DIR/opaque-and-lifetime-mismatch.rs:24:17 | LL | fn foo() -> Wrapper { - | ^^^^^^^ ---------- help: remove this generic argument - | | - | expected 0 generic arguments + | ^^^^^^^ expected 0 generic arguments | note: struct defined here, with 0 generic parameters --> $DIR/opaque-and-lifetime-mismatch.rs:1:8 | LL | struct Wrapper<'rom>(&'rom ()); | ^^^^^^^ +help: remove this generic argument + | +LL - fn foo() -> Wrapper { +LL + fn foo() -> Wrapper<> { + | error: aborting due to 8 previous errors diff --git a/tests/ui/impl-trait/in-trait/specialization-broken.stderr b/tests/ui/impl-trait/in-trait/specialization-broken.stderr index b8a8e2401b229..8c9f265601540 100644 --- a/tests/ui/impl-trait/in-trait/specialization-broken.stderr +++ b/tests/ui/impl-trait/in-trait/specialization-broken.stderr @@ -5,10 +5,7 @@ LL | default impl Foo for U | - found this type parameter ... LL | fn bar(&self) -> U { - | ^ - | | - | expected associated type, found type parameter `U` - | help: change the output type to match the trait: `impl Sized` + | ^ expected associated type, found type parameter `U` | note: type in trait --> $DIR/specialization-broken.rs:8:22 @@ -17,6 +14,10 @@ LL | fn bar(&self) -> impl Sized; | ^^^^^^^^^^ = note: expected signature `fn(&_) -> impl Sized` found signature `fn(&_) -> U` +help: change the output type to match the trait + | +LL | fn bar(&self) -> impl Sized { + | ~~~~~~~~~~ error: method with return-position `impl Trait` in trait cannot be specialized --> $DIR/specialization-broken.rs:15:5 diff --git a/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr b/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr index 6d41748853332..d7639c35a6210 100644 --- a/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr +++ b/tests/ui/impl-trait/opaque-used-in-extraneous-argument.stderr @@ -36,22 +36,30 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje --> $DIR/opaque-used-in-extraneous-argument.rs:5:19 | LL | fn frob() -> impl Fn + '_ {} - | ^^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn(P) -> T` + | ^^^^^^^^^^^^^^^^^ | = note: see issue #29625 for more information = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: use parenthetical notation instead + | +LL | fn frob() -> impl Fn(P) -> T + '_ {} + | ~~~~~~~~~~ error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change --> $DIR/opaque-used-in-extraneous-argument.rs:5:19 | LL | fn frob() -> impl Fn + '_ {} - | ^^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn(P) -> T` + | ^^^^^^^^^^^^^^^^^ | = note: see issue #29625 for more information = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: use parenthetical notation instead + | +LL | fn frob() -> impl Fn(P) -> T + '_ {} + | ~~~~~~~~~~ error[E0061]: this function takes 0 arguments but 1 argument was supplied --> $DIR/opaque-used-in-extraneous-argument.rs:17:20 diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr index 4352af1c0df76..3692cc77b0fb4 100644 --- a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr +++ b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle.stderr @@ -26,13 +26,14 @@ LL | type Foo = impl PartialEq<(Foo, i32)>; | -------------------------- the found opaque type ... LL | fn eq(&self, _other: &(Foo, i32)) -> bool { - | ^^^^^^^^^^^ - | | - | expected `a::Bar`, found opaque type - | help: change the parameter type to match the trait: `&(a::Bar, i32)` + | ^^^^^^^^^^^ expected `a::Bar`, found opaque type | = note: expected signature `fn(&a::Bar, &(a::Bar, _)) -> _` found signature `fn(&a::Bar, &(a::Foo, _)) -> _` +help: change the parameter type to match the trait + | +LL | fn eq(&self, _other: &(a::Bar, i32)) -> bool { + | ~~~~~~~~~~~~~~ error: unconstrained opaque type --> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle.rs:19:16 @@ -49,10 +50,7 @@ LL | type Foo = impl PartialEq<(Foo, i32)>; | -------------------------- the expected opaque type ... LL | fn eq(&self, _other: &(Bar, i32)) -> bool { - | ^^^^^^^^^^^ - | | - | expected opaque type, found `b::Bar` - | help: change the parameter type to match the trait: `&(b::Foo, i32)` + | ^^^^^^^^^^^ expected opaque type, found `b::Bar` | = note: expected signature `fn(&b::Bar, &(b::Foo, _)) -> _` found signature `fn(&b::Bar, &(b::Bar, _)) -> _` @@ -61,6 +59,10 @@ note: this item must have the opaque type in its signature in order to be able t | LL | fn eq(&self, _other: &(Bar, i32)) -> bool { | ^^ +help: change the parameter type to match the trait + | +LL | fn eq(&self, _other: &(b::Foo, i32)) -> bool { + | ~~~~~~~~~~~~~~ error: aborting due to 5 previous errors diff --git a/tests/ui/impl-trait/trait_type.stderr b/tests/ui/impl-trait/trait_type.stderr index 81e4c933e53f4..0eb132c7a1901 100644 --- a/tests/ui/impl-trait/trait_type.stderr +++ b/tests/ui/impl-trait/trait_type.stderr @@ -2,13 +2,14 @@ error[E0053]: method `fmt` has an incompatible type for trait --> $DIR/trait_type.rs:7:21 | LL | fn fmt(&self, x: &str) -> () { } - | ^^^^ - | | - | types differ in mutability - | help: change the parameter type to match the trait: `&mut Formatter<'_>` + | ^^^^ types differ in mutability | = note: expected signature `fn(&MyType, &mut Formatter<'_>) -> Result<(), std::fmt::Error>` found signature `fn(&MyType, &str)` +help: change the parameter type to match the trait + | +LL | fn fmt(&self, x: &mut Formatter<'_>) -> () { } + | ~~~~~~~~~~~~~~~~~~ error[E0050]: method `fmt` has 1 parameter but the declaration in trait `std::fmt::Display::fmt` has 2 --> $DIR/trait_type.rs:12:11 diff --git a/tests/ui/impl-trait/where-allowed.stderr b/tests/ui/impl-trait/where-allowed.stderr index bffe0447f8bb4..f0d259d01de94 100644 --- a/tests/ui/impl-trait/where-allowed.stderr +++ b/tests/ui/impl-trait/where-allowed.stderr @@ -397,10 +397,7 @@ LL | type Out = impl Debug; | ---------- the expected opaque type ... LL | fn in_trait_impl_return() -> impl Debug { () } - | ^^^^^^^^^^ - | | - | expected opaque type, found a different opaque type - | help: change the output type to match the trait: `<() as DummyTrait>::Out` + | ^^^^^^^^^^ expected opaque type, found a different opaque type | note: type in trait --> $DIR/where-allowed.rs:119:34 @@ -410,6 +407,10 @@ LL | fn in_trait_impl_return() -> Self::Out; = note: expected signature `fn() -> <() as DummyTrait>::Out` found signature `fn() -> impl Debug` = note: distinct uses of `impl Trait` result in different opaque types +help: change the output type to match the trait + | +LL | fn in_trait_impl_return() -> <() as DummyTrait>::Out { () } + | ~~~~~~~~~~~~~~~~~~~~~~~ error: unconstrained opaque type --> $DIR/where-allowed.rs:122:16 diff --git a/tests/ui/imports/glob-resolve1.stderr b/tests/ui/imports/glob-resolve1.stderr index 4401ef58732e8..34654b484a614 100644 --- a/tests/ui/imports/glob-resolve1.stderr +++ b/tests/ui/imports/glob-resolve1.stderr @@ -70,13 +70,17 @@ LL | pub enum B { | ---------- similarly named enum `B` defined here ... LL | foo::(); - | ^ help: an enum with a similar name exists: `B` + | ^ | note: enum `bar::A` exists but is inaccessible --> $DIR/glob-resolve1.rs:11:5 | LL | enum A { | ^^^^^^ not accessible +help: an enum with a similar name exists + | +LL | foo::(); + | ~ error[E0412]: cannot find type `C` in this scope --> $DIR/glob-resolve1.rs:33:11 @@ -85,13 +89,17 @@ LL | pub enum B { | ---------- similarly named enum `B` defined here ... LL | foo::(); - | ^ help: an enum with a similar name exists: `B` + | ^ | note: struct `bar::C` exists but is inaccessible --> $DIR/glob-resolve1.rs:18:5 | LL | struct C; | ^^^^^^^^^ not accessible +help: an enum with a similar name exists + | +LL | foo::(); + | ~ error[E0412]: cannot find type `D` in this scope --> $DIR/glob-resolve1.rs:34:11 @@ -100,13 +108,17 @@ LL | pub enum B { | ---------- similarly named enum `B` defined here ... LL | foo::(); - | ^ help: an enum with a similar name exists: `B` + | ^ | note: type alias `bar::D` exists but is inaccessible --> $DIR/glob-resolve1.rs:20:5 | LL | type D = isize; | ^^^^^^^^^^^^^^^ not accessible +help: an enum with a similar name exists + | +LL | foo::(); + | ~ error: aborting due to 8 previous errors diff --git a/tests/ui/indexing/index_message.stderr b/tests/ui/indexing/index_message.stderr index 6affb1ed96252..c4ddeea79413c 100644 --- a/tests/ui/indexing/index_message.stderr +++ b/tests/ui/indexing/index_message.stderr @@ -2,7 +2,12 @@ error[E0608]: cannot index into a value of type `({integer},)` --> $DIR/index_message.rs:3:14 | LL | let _ = z[0]; - | ^^^ help: to access tuple elements, use: `.0` + | ^^^ + | +help: to access tuple elements, use + | +LL | let _ = z.0; + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-11004.stderr b/tests/ui/issues/issue-11004.stderr index ea141e61df8d3..c3b2bc4280486 100644 --- a/tests/ui/issues/issue-11004.stderr +++ b/tests/ui/issues/issue-11004.stderr @@ -2,19 +2,23 @@ error[E0609]: no field `x` on type `*mut A` --> $DIR/issue-11004.rs:7:21 | LL | let x : i32 = n.x; - | --^ - | | | - | | unknown field - | help: `n` is a raw pointer; try dereferencing it: `(*n).x` + | ^ unknown field + | +help: `n` is a raw pointer; try dereferencing it + | +LL | let x : i32 = (*n).x; + | ~~~~~~ error[E0609]: no field `y` on type `*mut A` --> $DIR/issue-11004.rs:8:21 | LL | let y : f64 = n.y; - | --^ - | | | - | | unknown field - | help: `n` is a raw pointer; try dereferencing it: `(*n).y` + | ^ unknown field + | +help: `n` is a raw pointer; try dereferencing it + | +LL | let y : f64 = (*n).y; + | ~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-16048.stderr b/tests/ui/issues/issue-16048.stderr index 73610942d7a7e..af3ace874e1c9 100644 --- a/tests/ui/issues/issue-16048.stderr +++ b/tests/ui/issues/issue-16048.stderr @@ -11,9 +11,13 @@ error[E0605]: non-primitive cast: `Foo<'a>` as `T` --> $DIR/issue-16048.rs:24:16 | LL | return *self as T; - | ^^^^^^^^^^ help: consider using the `From` trait instead: `T::from(*self)` + | ^^^^^^^^^^ | = note: an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object +help: consider using the `From` trait instead + | +LL | return T::from(*self); + | ~~~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-17441.stderr b/tests/ui/issues/issue-17441.stderr index 29e50b91c7c6f..f7a236ed264ba 100644 --- a/tests/ui/issues/issue-17441.stderr +++ b/tests/ui/issues/issue-17441.stderr @@ -2,17 +2,23 @@ error[E0620]: cast to unsized type: `&[usize; 2]` as `[usize]` --> $DIR/issue-17441.rs:2:16 | LL | let _foo = &[1_usize, 2] as [usize]; - | ^^^^^^^^^^^^^^^^^------- - | | - | help: try casting to a reference instead: `&[usize]` + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: try casting to a reference instead + | +LL | let _foo = &[1_usize, 2] as &[usize]; + | ~~~~~~~~ error[E0620]: cast to unsized type: `Box` as `dyn Debug` --> $DIR/issue-17441.rs:5:16 | LL | let _bar = Box::new(1_usize) as dyn std::fmt::Debug; - | ^^^^^^^^^^^^^^^^^^^^^------------------- - | | - | help: you can cast to a `Box` instead: `Box` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: you can cast to a `Box` instead + | +LL | let _bar = Box::new(1_usize) as Box; + | ~~~~~~~~~~~~~~~~~~~~~~~~ error[E0620]: cast to unsized type: `usize` as `dyn Debug` --> $DIR/issue-17441.rs:8:16 diff --git a/tests/ui/issues/issue-18423.stderr b/tests/ui/issues/issue-18423.stderr index 2c6015eaa9d4b..a73688205ac80 100644 --- a/tests/ui/issues/issue-18423.stderr +++ b/tests/ui/issues/issue-18423.stderr @@ -2,9 +2,13 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/issue-18423.rs:4:8 | LL | x: Box<'a, isize> - | ^^^ -- help: remove this lifetime argument - | | - | expected 0 lifetime arguments + | ^^^ expected 0 lifetime arguments + | +help: remove this lifetime argument + | +LL - x: Box<'a, isize> +LL + x: Box<, isize> + | error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-19086.stderr b/tests/ui/issues/issue-19086.stderr index 03b9249bb1e3d..b9ca594852dea 100644 --- a/tests/ui/issues/issue-19086.stderr +++ b/tests/ui/issues/issue-19086.stderr @@ -5,7 +5,12 @@ LL | FooB { x: i32, y: i32 } | ----------------------- `FooB` defined here ... LL | FooB(a, b) => println!("{} {}", a, b), - | ^^^^^^^^^^ help: use struct pattern syntax instead: `FooB { x: a, y: b }` + | ^^^^^^^^^^ + | +help: use struct pattern syntax instead + | +LL | FooB { x: a, y: b } => println!("{} {}", a, b), + | ~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-20225.stderr b/tests/ui/issues/issue-20225.stderr index 2d24a5bbd50ab..7d6b09cf7f893 100644 --- a/tests/ui/issues/issue-20225.stderr +++ b/tests/ui/issues/issue-20225.stderr @@ -4,13 +4,14 @@ error[E0053]: method `call` has an incompatible type for trait LL | impl<'a, T> Fn<(&'a T,)> for Foo { | - found this type parameter LL | extern "rust-call" fn call(&self, (_,): (T,)) {} - | ^^^^ - | | - | expected `&'a T`, found type parameter `T` - | help: change the parameter type to match the trait: `(&'a T,)` + | ^^^^ expected `&'a T`, found type parameter `T` | = note: expected signature `extern "rust-call" fn(&Foo, (&'a _,))` found signature `extern "rust-call" fn(&Foo, (_,))` +help: change the parameter type to match the trait + | +LL | extern "rust-call" fn call(&self, (_,): (&'a T,)) {} + | ~~~~~~~~ error[E0053]: method `call_mut` has an incompatible type for trait --> $DIR/issue-20225.rs:11:51 @@ -18,13 +19,14 @@ error[E0053]: method `call_mut` has an incompatible type for trait LL | impl<'a, T> FnMut<(&'a T,)> for Foo { | - found this type parameter LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} - | ^^^^ - | | - | expected `&'a T`, found type parameter `T` - | help: change the parameter type to match the trait: `(&'a T,)` + | ^^^^ expected `&'a T`, found type parameter `T` | = note: expected signature `extern "rust-call" fn(&mut Foo, (&'a _,))` found signature `extern "rust-call" fn(&mut Foo, (_,))` +help: change the parameter type to match the trait + | +LL | extern "rust-call" fn call_mut(&mut self, (_,): (&'a T,)) {} + | ~~~~~~~~ error[E0053]: method `call_once` has an incompatible type for trait --> $DIR/issue-20225.rs:18:47 @@ -33,13 +35,14 @@ LL | impl<'a, T> FnOnce<(&'a T,)> for Foo { | - found this type parameter ... LL | extern "rust-call" fn call_once(self, (_,): (T,)) {} - | ^^^^ - | | - | expected `&'a T`, found type parameter `T` - | help: change the parameter type to match the trait: `(&'a T,)` + | ^^^^ expected `&'a T`, found type parameter `T` | = note: expected signature `extern "rust-call" fn(Foo, (&'a _,))` found signature `extern "rust-call" fn(Foo, (_,))` +help: change the parameter type to match the trait + | +LL | extern "rust-call" fn call_once(self, (_,): (&'a T,)) {} + | ~~~~~~~~ error: aborting due to 3 previous errors diff --git a/tests/ui/issues/issue-21332.stderr b/tests/ui/issues/issue-21332.stderr index 96e0f5fdb31db..7c960f7646db7 100644 --- a/tests/ui/issues/issue-21332.stderr +++ b/tests/ui/issues/issue-21332.stderr @@ -2,13 +2,14 @@ error[E0053]: method `next` has an incompatible type for trait --> $DIR/issue-21332.rs:5:27 | LL | fn next(&mut self) -> Result { Ok(7) } - | ^^^^^^^^^^^^^^^^ - | | - | expected `Option`, found `Result` - | help: change the output type to match the trait: `Option` + | ^^^^^^^^^^^^^^^^ expected `Option`, found `Result` | = note: expected signature `fn(&mut S) -> Option` found signature `fn(&mut S) -> Result` +help: change the output type to match the trait + | +LL | fn next(&mut self) -> Option { Ok(7) } + | ~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-21950.stderr b/tests/ui/issues/issue-21950.stderr index e498565d4e653..e1fab0e8e1b27 100644 --- a/tests/ui/issues/issue-21950.stderr +++ b/tests/ui/issues/issue-21950.stderr @@ -14,9 +14,13 @@ LL | trait Add { | ------------------- type parameter `Rhs` must be specified for this ... LL | let x = &10 as &dyn Add; - | ^^^ help: set the type parameter to the desired type: `Add` + | ^^^ | = note: because of the default `Self` reference, type parameters must be specified on object types +help: set the type parameter to the desired type + | +LL | let x = &10 as &dyn Add; + | ~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-22370.stderr b/tests/ui/issues/issue-22370.stderr index 977cfe06bb8b9..9aa68bba75e59 100644 --- a/tests/ui/issues/issue-22370.stderr +++ b/tests/ui/issues/issue-22370.stderr @@ -5,9 +5,13 @@ LL | trait A {} | --------------- type parameter `T` must be specified for this LL | LL | fn f(a: &dyn A) {} - | ^ help: set the type parameter to the desired type: `A` + | ^ | = note: because of the default `Self` reference, type parameters must be specified on object types +help: set the type parameter to the desired type + | +LL | fn f(a: &dyn A) {} + | ~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-23024.stderr b/tests/ui/issues/issue-23024.stderr index 1672622d8b723..ae5186c1bc7ca 100644 --- a/tests/ui/issues/issue-23024.stderr +++ b/tests/ui/issues/issue-23024.stderr @@ -2,11 +2,15 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje --> $DIR/issue-23024.rs:8:39 | LL | println!("{:?}",(vfnfer[0] as dyn Fn)(3)); - | ^^ help: use parenthetical notation instead: `Fn() -> ()` + | ^^ | = note: see issue #29625 for more information = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: use parenthetical notation instead + | +LL | println!("{:?}",(vfnfer[0] as dyn Fn() -> ())(3)); + | ~~~~~~~~~~ error[E0107]: missing generics for trait `Fn` --> $DIR/issue-23024.rs:8:39 diff --git a/tests/ui/issues/issue-23217.stderr b/tests/ui/issues/issue-23217.stderr index 05ee0474c7838..d14da75ab72e6 100644 --- a/tests/ui/issues/issue-23217.stderr +++ b/tests/ui/issues/issue-23217.stderr @@ -4,10 +4,12 @@ error[E0599]: no variant or associated item named `A` found for enum `SomeEnum` LL | pub enum SomeEnum { | ----------------- variant or associated item `A` not found for this enum LL | B = SomeEnum::A, - | ^ - | | - | variant or associated item not found in `SomeEnum` - | help: there is a variant with a similar name: `B` + | ^ variant or associated item not found in `SomeEnum` + | +help: there is a variant with a similar name + | +LL | B = SomeEnum::B, + | ~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-27842.stderr b/tests/ui/issues/issue-27842.stderr index b18fe1512b50b..cce721b5251da 100644 --- a/tests/ui/issues/issue-27842.stderr +++ b/tests/ui/issues/issue-27842.stderr @@ -2,7 +2,12 @@ error[E0608]: cannot index into a value of type `({integer}, {integer}, {integer --> $DIR/issue-27842.rs:4:16 | LL | let _ = tup[0]; - | ^^^ help: to access tuple elements, use: `.0` + | ^^^ + | +help: to access tuple elements, use + | +LL | let _ = tup.0; + | ~~ error[E0608]: cannot index into a value of type `({integer}, {integer}, {integer})` --> $DIR/issue-27842.rs:9:16 diff --git a/tests/ui/issues/issue-28971.stderr b/tests/ui/issues/issue-28971.stderr index 26057cbc2d1d8..7ca57d6b99817 100644 --- a/tests/ui/issues/issue-28971.stderr +++ b/tests/ui/issues/issue-28971.stderr @@ -5,10 +5,12 @@ LL | enum Foo { | -------- variant or associated item `Baz` not found for this enum ... LL | Foo::Baz(..) => (), - | ^^^ - | | - | variant or associated item not found in `Foo` - | help: there is a variant with a similar name: `Bar` + | ^^^ variant or associated item not found in `Foo` + | +help: there is a variant with a similar name + | +LL | Foo::Bar(..) => (), + | ~~~ error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable --> $DIR/issue-28971.rs:15:5 diff --git a/tests/ui/issues/issue-32004.stderr b/tests/ui/issues/issue-32004.stderr index 2d2ed5a63015b..48e4030c3a4c2 100644 --- a/tests/ui/issues/issue-32004.stderr +++ b/tests/ui/issues/issue-32004.stderr @@ -25,7 +25,12 @@ LL | struct S; | --------- `S` defined here ... LL | S(()) => {} - | ^^^^^ help: use this syntax instead: `S` + | ^^^^^ + | +help: use this syntax instead + | +LL | S => {} + | ~ error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-32086.stderr b/tests/ui/issues/issue-32086.stderr index e566dea89088d..ead431e345c94 100644 --- a/tests/ui/issues/issue-32086.stderr +++ b/tests/ui/issues/issue-32086.stderr @@ -5,7 +5,12 @@ LL | struct S(u8); | ------------- similarly named tuple struct `S` defined here ... LL | let C(a) = S(11); - | ^ help: a tuple struct with a similar name exists: `S` + | ^ + | +help: a tuple struct with a similar name exists + | +LL | let S(a) = S(11); + | ~ error[E0532]: expected tuple struct or tuple variant, found constant `C` --> $DIR/issue-32086.rs:6:9 @@ -14,7 +19,12 @@ LL | struct S(u8); | ------------- similarly named tuple struct `S` defined here ... LL | let C(..) = S(11); - | ^ help: a tuple struct with a similar name exists: `S` + | ^ + | +help: a tuple struct with a similar name exists + | +LL | let S(..) = S(11); + | ~ error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-32655.stderr b/tests/ui/issues/issue-32655.stderr index b8362499b2d0a..af029884d6afb 100644 --- a/tests/ui/issues/issue-32655.stderr +++ b/tests/ui/issues/issue-32655.stderr @@ -2,7 +2,7 @@ error: cannot find attribute `derive_Clone` in this scope --> $DIR/issue-32655.rs:3:11 | LL | #[derive_Clone] - | ^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `derive_const` + | ^^^^^^^^^^^^ ... LL | foo!(); | ------ in this macro invocation @@ -11,15 +11,24 @@ LL | foo!(); = note: similarly named attribute macro `derive_const` defined here | = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) +help: an attribute macro with a similar name exists + | +LL | #[derive_const] + | ~~~~~~~~~~~~ error: cannot find attribute `derive_Clone` in this scope --> $DIR/issue-32655.rs:15:7 | LL | #[derive_Clone] - | ^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `derive_const` + | ^^^^^^^^^^^^ --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | = note: similarly named attribute macro `derive_const` defined here + | +help: an attribute macro with a similar name exists + | +LL | #[derive_const] + | ~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-33504.stderr b/tests/ui/issues/issue-33504.stderr index f3e1ca08b6fc3..00be092375e12 100644 --- a/tests/ui/issues/issue-33504.stderr +++ b/tests/ui/issues/issue-33504.stderr @@ -9,7 +9,11 @@ LL | let Test = 1; | | | expected integer, found `Test` | `Test` is interpreted as a unit struct, not a new binding - | help: introduce a new binding instead: `other_test` + | +help: introduce a new binding instead + | +LL | let other_test = 1; + | ~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-34209.stderr b/tests/ui/issues/issue-34209.stderr index 41bc60d03dd81..4c61d250f52d1 100644 --- a/tests/ui/issues/issue-34209.stderr +++ b/tests/ui/issues/issue-34209.stderr @@ -5,7 +5,12 @@ LL | enum S { | ------ variant `B` not found here ... LL | S::B {} => {}, - | ^ help: there is a variant with a similar name: `A` + | ^ + | +help: there is a variant with a similar name + | +LL | S::A {} => {}, + | ~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-4265.stderr b/tests/ui/issues/issue-4265.stderr index 23d00aaa44b54..e988f01d0f727 100644 --- a/tests/ui/issues/issue-4265.stderr +++ b/tests/ui/issues/issue-4265.stderr @@ -14,10 +14,7 @@ LL | struct Foo { | ---------- method `bar` not found for this struct ... LL | Foo { baz: 0 }.bar(); - | ---------------^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `Foo::bar()` + | ^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `Foo` @@ -25,6 +22,10 @@ note: the candidate is defined in an impl for the type `Foo` | LL | fn bar() { | ^^^^^^^^ +help: use associated function syntax instead + | +LL | Foo::bar(); + | ~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-46332.stderr b/tests/ui/issues/issue-46332.stderr index 8c0c1dfa6ee86..639bd2be04bef 100644 --- a/tests/ui/issues/issue-46332.stderr +++ b/tests/ui/issues/issue-46332.stderr @@ -5,7 +5,12 @@ LL | struct TyUint {} | ------------- similarly named struct `TyUint` defined here ... LL | TyUInt {}; - | ^^^^^^ help: a struct with a similar name exists (notice the capitalization): `TyUint` + | ^^^^^^ + | +help: a struct with a similar name exists (notice the capitalization difference) + | +LL | TyUint {}; + | ~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-4968.stderr b/tests/ui/issues/issue-4968.stderr index 549e5509474de..7959011af9133 100644 --- a/tests/ui/issues/issue-4968.stderr +++ b/tests/ui/issues/issue-4968.stderr @@ -9,11 +9,14 @@ LL | match 42 { A => () } | | | | | expected integer, found `(isize, isize)` | | `A` is interpreted as a constant, not a new binding - | | help: introduce a new binding instead: `other_a` | this expression has type `{integer}` | = note: expected type `{integer}` found tuple `(isize, isize)` +help: introduce a new binding instead + | +LL | match 42 { other_a => () } + | ~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-5100.stderr b/tests/ui/issues/issue-5100.stderr index b1680aacd1656..440d22db3a740 100644 --- a/tests/ui/issues/issue-5100.stderr +++ b/tests/ui/issues/issue-5100.stderr @@ -60,7 +60,12 @@ error[E0618]: expected function, found `(char, char)` --> $DIR/issue-5100.rs:48:14 | LL | let v = [('a', 'b') - | ^^^^^^^^^^- help: consider separating array elements with a comma: `,` + | ^^^^^^^^^^ + | +help: consider separating array elements with a comma + | +LL | let v = [('a', 'b'), + | + error[E0308]: mismatched types --> $DIR/issue-5100.rs:55:19 diff --git a/tests/ui/issues/issue-52717.stderr b/tests/ui/issues/issue-52717.stderr index ab8c37225cae6..e8ecc0bb5cf59 100644 --- a/tests/ui/issues/issue-52717.stderr +++ b/tests/ui/issues/issue-52717.stderr @@ -2,10 +2,12 @@ error[E0026]: variant `A::A` does not have a field named `fob` --> $DIR/issue-52717.rs:10:12 | LL | A::A { fob } => { println!("{}", fob); } - | ^^^ - | | - | variant `A::A` does not have this field - | help: a field with a similar name exists: `foo` + | ^^^ variant `A::A` does not have this field + | +help: a field with a similar name exists + | +LL | A::A { foo } => { println!("{}", fob); } + | ~~~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-53251.stderr b/tests/ui/issues/issue-53251.stderr index 05ea631158964..db9df7d911c41 100644 --- a/tests/ui/issues/issue-53251.stderr +++ b/tests/ui/issues/issue-53251.stderr @@ -2,9 +2,7 @@ error[E0107]: associated function takes 0 generic arguments but 1 generic argume --> $DIR/issue-53251.rs:11:20 | LL | S::f::(); - | ^------- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments ... LL | impl_add!(a b); | -------------- in this macro invocation @@ -15,14 +13,17 @@ note: associated function defined here, with 0 generic parameters LL | fn f() {} | ^ = note: this error originates in the macro `impl_add` (in Nightly builds, run with -Z macro-backtrace for more info) +help: remove these generics + | +LL - S::f::(); +LL + S::f(); + | error[E0107]: associated function takes 0 generic arguments but 1 generic argument was supplied --> $DIR/issue-53251.rs:11:20 | LL | S::f::(); - | ^------- help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments ... LL | impl_add!(a b); | -------------- in this macro invocation @@ -34,6 +35,11 @@ LL | fn f() {} | ^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` = note: this error originates in the macro `impl_add` (in Nightly builds, run with -Z macro-backtrace for more info) +help: remove these generics + | +LL - S::f::(); +LL + S::f(); + | error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-56199.stderr b/tests/ui/issues/issue-56199.stderr index eb6d7005979f6..89c04368b5fea 100644 --- a/tests/ui/issues/issue-56199.stderr +++ b/tests/ui/issues/issue-56199.stderr @@ -18,13 +18,23 @@ error: the `Self` constructor can only be used with tuple or unit structs --> $DIR/issue-56199.rs:15:17 | LL | let _ = Self; - | ^^^^ help: use curly brackets: `Self { /* fields */ }` + | ^^^^ + | +help: use curly brackets + | +LL | let _ = Self { /* fields */ }; + | ~~~~~~~~~~~~~~~~~~~~~ error: the `Self` constructor can only be used with tuple or unit structs --> $DIR/issue-56199.rs:17:17 | LL | let _ = Self(); - | ^^^^^^ help: use curly brackets: `Self { /* fields */ }` + | ^^^^^^ + | +help: use curly brackets + | +LL | let _ = Self { /* fields */ }; + | ~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 4 previous errors diff --git a/tests/ui/issues/issue-56835.stderr b/tests/ui/issues/issue-56835.stderr index e949ae7b32402..f2bce5a1f8692 100644 --- a/tests/ui/issues/issue-56835.stderr +++ b/tests/ui/issues/issue-56835.stderr @@ -2,7 +2,12 @@ error: the `Self` constructor can only be used with tuple or unit structs --> $DIR/issue-56835.rs:4:12 | LL | fn bar(Self(foo): Self) {} - | ^^^^^^^^^ help: use curly brackets: `Self { /* fields */ }` + | ^^^^^^^^^ + | +help: use curly brackets + | +LL | fn bar(Self { /* fields */ }: Self) {} + | ~~~~~~~~~~~~~~~~~~~~~ error[E0164]: expected tuple struct or tuple variant, found self constructor `Self` --> $DIR/issue-56835.rs:4:12 diff --git a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.stderr b/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.stderr index 38014ecce7574..3c19b68cffbb3 100644 --- a/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.stderr +++ b/tests/ui/issues/issue-57741-dereference-boxed-value/issue-57741.stderr @@ -2,57 +2,61 @@ error[E0308]: mismatched types --> $DIR/issue-57741.rs:20:9 | LL | let y = match x { - | - - | | - | this expression has type `Box` - | help: consider dereferencing the boxed value: `*x` + | - this expression has type `Box` LL | T::A(a) | T::B(a) => a, | ^^^^^^^ expected `Box`, found `T` | = note: expected struct `Box` found enum `T` +help: consider dereferencing the boxed value + | +LL | let y = match *x { + | ~~ error[E0308]: mismatched types --> $DIR/issue-57741.rs:20:19 | LL | let y = match x { - | - - | | - | this expression has type `Box` - | help: consider dereferencing the boxed value: `*x` + | - this expression has type `Box` LL | T::A(a) | T::B(a) => a, | ^^^^^^^ expected `Box`, found `T` | = note: expected struct `Box` found enum `T` +help: consider dereferencing the boxed value + | +LL | let y = match *x { + | ~~ error[E0308]: mismatched types --> $DIR/issue-57741.rs:27:9 | LL | let y = match x { - | - - | | - | this expression has type `Box` - | help: consider dereferencing the boxed value: `*x` + | - this expression has type `Box` LL | S::A { a } | S::B { b: a } => a, | ^^^^^^^^^^ expected `Box`, found `S` | = note: expected struct `Box` found enum `S` +help: consider dereferencing the boxed value + | +LL | let y = match *x { + | ~~ error[E0308]: mismatched types --> $DIR/issue-57741.rs:27:22 | LL | let y = match x { - | - - | | - | this expression has type `Box` - | help: consider dereferencing the boxed value: `*x` + | - this expression has type `Box` LL | S::A { a } | S::B { b: a } => a, | ^^^^^^^^^^^^^ expected `Box`, found `S` | = note: expected struct `Box` found enum `S` +help: consider dereferencing the boxed value + | +LL | let y = match *x { + | ~~ error: aborting due to 4 previous errors diff --git a/tests/ui/issues/issue-60622.stderr b/tests/ui/issues/issue-60622.stderr index 43da2773940e5..e694a92213c85 100644 --- a/tests/ui/issues/issue-60622.stderr +++ b/tests/ui/issues/issue-60622.stderr @@ -20,15 +20,18 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-60622.rs:10:7 | LL | b.a::<'_, T>(); - | ^ - help: remove this generic argument - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: method defined here, with 0 generic parameters --> $DIR/issue-60622.rs:6:8 | LL | fn a(&self) {} | ^ +help: remove this generic argument + | +LL - b.a::<'_, T>(); +LL + b.a::<'_, >(); + | error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-63983.stderr b/tests/ui/issues/issue-63983.stderr index f90c81116264a..c2b2970598902 100644 --- a/tests/ui/issues/issue-63983.stderr +++ b/tests/ui/issues/issue-63983.stderr @@ -5,7 +5,12 @@ LL | Tuple(i32), | ---------- `MyEnum::Tuple` defined here ... LL | MyEnum::Tuple => "", - | ^^^^^^^^^^^^^ help: use the tuple variant pattern syntax instead: `MyEnum::Tuple(_)` + | ^^^^^^^^^^^^^ + | +help: use the tuple variant pattern syntax instead + | +LL | MyEnum::Tuple(_) => "", + | ~~~~~~~~~~~~~~~~ error[E0533]: expected unit struct, unit variant or constant, found struct variant `MyEnum::Struct` --> $DIR/issue-63983.rs:10:9 diff --git a/tests/ui/issues/issue-64792-bad-unicode-ctor.stderr b/tests/ui/issues/issue-64792-bad-unicode-ctor.stderr index 7fc414602d281..6e8dd4db2702b 100644 --- a/tests/ui/issues/issue-64792-bad-unicode-ctor.stderr +++ b/tests/ui/issues/issue-64792-bad-unicode-ctor.stderr @@ -5,7 +5,12 @@ LL | struct X {} | ----------- `X` defined here LL | LL | const Y: X = X("ö"); - | ^^^^^^ help: use struct literal syntax instead: `X {}` + | ^^^^^^ + | +help: use struct literal syntax instead + | +LL | const Y: X = X {}; + | ~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-pr29383.stderr b/tests/ui/issues/issue-pr29383.stderr index 57783d75ba182..a2d13c93c905f 100644 --- a/tests/ui/issues/issue-pr29383.stderr +++ b/tests/ui/issues/issue-pr29383.stderr @@ -5,7 +5,12 @@ LL | A, | - `E::A` defined here ... LL | Some(E::A(..)) => {} - | ^^^^^^^^ help: use this syntax instead: `E::A` + | ^^^^^^^^ + | +help: use this syntax instead + | +LL | Some(E::A) => {} + | ~~~~ error[E0532]: expected tuple struct or tuple variant, found unit variant `E::B` --> $DIR/issue-pr29383.rs:11:14 @@ -14,7 +19,12 @@ LL | B, | - `E::B` defined here ... LL | Some(E::B(..)) => {} - | ^^^^^^^^ help: use this syntax instead: `E::B` + | ^^^^^^^^ + | +help: use this syntax instead + | +LL | Some(E::B) => {} + | ~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/label/label_misspelled.stderr b/tests/ui/label/label_misspelled.stderr index 4b5b9e92ca09a..89c9dd0411d46 100644 --- a/tests/ui/label/label_misspelled.stderr +++ b/tests/ui/label/label_misspelled.stderr @@ -40,10 +40,12 @@ error[E0425]: cannot find value `LOOP` in this scope LL | 'LOOP: loop { | ----- a label with a similar name exists LL | break LOOP; - | ^^^^ - | | - | not found in this scope - | help: use the similarly named label: `'LOOP` + | ^^^^ not found in this scope + | +help: use the similarly named label + | +LL | break 'LOOP; + | ~~~~~ error[E0425]: cannot find value `while_loop` in this scope --> $DIR/label_misspelled.rs:32:15 @@ -51,10 +53,12 @@ error[E0425]: cannot find value `while_loop` in this scope LL | 'while_loop: while true { | ----------- a label with a similar name exists LL | break while_loop; - | ^^^^^^^^^^ - | | - | not found in this scope - | help: use the similarly named label: `'while_loop` + | ^^^^^^^^^^ not found in this scope + | +help: use the similarly named label + | +LL | break 'while_loop; + | ~~~~~~~~~~~ error[E0425]: cannot find value `while_let` in this scope --> $DIR/label_misspelled.rs:36:15 @@ -62,10 +66,12 @@ error[E0425]: cannot find value `while_let` in this scope LL | 'while_let: while let Some(_) = Some(()) { | ---------- a label with a similar name exists LL | break while_let; - | ^^^^^^^^^ - | | - | not found in this scope - | help: use the similarly named label: `'while_let` + | ^^^^^^^^^ not found in this scope + | +help: use the similarly named label + | +LL | break 'while_let; + | ~~~~~~~~~~ error[E0425]: cannot find value `for_loop` in this scope --> $DIR/label_misspelled.rs:40:15 @@ -73,10 +79,12 @@ error[E0425]: cannot find value `for_loop` in this scope LL | 'for_loop: for _ in 0..3 { | --------- a label with a similar name exists LL | break for_loop; - | ^^^^^^^^ - | | - | not found in this scope - | help: use the similarly named label: `'for_loop` + | ^^^^^^^^ not found in this scope + | +help: use the similarly named label + | +LL | break 'for_loop; + | ~~~~~~~~~ warning: unused label --> $DIR/label_misspelled.rs:4:5 diff --git a/tests/ui/label/label_misspelled_2.stderr b/tests/ui/label/label_misspelled_2.stderr index 960646d9894d1..8661f2390bce5 100644 --- a/tests/ui/label/label_misspelled_2.stderr +++ b/tests/ui/label/label_misspelled_2.stderr @@ -16,10 +16,12 @@ error[E0425]: cannot find value `b` in this scope LL | 'b: for _ in 0..1 { | -- a label with a similar name exists LL | break b; - | ^ - | | - | not found in this scope - | help: use the similarly named label: `'b` + | ^ not found in this scope + | +help: use the similarly named label + | +LL | break 'b; + | ~~ error[E0425]: cannot find value `d` in this scope --> $DIR/label_misspelled_2.rs:14:15 @@ -27,10 +29,12 @@ error[E0425]: cannot find value `d` in this scope LL | d: for _ in 0..1 { | - a label with a similar name exists LL | break d; - | ^ - | | - | not found in this scope - | help: use the similarly named label: `'d` + | ^ not found in this scope + | +help: use the similarly named label + | +LL | break 'd; + | ~~ error: aborting due to 4 previous errors diff --git a/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr b/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr index 1b8f1c3fd6fae..de0a0631bf884 100644 --- a/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr +++ b/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr @@ -2,15 +2,18 @@ error[E0107]: type alias takes 1 lifetime argument but 2 lifetime arguments were --> $DIR/mismatched_arg_count.rs:9:29 | LL | fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {} - | ^^^^^ -- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^^^^^ expected 1 lifetime argument | note: type alias defined here, with 1 lifetime parameter: `'a` --> $DIR/mismatched_arg_count.rs:7:6 | LL | type Alias<'a, T> = >::Assoc; | ^^^^^ -- +help: remove this lifetime argument + | +LL - fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {} +LL + fn bar<'a, T: Trait<'a>>(_: Alias<'a, , T>) {} + | error: aborting due to 1 previous error diff --git a/tests/ui/let-else/let-else-slicing-error.stderr b/tests/ui/let-else/let-else-slicing-error.stderr index 73c357dd5d462..43b3e6fc46e81 100644 --- a/tests/ui/let-else/let-else-slicing-error.stderr +++ b/tests/ui/let-else/let-else-slicing-error.stderr @@ -2,9 +2,12 @@ error[E0529]: expected an array or slice, found `Vec<{integer}>` --> $DIR/let-else-slicing-error.rs:6:9 | LL | let [x, y] = nums else { - | ^^^^^^ ---- help: consider slicing here: `nums[..]` - | | - | pattern cannot match with input type `Vec<{integer}>` + | ^^^^^^ pattern cannot match with input type `Vec<{integer}>` + | +help: consider slicing here + | +LL | let [x, y] = nums[..] else { + | ~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr index 0980de92d350e..bf109fe446de9 100644 --- a/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr +++ b/tests/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-one-is-struct-2.stderr @@ -16,10 +16,13 @@ LL | fn foo<'a>(mut x: Ref<'a, 'a>, y: &'a u32) { error[E0384]: cannot assign to immutable argument `y` --> $DIR/ex3-both-anon-regions-one-is-struct-2.rs:4:5 | -LL | fn foo(mut x: Ref, y: &u32) { - | - help: consider making this binding mutable: `mut y` LL | y = x.b; | ^^^^^^^ cannot assign to immutable argument + | +help: consider making this binding mutable + | +LL | fn foo(mut x: Ref, mut y: &u32) { + | ~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr b/tests/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr index b47a47d631e5f..1f4e622c7c095 100644 --- a/tests/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr +++ b/tests/ui/lifetimes/lifetime-errors/liveness-assign-imm-local-notes.stderr @@ -1,45 +1,53 @@ error[E0384]: cannot assign twice to immutable variable `x` --> $DIR/liveness-assign-imm-local-notes.rs:10:9 | -LL | let x; - | - help: consider making this binding mutable: `mut x` -... LL | x = 2; | ----- first assignment to `x` LL | x = 3; | ^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut x; + | ~~~~~ error[E0384]: cannot assign twice to immutable variable `x` --> $DIR/liveness-assign-imm-local-notes.rs:21:13 | -LL | let x; - | - help: consider making this binding mutable: `mut x` -... LL | x = 2; | ----- first assignment to `x` LL | x = 3; | ^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut x; + | ~~~~~ error[E0384]: cannot assign twice to immutable variable `x` --> $DIR/liveness-assign-imm-local-notes.rs:30:13 | -LL | let x; - | - help: consider making this binding mutable: `mut x` -... LL | x = 1; | ^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut x; + | ~~~~~ error[E0384]: cannot assign twice to immutable variable `x` --> $DIR/liveness-assign-imm-local-notes.rs:32:13 | -LL | let x; - | - help: consider making this binding mutable: `mut x` -... LL | x = 1; | ----- first assignment to `x` LL | } else { LL | x = 2; | ^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut x; + | ~~~~~ error: aborting due to 4 previous errors diff --git a/tests/ui/lifetimes/noisy-follow-up-erro.stderr b/tests/ui/lifetimes/noisy-follow-up-erro.stderr index f549009a87c12..38465c7ac963a 100644 --- a/tests/ui/lifetimes/noisy-follow-up-erro.stderr +++ b/tests/ui/lifetimes/noisy-follow-up-erro.stderr @@ -2,15 +2,18 @@ error[E0107]: struct takes 2 lifetime arguments but 3 lifetime arguments were su --> $DIR/noisy-follow-up-erro.rs:12:30 | LL | fn boom(&self, foo: &mut Foo<'_, '_, 'a>) -> Result<(), &'a ()> { - | ^^^ -- help: remove this lifetime argument - | | - | expected 2 lifetime arguments + | ^^^ expected 2 lifetime arguments | note: struct defined here, with 2 lifetime parameters: `'c`, `'d` --> $DIR/noisy-follow-up-erro.rs:1:8 | LL | struct Foo<'c, 'd>(&'c (), &'d ()); | ^^^ -- -- +help: remove this lifetime argument + | +LL - fn boom(&self, foo: &mut Foo<'_, '_, 'a>) -> Result<(), &'a ()> { +LL + fn boom(&self, foo: &mut Foo<'_, '_, >) -> Result<(), &'a ()> { + | error[E0621]: explicit lifetime required in the type of `foo` --> $DIR/noisy-follow-up-erro.rs:14:9 diff --git a/tests/ui/lint/command-line-lint-group-deny.stderr b/tests/ui/lint/command-line-lint-group-deny.stderr index d78f198e73210..12fd97ebdf3dd 100644 --- a/tests/ui/lint/command-line-lint-group-deny.stderr +++ b/tests/ui/lint/command-line-lint-group-deny.stderr @@ -2,10 +2,14 @@ error: variable `_InappropriateCamelCasing` should have a snake case name --> $DIR/command-line-lint-group-deny.rs:4:9 | LL | let _InappropriateCamelCasing = true; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `_inappropriate_camel_casing` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-D non-snake-case` implied by `-D bad-style` = help: to override `-D bad-style` add `#[allow(non_snake_case)]` +help: convert the identifier to snake case + | +LL | let _inappropriate_camel_casing = true; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/command-line-lint-group-forbid.stderr b/tests/ui/lint/command-line-lint-group-forbid.stderr index 7b527e7b8b461..4dfc639c40a37 100644 --- a/tests/ui/lint/command-line-lint-group-forbid.stderr +++ b/tests/ui/lint/command-line-lint-group-forbid.stderr @@ -2,10 +2,14 @@ error: variable `_InappropriateCamelCasing` should have a snake case name --> $DIR/command-line-lint-group-forbid.rs:4:9 | LL | let _InappropriateCamelCasing = true; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `_inappropriate_camel_casing` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-F non-snake-case` implied by `-F bad-style` = help: to override `-F bad-style` add `#[allow(non_snake_case)]` +help: convert the identifier to snake case + | +LL | let _inappropriate_camel_casing = true; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/command-line-lint-group-warn.stderr b/tests/ui/lint/command-line-lint-group-warn.stderr index cfe346a5bf6b0..36c0756bcee37 100644 --- a/tests/ui/lint/command-line-lint-group-warn.stderr +++ b/tests/ui/lint/command-line-lint-group-warn.stderr @@ -2,10 +2,14 @@ warning: variable `_InappropriateCamelCasing` should have a snake case name --> $DIR/command-line-lint-group-warn.rs:5:9 | LL | let _InappropriateCamelCasing = true; - | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `_inappropriate_camel_casing` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `-W non-snake-case` implied by `-W bad-style` = help: to override `-W bad-style` add `#[allow(non_snake_case)]` +help: convert the identifier to snake case + | +LL | let _inappropriate_camel_casing = true; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: 1 warning emitted diff --git a/tests/ui/lint/enable-unstable-lib-feature.stderr b/tests/ui/lint/enable-unstable-lib-feature.stderr index 327e6e3e956fb..16ce9d19dda29 100644 --- a/tests/ui/lint/enable-unstable-lib-feature.stderr +++ b/tests/ui/lint/enable-unstable-lib-feature.stderr @@ -2,13 +2,17 @@ error: function `BOGUS` should have a snake case name --> $DIR/enable-unstable-lib-feature.rs:11:8 | LL | pub fn BOGUS() { } - | ^^^^^ help: convert the identifier to snake case: `bogus` + | ^^^^^ | note: the lint level is defined here --> $DIR/enable-unstable-lib-feature.rs:6:9 | LL | #![deny(non_snake_case)] // To trigger a hard error | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | pub fn bogus() { } + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/expr_attr_paren_order.stderr b/tests/ui/lint/expr_attr_paren_order.stderr index b3a3741d245f1..45a2d43510a73 100644 --- a/tests/ui/lint/expr_attr_paren_order.stderr +++ b/tests/ui/lint/expr_attr_paren_order.stderr @@ -2,13 +2,17 @@ error: variable `X` should have a snake case name --> $DIR/expr_attr_paren_order.rs:17:17 | LL | let X = 0; - | ^ help: convert the identifier to snake case (notice the capitalization): `x` + | ^ | note: the lint level is defined here --> $DIR/expr_attr_paren_order.rs:15:37 | LL | #[allow(non_snake_case)] #[deny(non_snake_case)] ( | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case (notice the capitalization difference) + | +LL | let x = 0; + | ~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/forbid-group-group-1.stderr b/tests/ui/lint/forbid-group-group-1.stderr index bbea56ac64ae7..8e808ed2e04db 100644 --- a/tests/ui/lint/forbid-group-group-1.stderr +++ b/tests/ui/lint/forbid-group-group-1.stderr @@ -2,7 +2,7 @@ error: variable `A` should have a snake case name --> $DIR/forbid-group-group-1.rs:11:9 | LL | let A: (); - | ^ help: convert the identifier to snake case: `a` + | ^ | note: the lint level is defined here --> $DIR/forbid-group-group-1.rs:4:11 @@ -10,6 +10,10 @@ note: the lint level is defined here LL | #![forbid(nonstandard_style)] | ^^^^^^^^^^^^^^^^^ = note: `#[forbid(non_snake_case)]` implied by `#[forbid(nonstandard_style)]` +help: convert the identifier to snake case + | +LL | let a: (); + | ~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr b/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr index e925a195fb1c4..2ebed5a082121 100644 --- a/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr +++ b/tests/ui/lint/force-warn/lint-group-allow-warnings.stderr @@ -2,10 +2,14 @@ warning: function `FUNCTION` should have a snake case name --> $DIR/lint-group-allow-warnings.rs:9:8 | LL | pub fn FUNCTION() {} - | ^^^^^^^^ help: convert the identifier to snake case: `function` + | ^^^^^^^^ | = note: `--force-warn non-snake-case` implied by `--force-warn nonstandard-style` = help: to override `--force-warn nonstandard-style` add `#[allow(non_snake_case)]` +help: convert the identifier to snake case + | +LL | pub fn function() {} + | ~~~~~~~~ warning: 1 warning emitted diff --git a/tests/ui/lint/lint-attr-everywhere-late.stderr b/tests/ui/lint/lint-attr-everywhere-late.stderr index ddc31905afbcf..f9f910cccbefc 100644 --- a/tests/ui/lint/lint-attr-everywhere-late.stderr +++ b/tests/ui/lint/lint-attr-everywhere-late.stderr @@ -194,13 +194,17 @@ error: variable `PARAM` should have a snake case name --> $DIR/lint-attr-everywhere-late.rs:131:37 | LL | fn function(#[deny(non_snake_case)] PARAM: i32) {} - | ^^^^^ help: convert the identifier to snake case: `param` + | ^^^^^ | note: the lint level is defined here --> $DIR/lint-attr-everywhere-late.rs:131:20 | LL | fn function(#[deny(non_snake_case)] PARAM: i32) {} | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | fn function(#[deny(non_snake_case)] param: i32) {} + | ~~~~~ error: the return value of `mem::discriminant` is unspecified when called with a non-enum type --> $DIR/lint-attr-everywhere-late.rs:139:13 @@ -223,13 +227,17 @@ error: variable `PARAM` should have a snake case name --> $DIR/lint-attr-everywhere-late.rs:145:44 | LL | let closure = |#[deny(non_snake_case)] PARAM: i32| {}; - | ^^^^^ help: convert the identifier to snake case: `param` + | ^^^^^ | note: the lint level is defined here --> $DIR/lint-attr-everywhere-late.rs:145:27 | LL | let closure = |#[deny(non_snake_case)] PARAM: i32| {}; | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | let closure = |#[deny(non_snake_case)] param: i32| {}; + | ~~~~~ error: the return value of `mem::discriminant` is unspecified when called with a non-enum type --> $DIR/lint-attr-everywhere-late.rs:155:13 @@ -269,13 +277,17 @@ error: variable `ARM_VAR` should have a snake case name --> $DIR/lint-attr-everywhere-late.rs:167:9 | LL | ARM_VAR => {} - | ^^^^^^^ help: convert the identifier to snake case: `arm_var` + | ^^^^^^^ | note: the lint level is defined here --> $DIR/lint-attr-everywhere-late.rs:166:16 | LL | #[deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | arm_var => {} + | ~~~~~~~ error: the return value of `mem::discriminant` is unspecified when called with a non-enum type --> $DIR/lint-attr-everywhere-late.rs:173:9 diff --git a/tests/ui/lint/lint-group-nonstandard-style.stderr b/tests/ui/lint/lint-group-nonstandard-style.stderr index fcd0101237185..acbaf66b2f0d1 100644 --- a/tests/ui/lint/lint-group-nonstandard-style.stderr +++ b/tests/ui/lint/lint-group-nonstandard-style.stderr @@ -15,7 +15,7 @@ error: function `CamelCase` should have a snake case name --> $DIR/lint-group-nonstandard-style.rs:4:4 | LL | fn CamelCase() {} - | ^^^^^^^^^ help: convert the identifier to snake case: `camel_case` + | ^^^^^^^^^ | note: the lint level is defined here --> $DIR/lint-group-nonstandard-style.rs:1:9 @@ -23,12 +23,16 @@ note: the lint level is defined here LL | #![deny(nonstandard_style)] | ^^^^^^^^^^^^^^^^^ = note: `#[deny(non_snake_case)]` implied by `#[deny(nonstandard_style)]` +help: convert the identifier to snake case + | +LL | fn camel_case() {} + | ~~~~~~~~~~ error: function `CamelCase` should have a snake case name --> $DIR/lint-group-nonstandard-style.rs:12:12 | LL | fn CamelCase() {} - | ^^^^^^^^^ help: convert the identifier to snake case: `camel_case` + | ^^^^^^^^^ | note: the lint level is defined here --> $DIR/lint-group-nonstandard-style.rs:10:14 @@ -36,6 +40,10 @@ note: the lint level is defined here LL | #[forbid(nonstandard_style)] | ^^^^^^^^^^^^^^^^^ = note: `#[forbid(non_snake_case)]` implied by `#[forbid(nonstandard_style)]` +help: convert the identifier to snake case + | +LL | fn camel_case() {} + | ~~~~~~~~~~ error: static variable `bad` should have an upper case name --> $DIR/lint-group-nonstandard-style.rs:14:16 @@ -49,9 +57,13 @@ warning: function `CamelCase` should have a snake case name --> $DIR/lint-group-nonstandard-style.rs:20:12 | LL | fn CamelCase() {} - | ^^^^^^^^^ help: convert the identifier to snake case: `camel_case` + | ^^^^^^^^^ | = note: `#[warn(non_snake_case)]` implied by `#[warn(nonstandard_style)]` +help: convert the identifier to snake case + | +LL | fn camel_case() {} + | ~~~~~~~~~~ error: aborting due to 3 previous errors; 2 warnings emitted diff --git a/tests/ui/lint/non-local-defs/consts.stderr b/tests/ui/lint/non-local-defs/consts.stderr index 9f70119e0f8c9..5f6fea6db4454 100644 --- a/tests/ui/lint/non-local-defs/consts.stderr +++ b/tests/ui/lint/non-local-defs/consts.stderr @@ -2,10 +2,7 @@ warning: non-local `impl` definition, `impl` blocks should be written at the sam --> $DIR/consts.rs:13:5 | LL | const Z: () = { - | ----------- - | | | - | | help: use a const-anon item to suppress this lint: `_` - | move the `impl` block outside of this constant `Z` + | ----------- move the `impl` block outside of this constant `Z` ... LL | impl Uto for &Test {} | ^^^^^---^^^^^----- @@ -18,6 +15,10 @@ LL | impl Uto for &Test {} = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue = note: `#[warn(non_local_definitions)]` on by default +help: use a const-anon item to suppress this lint + | +LL | const _: () = { + | ~ warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item --> $DIR/consts.rs:24:5 diff --git a/tests/ui/lint/non-local-defs/exhaustive.stderr b/tests/ui/lint/non-local-defs/exhaustive.stderr index 1e0d5caec3830..7534503e214b7 100644 --- a/tests/ui/lint/non-local-defs/exhaustive.stderr +++ b/tests/ui/lint/non-local-defs/exhaustive.stderr @@ -192,7 +192,6 @@ LL | impl Trait for *mut InsideMain {} | ^^^^^-----^^^^^--------------- | | | | | `*mut InsideMain` is not local - | | help: remove `*mut ` to make the `impl` local | `Trait` is not local | = note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type @@ -206,6 +205,11 @@ LL | fn main() { LL | struct InsideMain; | ----------------- may need to be moved as well = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue +help: remove `*mut ` to make the `impl` local + | +LL - impl Trait for *mut InsideMain {} +LL + impl Trait for InsideMain {} + | warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item --> $DIR/exhaustive.rs:60:5 diff --git a/tests/ui/lint/non-local-defs/from-local-for-global.stderr b/tests/ui/lint/non-local-defs/from-local-for-global.stderr index 67fd937d134cc..b080ff77dc421 100644 --- a/tests/ui/lint/non-local-defs/from-local-for-global.stderr +++ b/tests/ui/lint/non-local-defs/from-local-for-global.stderr @@ -41,7 +41,6 @@ LL | impl StillNonLocal for &Foo {} | ^^^^^-------------^^^^^---- | | | | | `&'_ Foo` is not local - | | help: remove `&` to make the `impl` local | `StillNonLocal` is not local | = note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type @@ -54,6 +53,11 @@ LL | fn only_global() { LL | struct Foo; | ---------- may need to be moved as well = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue +help: remove `&` to make the `impl` local + | +LL - impl StillNonLocal for &Foo {} +LL + impl StillNonLocal for Foo {} + | warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item --> $DIR/from-local-for-global.rs:40:5 diff --git a/tests/ui/lint/non-local-defs/trait-solver-overflow-123573.stderr b/tests/ui/lint/non-local-defs/trait-solver-overflow-123573.stderr index 80930ce1bcdf3..a072401e8e879 100644 --- a/tests/ui/lint/non-local-defs/trait-solver-overflow-123573.stderr +++ b/tests/ui/lint/non-local-defs/trait-solver-overflow-123573.stderr @@ -5,7 +5,6 @@ LL | impl Test for &Local {} | ^^^^^----^^^^^------ | | | | | `&'_ Local` is not local - | | help: remove `&` to make the `impl` local | `Test` is not local | = note: `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type @@ -19,6 +18,11 @@ LL | struct Local {} | ------------ may need to be moved as well = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue = note: `#[warn(non_local_definitions)]` on by default +help: remove `&` to make the `impl` local + | +LL - impl Test for &Local {} +LL + impl Test for Local {} + | warning: 1 warning emitted diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-cdylib.stderr b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-cdylib.stderr index f9167aa8df349..eb72e2b2c1761 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-cdylib.stderr +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-cdylib.stderr @@ -2,13 +2,17 @@ error: crate `NonSnakeCase` should have a snake case name --> $DIR/lint-non-snake-case-crate-cdylib.rs:3:18 | LL | #![crate_name = "NonSnakeCase"] - | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` + | ^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/lint-non-snake-case-crate-cdylib.rs:5:9 | LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | #![crate_name = "non_snake_case"] + | ~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-dylib.stderr b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-dylib.stderr index 4ee1a9cb3ddd5..9032601dc5b75 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-dylib.stderr +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-dylib.stderr @@ -2,13 +2,17 @@ error: crate `NonSnakeCase` should have a snake case name --> $DIR/lint-non-snake-case-crate-dylib.rs:3:18 | LL | #![crate_name = "NonSnakeCase"] - | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` + | ^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/lint-non-snake-case-crate-dylib.rs:5:9 | LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | #![crate_name = "non_snake_case"] + | ~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-lib.stderr b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-lib.stderr index a68c0e832b88c..6901342719d9a 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-lib.stderr +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-lib.stderr @@ -2,13 +2,17 @@ error: crate `NonSnakeCase` should have a snake case name --> $DIR/lint-non-snake-case-crate-lib.rs:3:18 | LL | #![crate_name = "NonSnakeCase"] - | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` + | ^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/lint-non-snake-case-crate-lib.rs:5:9 | LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | #![crate_name = "non_snake_case"] + | ~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-proc-macro.stderr b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-proc-macro.stderr index e0091057bc971..bd2caf5044483 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-proc-macro.stderr +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-proc-macro.stderr @@ -2,13 +2,17 @@ error: crate `NonSnakeCase` should have a snake case name --> $DIR/lint-non-snake-case-crate-proc-macro.rs:3:18 | LL | #![crate_name = "NonSnakeCase"] - | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` + | ^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/lint-non-snake-case-crate-proc-macro.rs:5:9 | LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | #![crate_name = "non_snake_case"] + | ~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-rlib.stderr b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-rlib.stderr index 6e9d54bd5bcde..ef18fde443cc1 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-rlib.stderr +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-rlib.stderr @@ -2,13 +2,17 @@ error: crate `NonSnakeCase` should have a snake case name --> $DIR/lint-non-snake-case-crate-rlib.rs:3:18 | LL | #![crate_name = "NonSnakeCase"] - | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` + | ^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/lint-non-snake-case-crate-rlib.rs:5:9 | LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | #![crate_name = "non_snake_case"] + | ~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-staticlib.stderr b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-staticlib.stderr index 4ee6d5bd4d46f..3364e20555d36 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-staticlib.stderr +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-crate-staticlib.stderr @@ -2,13 +2,17 @@ error: crate `NonSnakeCase` should have a snake case name --> $DIR/lint-non-snake-case-crate-staticlib.rs:3:18 | LL | #![crate_name = "NonSnakeCase"] - | ^^^^^^^^^^^^ help: convert the identifier to snake case: `non_snake_case` + | ^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/lint-non-snake-case-crate-staticlib.rs:5:9 | LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | #![crate_name = "non_snake_case"] + | ~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-functions.stderr b/tests/ui/lint/non-snake-case/lint-non-snake-case-functions.stderr index f6ac6b99b602f..e3f17f898d999 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-functions.stderr +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-functions.stderr @@ -2,61 +2,105 @@ error: method `Foo_Method` should have a snake case name --> $DIR/lint-non-snake-case-functions.rs:7:8 | LL | fn Foo_Method() {} - | ^^^^^^^^^^ help: convert the identifier to snake case: `foo_method` + | ^^^^^^^^^^ | note: the lint level is defined here --> $DIR/lint-non-snake-case-functions.rs:1:9 | LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | fn foo_method() {} + | ~~~~~~~~~~ error: method `foo__method` should have a snake case name --> $DIR/lint-non-snake-case-functions.rs:11:8 | LL | fn foo__method(&self) {} - | ^^^^^^^^^^^ help: convert the identifier to snake case: `foo_method` + | ^^^^^^^^^^^ + | +help: convert the identifier to snake case + | +LL | fn foo_method(&self) {} + | ~~~~~~~~~~ error: method `xyZ` should have a snake case name --> $DIR/lint-non-snake-case-functions.rs:14:12 | LL | pub fn xyZ(&mut self) {} - | ^^^ help: convert the identifier to snake case: `xy_z` + | ^^^ + | +help: convert the identifier to snake case + | +LL | pub fn xy_z(&mut self) {} + | ~~~~ error: method `render_HTML` should have a snake case name --> $DIR/lint-non-snake-case-functions.rs:17:8 | LL | fn render_HTML() {} - | ^^^^^^^^^^^ help: convert the identifier to snake case: `render_html` + | ^^^^^^^^^^^ + | +help: convert the identifier to snake case + | +LL | fn render_html() {} + | ~~~~~~~~~~~ error: trait method `ABC` should have a snake case name --> $DIR/lint-non-snake-case-functions.rs:22:8 | LL | fn ABC(); - | ^^^ help: convert the identifier to snake case: `abc` + | ^^^ + | +help: convert the identifier to snake case + | +LL | fn abc(); + | ~~~ error: trait method `a_b_C` should have a snake case name --> $DIR/lint-non-snake-case-functions.rs:25:8 | LL | fn a_b_C(&self) {} - | ^^^^^ help: convert the identifier to snake case (notice the capitalization): `a_b_c` + | ^^^^^ + | +help: convert the identifier to snake case (notice the capitalization difference) + | +LL | fn a_b_c(&self) {} + | ~~~~~ error: trait method `something__else` should have a snake case name --> $DIR/lint-non-snake-case-functions.rs:28:8 | LL | fn something__else(&mut self); - | ^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `something_else` + | ^^^^^^^^^^^^^^^ + | +help: convert the identifier to snake case + | +LL | fn something_else(&mut self); + | ~~~~~~~~~~~~~~ error: function `Cookie` should have a snake case name --> $DIR/lint-non-snake-case-functions.rs:38:4 | LL | fn Cookie() {} - | ^^^^^^ help: convert the identifier to snake case (notice the capitalization): `cookie` + | ^^^^^^ + | +help: convert the identifier to snake case (notice the capitalization difference) + | +LL | fn cookie() {} + | ~~~~~~ error: function `bi_S_Cuit` should have a snake case name --> $DIR/lint-non-snake-case-functions.rs:41:8 | LL | pub fn bi_S_Cuit() {} - | ^^^^^^^^^ help: convert the identifier to snake case (notice the capitalization): `bi_s_cuit` + | ^^^^^^^^^ + | +help: convert the identifier to snake case (notice the capitalization difference) + | +LL | pub fn bi_s_cuit() {} + | ~~~~~~~~~ error: aborting due to 9 previous errors diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-identifiers-suggestion-reserved.stderr b/tests/ui/lint/non-snake-case/lint-non-snake-case-identifiers-suggestion-reserved.stderr index 2841815ecf2b9..667d97ac7aa07 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-identifiers-suggestion-reserved.stderr +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-identifiers-suggestion-reserved.stderr @@ -59,9 +59,14 @@ error: variable `Super` should have a snake case name --> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9 | LL | let Super: usize = 0; - | ^^^^^ help: rename the identifier + | ^^^^^ | = note: `super` cannot be used as a raw identifier +help: rename the identifier + | +LL - let Super: usize = 0; +LL + let : usize = 0; + | error: aborting due to 4 previous errors; 2 warnings emitted diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-lifetimes.stderr b/tests/ui/lint/non-snake-case/lint-non-snake-case-lifetimes.stderr index 8be7365cfc341..fa8b0ee2baf66 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-lifetimes.stderr +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-lifetimes.stderr @@ -2,13 +2,17 @@ error: lifetime `'FooBar` should have a snake case name --> $DIR/lint-non-snake-case-lifetimes.rs:4:6 | LL | fn f<'FooBar>( - | ^^^^^^^ help: convert the identifier to snake case: `'foo_bar` + | ^^^^^^^ | note: the lint level is defined here --> $DIR/lint-non-snake-case-lifetimes.rs:1:9 | LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | fn f<'foo_bar>( + | ~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/non-snake-case/lint-non-snake-case-modules.stderr b/tests/ui/lint/non-snake-case/lint-non-snake-case-modules.stderr index f21f9a934f3f9..697ddb5429f2c 100644 --- a/tests/ui/lint/non-snake-case/lint-non-snake-case-modules.stderr +++ b/tests/ui/lint/non-snake-case/lint-non-snake-case-modules.stderr @@ -2,13 +2,17 @@ error: module `FooBar` should have a snake case name --> $DIR/lint-non-snake-case-modules.rs:4:5 | LL | mod FooBar { - | ^^^^^^ help: convert the identifier to snake case: `foo_bar` + | ^^^^^^ | note: the lint level is defined here --> $DIR/lint-non-snake-case-modules.rs:1:9 | LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | mod foo_bar { + | ~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/lint/non-snake-case/lint-nonstandard-style-unicode-2.stderr b/tests/ui/lint/non-snake-case/lint-nonstandard-style-unicode-2.stderr index 8eb0654e0a193..2e483de72a1f3 100644 --- a/tests/ui/lint/non-snake-case/lint-nonstandard-style-unicode-2.stderr +++ b/tests/ui/lint/non-snake-case/lint-nonstandard-style-unicode-2.stderr @@ -2,19 +2,28 @@ error: function `Ц` should have a snake case name --> $DIR/lint-nonstandard-style-unicode-2.rs:17:4 | LL | fn Ц() {} - | ^ help: convert the identifier to snake case: `ц` + | ^ | note: the lint level is defined here --> $DIR/lint-nonstandard-style-unicode-2.rs:3:11 | LL | #![forbid(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | fn ц() {} + | ~ error: function `分__隔` should have a snake case name --> $DIR/lint-nonstandard-style-unicode-2.rs:22:4 | LL | fn 分__隔() {} - | ^^^^^^ help: convert the identifier to snake case: `分_隔` + | ^^^^^^ + | +help: convert the identifier to snake case + | +LL | fn 分_隔() {} + | ~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/lint/non-snake-case/lint-uppercase-variables.stderr b/tests/ui/lint/non-snake-case/lint-uppercase-variables.stderr index 9220828014fda..832c1a9c9df37 100644 --- a/tests/ui/lint/non-snake-case/lint-uppercase-variables.stderr +++ b/tests/ui/lint/non-snake-case/lint-uppercase-variables.stderr @@ -47,43 +47,72 @@ error: structure field `X` should have a snake case name --> $DIR/lint-uppercase-variables.rs:10:5 | LL | X: usize - | ^ help: convert the identifier to snake case (notice the capitalization): `x` + | ^ | note: the lint level is defined here --> $DIR/lint-uppercase-variables.rs:3:9 | LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case (notice the capitalization difference) + | +LL | x: usize + | ~ error: variable `Xx` should have a snake case name --> $DIR/lint-uppercase-variables.rs:13:9 | LL | fn test(Xx: usize) { - | ^^ help: convert the identifier to snake case (notice the capitalization): `xx` + | ^^ + | +help: convert the identifier to snake case (notice the capitalization difference) + | +LL | fn test(xx: usize) { + | ~~ error: variable `Test` should have a snake case name --> $DIR/lint-uppercase-variables.rs:18:9 | LL | let Test: usize = 0; - | ^^^^ help: convert the identifier to snake case: `test` + | ^^^^ + | +help: convert the identifier to snake case + | +LL | let test: usize = 0; + | ~~~~ error: variable `Foo` should have a snake case name --> $DIR/lint-uppercase-variables.rs:22:9 | LL | Foo => {} - | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo` + | ^^^ + | +help: convert the identifier to snake case (notice the capitalization difference) + | +LL | foo => {} + | ~~~ error: variable `Foo` should have a snake case name --> $DIR/lint-uppercase-variables.rs:28:9 | LL | let Foo = foo::Foo::Foo; - | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo` + | ^^^ + | +help: convert the identifier to snake case (notice the capitalization difference) + | +LL | let foo = foo::Foo::Foo; + | ~~~ error: variable `Foo` should have a snake case name --> $DIR/lint-uppercase-variables.rs:33:17 | LL | fn in_param(Foo: foo::Foo) {} - | ^^^ help: convert the identifier to snake case (notice the capitalization): `foo` + | ^^^ + | +help: convert the identifier to snake case (notice the capitalization difference) + | +LL | fn in_param(foo: foo::Foo) {} + | ~~~ error: aborting due to 9 previous errors; 3 warnings emitted diff --git a/tests/ui/lint/non-snake-case/no-snake-case-warning-for-field-puns-issue-66362.stderr b/tests/ui/lint/non-snake-case/no-snake-case-warning-for-field-puns-issue-66362.stderr index cbbcf9909185a..6ddbbd79c36a1 100644 --- a/tests/ui/lint/non-snake-case/no-snake-case-warning-for-field-puns-issue-66362.stderr +++ b/tests/ui/lint/non-snake-case/no-snake-case-warning-for-field-puns-issue-66362.stderr @@ -2,31 +2,50 @@ error: structure field `lowerCamelCaseName` should have a snake case name --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:7:9 | LL | lowerCamelCaseName: bool, - | ^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `lower_camel_case_name` + | ^^^^^^^^^^^^^^^^^^ | note: the lint level is defined here --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:1:9 | LL | #![deny(non_snake_case)] | ^^^^^^^^^^^^^^ +help: convert the identifier to snake case + | +LL | lower_camel_case_name: bool, + | ~~~~~~~~~~~~~~~~~~~~~ error: variable `lowerCamelCaseBinding` should have a snake case name --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:20:38 | LL | Foo::Good { snake_case_name: lowerCamelCaseBinding } => { } - | ^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `lower_camel_case_binding` + | ^^^^^^^^^^^^^^^^^^^^^ + | +help: convert the identifier to snake case + | +LL | Foo::Good { snake_case_name: lower_camel_case_binding } => { } + | ~~~~~~~~~~~~~~~~~~~~~~~~ error: variable `anotherLowerCamelCaseBinding` should have a snake case name --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:24:41 | LL | if let Foo::Good { snake_case_name: anotherLowerCamelCaseBinding } = b { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `another_lower_camel_case_binding` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: convert the identifier to snake case + | +LL | if let Foo::Good { snake_case_name: another_lower_camel_case_binding } = b { } + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: variable `yetAnotherLowerCamelCaseBinding` should have a snake case name --> $DIR/no-snake-case-warning-for-field-puns-issue-66362.rs:27:43 | LL | if let Foo::Bad { lowerCamelCaseName: yetAnotherLowerCamelCaseBinding } = b { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case: `yet_another_lower_camel_case_binding` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: convert the identifier to snake case + | +LL | if let Foo::Bad { lowerCamelCaseName: yet_another_lower_camel_case_binding } = b { } + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 4 previous errors diff --git a/tests/ui/lint/reasons.stderr b/tests/ui/lint/reasons.stderr index 8028785ab94be..6772a8886023e 100644 --- a/tests/ui/lint/reasons.stderr +++ b/tests/ui/lint/reasons.stderr @@ -21,7 +21,7 @@ warning: variable `Social_exchange_psychology` should have a snake case name --> $DIR/reasons.rs:29:9 | LL | let Social_exchange_psychology = CheaterDetectionMechanism {}; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: convert the identifier to snake case (notice the capitalization): `social_exchange_psychology` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: people shouldn't have to change their usual style habits to contribute to our project @@ -31,6 +31,10 @@ note: the lint level is defined here LL | nonstandard_style, | ^^^^^^^^^^^^^^^^^ = note: `#[warn(non_snake_case)]` implied by `#[warn(nonstandard_style)]` +help: convert the identifier to snake case (notice the capitalization difference) + | +LL | let social_exchange_psychology = CheaterDetectionMechanism {}; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: 2 warnings emitted diff --git a/tests/ui/lint/recommend-literal.stderr b/tests/ui/lint/recommend-literal.stderr index 424ecadd4b8cc..f831f82aad71e 100644 --- a/tests/ui/lint/recommend-literal.stderr +++ b/tests/ui/lint/recommend-literal.stderr @@ -2,28 +2,34 @@ error[E0412]: cannot find type `double` in this scope --> $DIR/recommend-literal.rs:1:13 | LL | type Real = double; - | ^^^^^^ - | | - | not found in this scope - | help: perhaps you intended to use this type: `f64` + | ^^^^^^ not found in this scope + | +help: perhaps you intended to use this type + | +LL | type Real = f64; + | ~~~ error[E0412]: cannot find type `long` in this scope --> $DIR/recommend-literal.rs:7:12 | LL | let y: long = 74802374902374923; - | ^^^^ - | | - | not found in this scope - | help: perhaps you intended to use this type: `i64` + | ^^^^ not found in this scope + | +help: perhaps you intended to use this type + | +LL | let y: i64 = 74802374902374923; + | ~~~ error[E0412]: cannot find type `Boolean` in this scope --> $DIR/recommend-literal.rs:10:13 | LL | let v1: Boolean = true; - | ^^^^^^^ - | | - | not found in this scope - | help: perhaps you intended to use this type: `bool` + | ^^^^^^^ not found in this scope + | +help: perhaps you intended to use this type + | +LL | let v1: bool = true; + | ~~~~ error[E0412]: cannot find type `Bool` in this scope --> $DIR/recommend-literal.rs:13:13 @@ -44,28 +50,34 @@ error[E0412]: cannot find type `boolean` in this scope --> $DIR/recommend-literal.rs:19:9 | LL | fn z(a: boolean) { - | ^^^^^^^ - | | - | not found in this scope - | help: perhaps you intended to use this type: `bool` + | ^^^^^^^ not found in this scope + | +help: perhaps you intended to use this type + | +LL | fn z(a: bool) { + | ~~~~ error[E0412]: cannot find type `byte` in this scope --> $DIR/recommend-literal.rs:24:11 | LL | fn a() -> byte { - | ^^^^ - | | - | not found in this scope - | help: perhaps you intended to use this type: `u8` + | ^^^^ not found in this scope + | +help: perhaps you intended to use this type + | +LL | fn a() -> u8 { + | ~~ error[E0412]: cannot find type `float` in this scope --> $DIR/recommend-literal.rs:31:12 | LL | width: float, - | ^^^^^ - | | - | not found in this scope - | help: perhaps you intended to use this type: `f32` + | ^^^^^ not found in this scope + | +help: perhaps you intended to use this type + | +LL | width: f32, + | ~~~ error[E0412]: cannot find type `int` in this scope --> $DIR/recommend-literal.rs:34:19 @@ -86,10 +98,12 @@ error[E0412]: cannot find type `short` in this scope --> $DIR/recommend-literal.rs:40:16 | LL | impl Stuff for short {} - | ^^^^^ - | | - | not found in this scope - | help: perhaps you intended to use this type: `i16` + | ^^^^^ not found in this scope + | +help: perhaps you intended to use this type + | +LL | impl Stuff for i16 {} + | ~~~ error: aborting due to 9 previous errors diff --git a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.stderr b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.stderr index f0174560fd58c..abd392953af31 100644 --- a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.stderr +++ b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-in-loop.stderr @@ -1,11 +1,13 @@ error[E0384]: cannot assign twice to immutable variable `v` --> $DIR/liveness-assign-imm-local-in-loop.rs:6:9 | -LL | let v: isize; - | - help: consider making this binding mutable: `mut v` -... LL | v = 1; | ^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut v: isize; + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.stderr b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.stderr index 578a40e4070d0..611a84d4e8401 100644 --- a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.stderr +++ b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-in-op-eq.stderr @@ -1,13 +1,15 @@ error[E0384]: cannot assign twice to immutable variable `v` --> $DIR/liveness-assign-imm-local-in-op-eq.rs:6:5 | -LL | let v: isize; - | - help: consider making this binding mutable: `mut v` -... LL | v = 2; | ----- first assignment to `v` LL | v += 1; | ^^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut v: isize; + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.stderr b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.stderr index 2f55b50f0baf4..5e10f8e21e867 100644 --- a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.stderr +++ b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-drop.stderr @@ -2,13 +2,15 @@ error[E0384]: cannot assign twice to immutable variable `b` --> $DIR/liveness-assign-imm-local-with-drop.rs:6:5 | LL | let b = Box::new(1); - | - - | | - | first assignment to `b` - | help: consider making this binding mutable: `mut b` + | - first assignment to `b` ... LL | b = Box::new(2); | ^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut b = Box::new(1); + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.stderr b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.stderr index 8eb71cd99bfc1..8c80e32d91999 100644 --- a/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.stderr +++ b/tests/ui/liveness/liveness-assign/liveness-assign-imm-local-with-init.stderr @@ -2,13 +2,15 @@ error[E0384]: cannot assign twice to immutable variable `v` --> $DIR/liveness-assign-imm-local-with-init.rs:6:5 | LL | let v: isize = 1; - | - - | | - | first assignment to `v` - | help: consider making this binding mutable: `mut v` + | - first assignment to `v` ... LL | v = 2; | ^^^^^ cannot assign twice to immutable variable + | +help: consider making this binding mutable + | +LL | let mut v: isize = 1; + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/loops/loop-break-value.stderr b/tests/ui/loops/loop-break-value.stderr index 0912bdbb221ec..f2fe129e845ba 100644 --- a/tests/ui/loops/loop-break-value.stderr +++ b/tests/ui/loops/loop-break-value.stderr @@ -22,10 +22,12 @@ error[E0425]: cannot find value `LOOP` in this scope LL | 'LOOP: for _ in 0 .. 9 { | ----- a label with a similar name exists LL | break LOOP; - | ^^^^ - | | - | not found in this scope - | help: use the similarly named label: `'LOOP` + | ^^^^ not found in this scope + | +help: use the similarly named label + | +LL | break 'LOOP; + | ~~~~~ warning: denote infinite loops with `loop { ... }` --> $DIR/loop-break-value.rs:30:5 diff --git a/tests/ui/macros/issue-69396-const-no-type-in-macro.stderr b/tests/ui/macros/issue-69396-const-no-type-in-macro.stderr index 89aeafebac497..6d76dfb1f9464 100644 --- a/tests/ui/macros/issue-69396-const-no-type-in-macro.stderr +++ b/tests/ui/macros/issue-69396-const-no-type-in-macro.stderr @@ -17,7 +17,7 @@ error: missing type for `const` item --> $DIR/issue-69396-const-no-type-in-macro.rs:4:20 | LL | const A = "A".$fn(); - | ^ help: provide a type for the constant: `: usize` + | ^ ... LL | / suite! { LL | | len; @@ -26,15 +26,16 @@ LL | | } | |_- in this macro invocation | = note: this error originates in the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) +help: provide a type for the constant + | +LL | const A: usize = "A".$fn(); + | +++++++ error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants --> $DIR/issue-69396-const-no-type-in-macro.rs:4:20 | LL | const A = "A".$fn(); - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `bool` + | ^ not allowed in type signatures ... LL | / suite! { LL | | len; @@ -43,6 +44,10 @@ LL | | } | |_- in this macro invocation | = note: this error originates in the macro `suite` (in Nightly builds, run with -Z macro-backtrace for more info) +help: replace with the correct type + | +LL | const Abool = "A".$fn(); + | ++++ error: aborting due to 3 previous errors diff --git a/tests/ui/macros/issue-86865.stderr b/tests/ui/macros/issue-86865.stderr index eed755366311b..bec1dc488f03a 100644 --- a/tests/ui/macros/issue-86865.stderr +++ b/tests/ui/macros/issue-86865.stderr @@ -2,17 +2,25 @@ error: format argument must be a string literal --> $DIR/issue-86865.rs:4:14 | LL | println!(b"foo"); - | -^^^^^ - | | - | help: consider removing the leading `b` + | ^^^^^^ + | +help: consider removing the leading `b` + | +LL - println!(b"foo"); +LL + println!("foo"); + | error: format argument must be a string literal --> $DIR/issue-86865.rs:8:15 | LL | write!(s, b"foo{}", "bar"); - | -^^^^^^^ - | | - | help: consider removing the leading `b` + | ^^^^^^^^ + | +help: consider removing the leading `b` + | +LL - write!(s, b"foo{}", "bar"); +LL + write!(s, "foo{}", "bar"); + | error: aborting due to 2 previous errors diff --git a/tests/ui/macros/macro-context.stderr b/tests/ui/macros/macro-context.stderr index 7785f41594627..fb8dcf14f6d2d 100644 --- a/tests/ui/macros/macro-context.stderr +++ b/tests/ui/macros/macro-context.stderr @@ -46,12 +46,16 @@ error[E0412]: cannot find type `i` in this scope --> $DIR/macro-context.rs:3:13 | LL | () => ( i ; typeof ); - | ^ help: a builtin type with a similar name exists: `i8` + | ^ ... LL | let a: m!(); | ---- in this macro invocation | = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) +help: a builtin type with a similar name exists + | +LL | () => ( i8 ; typeof ); + | ~~ error[E0425]: cannot find value `i` in this scope --> $DIR/macro-context.rs:3:13 diff --git a/tests/ui/macros/macro-metavar-expr-concat/syntax-errors.stderr b/tests/ui/macros/macro-metavar-expr-concat/syntax-errors.stderr index b216a86d59abe..6706a4c11e1ce 100644 --- a/tests/ui/macros/macro-metavar-expr-concat/syntax-errors.stderr +++ b/tests/ui/macros/macro-metavar-expr-concat/syntax-errors.stderr @@ -20,7 +20,13 @@ error: expected identifier, found `1` --> $DIR/syntax-errors.rs:14:24 | LL | ${concat(aaaa, 1)} - | ^ help: try removing `1` + | ^ + | +help: try removing `1` + | +LL - ${concat(aaaa, 1)} +LL + ${concat(aaaa, )} + | error: expected comma --> $DIR/syntax-errors.rs:19:10 @@ -50,7 +56,13 @@ error: expected identifier, found `123` --> $DIR/syntax-errors.rs:34:29 | LL | ${concat($ex, aaaa, 123)} - | ^^^ help: try removing `123` + | ^^^ + | +help: try removing `123` + | +LL - ${concat($ex, aaaa, 123)} +LL + ${concat($ex, aaaa, )} + | error: `${concat(..)}` currently only accepts identifiers or meta-variables as parameters --> $DIR/syntax-errors.rs:25:19 diff --git a/tests/ui/macros/macro-name-typo.stderr b/tests/ui/macros/macro-name-typo.stderr index 9059b10faaacd..39b9d17c9d647 100644 --- a/tests/ui/macros/macro-name-typo.stderr +++ b/tests/ui/macros/macro-name-typo.stderr @@ -2,10 +2,15 @@ error: cannot find macro `printlx` in this scope --> $DIR/macro-name-typo.rs:2:5 | LL | printlx!("oh noes!"); - | ^^^^^^^ help: a macro with a similar name exists: `println` + | ^^^^^^^ --> $SRC_DIR/std/src/macros.rs:LL:COL | = note: similarly named macro `println` defined here + | +help: a macro with a similar name exists + | +LL | println!("oh noes!"); + | ~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr b/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr index a06487be3d601..f595f61219f95 100644 --- a/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr +++ b/tests/ui/macros/macro-pat-pattern-followed-by-or-in-2021.stderr @@ -2,31 +2,37 @@ error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:3:28 | LL | macro_rules! foo { ($x:pat | $y:pat) => {} } - | ------ ^ not allowed after `pat` fragments - | | - | help: try a `pat_param` fragment specifier instead: `$x:pat_param` + | ^ not allowed after `pat` fragments | = note: allowed there are: `=>`, `,`, `=`, `if` or `in` +help: try a `pat_param` fragment specifier instead + | +LL | macro_rules! foo { ($x:pat_param | $y:pat) => {} } + | ~~~~~~~~~~~~ error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:4:32 | LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } - | ------ ^ not allowed after `pat` fragments - | | - | help: try a `pat_param` fragment specifier instead: `$x:pat_param` + | ^ not allowed after `pat` fragments | = note: allowed there are: `=>`, `,`, `=`, `if` or `in` +help: try a `pat_param` fragment specifier instead + | +LL | macro_rules! bar { ($($x:pat_param)+ | $($y:pat)+) => {} } + | ~~~~~~~~~~~~ error: `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments --> $DIR/macro-pat-pattern-followed-by-or-in-2021.rs:7:36 | LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { - | -------- ^ not allowed after `pat` fragments - | | - | help: try a `pat_param` fragment specifier instead: `$pat:pat_param` + | ^ not allowed after `pat` fragments | = note: allowed there are: `=>`, `,`, `=`, `if` or `in` +help: try a `pat_param` fragment specifier instead + | +LL | ( $expr:expr , $( $( $pat:pat_param )|+ => $expr_arm:expr ),+ ) => { + | ~~~~~~~~~~~~~~ error: aborting due to 3 previous errors diff --git a/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr b/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr index c3754dde080a3..7d4358451f2fb 100644 --- a/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr +++ b/tests/ui/macros/macro-pat2021-pattern-followed-by-or.stderr @@ -2,31 +2,37 @@ error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments --> $DIR/macro-pat2021-pattern-followed-by-or.rs:4:28 | LL | macro_rules! foo { ($x:pat | $y:pat) => {} } - | ------ ^ not allowed after `pat` fragments - | | - | help: try a `pat_param` fragment specifier instead: `$x:pat_param` + | ^ not allowed after `pat` fragments | = note: allowed there are: `=>`, `,`, `=`, `if` or `in` +help: try a `pat_param` fragment specifier instead + | +LL | macro_rules! foo { ($x:pat_param | $y:pat) => {} } + | ~~~~~~~~~~~~ error: `$x:pat` is followed by `|`, which is not allowed for `pat` fragments --> $DIR/macro-pat2021-pattern-followed-by-or.rs:7:28 | LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} } - | ------ ^ not allowed after `pat` fragments - | | - | help: try a `pat_param` fragment specifier instead: `$x:pat_param` + | ^ not allowed after `pat` fragments | = note: allowed there are: `=>`, `,`, `=`, `if` or `in` +help: try a `pat_param` fragment specifier instead + | +LL | macro_rules! ogg { ($x:pat_param | $y:pat_param) => {} } + | ~~~~~~~~~~~~ error: `$pat:pat` may be followed by `|`, which is not allowed for `pat` fragments --> $DIR/macro-pat2021-pattern-followed-by-or.rs:9:35 | LL | ( $expr:expr , $( $( $pat:pat)|+ => $expr_arm:pat),+ ) => { - | -------- ^ not allowed after `pat` fragments - | | - | help: try a `pat_param` fragment specifier instead: `$pat:pat_param` + | ^ not allowed after `pat` fragments | = note: allowed there are: `=>`, `,`, `=`, `if` or `in` +help: try a `pat_param` fragment specifier instead + | +LL | ( $expr:expr , $( $( $pat:pat_param)|+ => $expr_arm:pat),+ ) => { + | ~~~~~~~~~~~~~~ error: aborting due to 3 previous errors diff --git a/tests/ui/macros/macro-path-prelude-fail-3.stderr b/tests/ui/macros/macro-path-prelude-fail-3.stderr index 485d7b7869a9a..587ec7cb0dd77 100644 --- a/tests/ui/macros/macro-path-prelude-fail-3.stderr +++ b/tests/ui/macros/macro-path-prelude-fail-3.stderr @@ -2,12 +2,16 @@ error: cannot find macro `inline` in this scope --> $DIR/macro-path-prelude-fail-3.rs:2:5 | LL | inline!(); - | ^^^^^^ help: a macro with a similar name exists: `line` + | ^^^^^^ --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | = note: similarly named macro `line` defined here | = note: `inline` is in scope, but it is an attribute: `#[inline]` +help: a macro with a similar name exists + | +LL | line!(); + | ~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/macros/macro-reexport-removed.stderr b/tests/ui/macros/macro-reexport-removed.stderr index 475a586ddc083..2029376cd9ae0 100644 --- a/tests/ui/macros/macro-reexport-removed.stderr +++ b/tests/ui/macros/macro-reexport-removed.stderr @@ -10,7 +10,12 @@ error: cannot find attribute `macro_reexport` in this scope --> $DIR/macro-reexport-removed.rs:5:3 | LL | #[macro_reexport(macro_one)] - | ^^^^^^^^^^^^^^ help: a built-in attribute with a similar name exists: `macro_export` + | ^^^^^^^^^^^^^^ + | +help: a built-in attribute with a similar name exists + | +LL | #[macro_export(macro_one)] + | ~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/macros/macro_undefined.stderr b/tests/ui/macros/macro_undefined.stderr index cc3efacbc5415..e58dfb0d75312 100644 --- a/tests/ui/macros/macro_undefined.stderr +++ b/tests/ui/macros/macro_undefined.stderr @@ -5,7 +5,12 @@ LL | macro_rules! kl { | --------------- similarly named macro `kl` defined here ... LL | k!(); - | ^ help: a macro with a similar name exists: `kl` + | ^ + | +help: a macro with a similar name exists + | +LL | kl!(); + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr index 8e4ba192d79f5..28934abad4be2 100644 --- a/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr +++ b/tests/ui/macros/rfc-3086-metavar-expr/syntax-errors.stderr @@ -188,7 +188,13 @@ error: unrecognized meta-variable expression --> $DIR/syntax-errors.rs:140:33 | LL | ( $( $i:ident ),* ) => { ${ aaaaaaaaaaaaaa(i) } }; - | ^^^^^^^^^^^^^^ help: supported expressions are count, ignore, index and len + | ^^^^^^^^^^^^^^ + | +help: supported expressions are count, ignore, index and len + | +LL - ( $( $i:ident ),* ) => { ${ aaaaaaaaaaaaaa(i) } }; +LL + ( $( $i:ident ),* ) => { ${ (i) } }; + | error: expected identifier --> $DIR/syntax-errors.rs:118:33 diff --git a/tests/ui/match/match-pattern-field-mismatch-2.stderr b/tests/ui/match/match-pattern-field-mismatch-2.stderr index 12b143dd29b91..039e5d87974f7 100644 --- a/tests/ui/match/match-pattern-field-mismatch-2.stderr +++ b/tests/ui/match/match-pattern-field-mismatch-2.stderr @@ -5,7 +5,12 @@ LL | NoColor, | ------- `Color::NoColor` defined here ... LL | Color::NoColor(_) => { } - | ^^^^^^^^^^^^^^^^^ help: use this syntax instead: `Color::NoColor` + | ^^^^^^^^^^^^^^^^^ + | +help: use this syntax instead + | +LL | Color::NoColor => { } + | ~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.stderr b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.stderr index 964e9f36596bd..d2dd399fdb737 100644 --- a/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.stderr +++ b/tests/ui/match/ref_pat_eat_one_layer_2024/ref_pat_eat_one_layer_2024_ref_mut_inside_and.stderr @@ -2,41 +2,56 @@ error[E0596]: cannot borrow as mutable inside an `&` pattern --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:8:31 | LL | if let Some(&Some(ref mut x)) = &mut Some(Some(0)) { - | - ^ - | | - | help: replace this `&` with `&mut`: `&mut` + | ^ + | +help: replace this `&` with `&mut` + | +LL | if let Some(&mut Some(ref mut x)) = &mut Some(Some(0)) { + | ~~~~ error[E0596]: cannot borrow as mutable inside an `&` pattern --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:13:31 | LL | if let &Some(Some(ref mut x)) = &mut Some(Some(0)) { - | - ^ - | | - | help: replace this `&` with `&mut`: `&mut` + | ^ + | +help: replace this `&` with `&mut` + | +LL | if let &mut Some(Some(ref mut x)) = &mut Some(Some(0)) { + | ~~~~ error[E0596]: cannot borrow as mutable inside an `&` pattern --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:21:15 | LL | let &pat!(x) = &mut 0; - | - ^ - | | - | help: replace this `&` with `&mut`: `&mut` + | ^ + | +help: replace this `&` with `&mut` + | +LL | let &mut pat!(x) = &mut 0; + | ~~~~ error[E0596]: cannot borrow as mutable inside an `&` pattern --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:25:19 | LL | let &(ref mut a, ref mut b) = &mut (true, false); - | - ^ - | | - | help: replace this `&` with `&mut`: `&mut` + | ^ + | +help: replace this `&` with `&mut` + | +LL | let &mut (ref mut a, ref mut b) = &mut (true, false); + | ~~~~ error[E0596]: cannot borrow as mutable inside an `&` pattern --> $DIR/ref_pat_eat_one_layer_2024_ref_mut_inside_and.rs:25:30 | LL | let &(ref mut a, ref mut b) = &mut (true, false); - | - ^ - | | - | help: replace this `&` with `&mut`: `&mut` + | ^ + | +help: replace this `&` with `&mut` + | +LL | let &mut (ref mut a, ref mut b) = &mut (true, false); + | ~~~~ error: aborting due to 5 previous errors diff --git a/tests/ui/methods/issue-3707.stderr b/tests/ui/methods/issue-3707.stderr index b3d4dfe5aaa88..905e3972017de 100644 --- a/tests/ui/methods/issue-3707.stderr +++ b/tests/ui/methods/issue-3707.stderr @@ -2,10 +2,7 @@ error[E0599]: no method named `boom` found for reference `&Obj` in the current s --> $DIR/issue-3707.rs:10:14 | LL | self.boom(); - | -----^^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `Obj::boom()` + | ^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `Obj` @@ -13,6 +10,10 @@ note: the candidate is defined in an impl for the type `Obj` | LL | pub fn boom() -> bool { | ^^^^^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | Obj::boom(); + | ~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/methods/method-call-lifetime-args-fail.stderr b/tests/ui/methods/method-call-lifetime-args-fail.stderr index 645d8b8d14ad2..d431e0721ccb9 100644 --- a/tests/ui/methods/method-call-lifetime-args-fail.stderr +++ b/tests/ui/methods/method-call-lifetime-args-fail.stderr @@ -20,15 +20,18 @@ error[E0107]: method takes 2 lifetime arguments but 3 lifetime arguments were su --> $DIR/method-call-lifetime-args-fail.rs:18:7 | LL | S.early::<'static, 'static, 'static>(); - | ^^^^^ ------- help: remove this lifetime argument - | | - | expected 2 lifetime arguments + | ^^^^^ expected 2 lifetime arguments | note: method defined here, with 2 lifetime parameters: `'a`, `'b` --> $DIR/method-call-lifetime-args-fail.rs:6:8 | LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} } | ^^^^^ -- -- +help: remove this lifetime argument + | +LL - S.early::<'static, 'static, 'static>(); +LL + S.early::<'static, 'static, >(); + | error[E0794]: cannot specify lifetime arguments explicitly if late bound lifetime parameters are present --> $DIR/method-call-lifetime-args-fail.rs:27:15 @@ -220,15 +223,18 @@ error[E0107]: method takes 2 lifetime arguments but 3 lifetime arguments were su --> $DIR/method-call-lifetime-args-fail.rs:65:8 | LL | S::early::<'static, 'static, 'static>(S); - | ^^^^^ ------- help: remove this lifetime argument - | | - | expected 2 lifetime arguments + | ^^^^^ expected 2 lifetime arguments | note: method defined here, with 2 lifetime parameters: `'a`, `'b` --> $DIR/method-call-lifetime-args-fail.rs:6:8 | LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} } | ^^^^^ -- -- +help: remove this lifetime argument + | +LL - S::early::<'static, 'static, 'static>(S); +LL + S::early::<'static, 'static, >(S); + | error: aborting due to 18 previous errors diff --git a/tests/ui/mismatched_types/E0053.stderr b/tests/ui/mismatched_types/E0053.stderr index d0bd5b46cf59f..2559d4487491e 100644 --- a/tests/ui/mismatched_types/E0053.stderr +++ b/tests/ui/mismatched_types/E0053.stderr @@ -2,10 +2,7 @@ error[E0053]: method `foo` has an incompatible type for trait --> $DIR/E0053.rs:9:15 | LL | fn foo(x: i16) { } - | ^^^ - | | - | expected `u16`, found `i16` - | help: change the parameter type to match the trait: `u16` + | ^^^ expected `u16`, found `i16` | note: type in trait --> $DIR/E0053.rs:2:15 @@ -14,15 +11,16 @@ LL | fn foo(x: u16); | ^^^ = note: expected signature `fn(u16)` found signature `fn(i16)` +help: change the parameter type to match the trait + | +LL | fn foo(x: u16) { } + | ~~~ error[E0053]: method `bar` has an incompatible type for trait --> $DIR/E0053.rs:11:12 | LL | fn bar(&mut self) { } - | ^^^^^^^^^ - | | - | types differ in mutability - | help: change the self-receiver type to match the trait: `&self` + | ^^^^^^^^^ types differ in mutability | note: type in trait --> $DIR/E0053.rs:3:12 @@ -31,6 +29,10 @@ LL | fn bar(&self); | ^^^^^ = note: expected signature `fn(&Bar)` found signature `fn(&mut Bar)` +help: change the self-receiver type to match the trait + | +LL | fn bar(&self) { } + | ~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/mismatched_types/cast-rfc0401.stderr b/tests/ui/mismatched_types/cast-rfc0401.stderr index 142a52aef13d0..b146fdd777303 100644 --- a/tests/ui/mismatched_types/cast-rfc0401.stderr +++ b/tests/ui/mismatched_types/cast-rfc0401.stderr @@ -103,10 +103,12 @@ error[E0604]: only `u8` can be cast as `char`, not `u32` --> $DIR/cast-rfc0401.rs:41:13 | LL | let _ = 0x61u32 as char; - | ^^^^^^^^^^^^^^^ - | | - | invalid cast - | help: try `char::from_u32` instead: `char::from_u32(0x61u32)` + | ^^^^^^^^^^^^^^^ invalid cast + | +help: try `char::from_u32` instead + | +LL | let _ = char::from_u32(0x61u32); + | ~~~~~~~~~~~~~~~~~~~~~~~ error[E0606]: casting `bool` as `f32` is invalid --> $DIR/cast-rfc0401.rs:43:13 diff --git a/tests/ui/mismatched_types/float-literal-inference-restrictions.stderr b/tests/ui/mismatched_types/float-literal-inference-restrictions.stderr index 454373c322e9b..649d5614e8743 100644 --- a/tests/ui/mismatched_types/float-literal-inference-restrictions.stderr +++ b/tests/ui/mismatched_types/float-literal-inference-restrictions.stderr @@ -2,11 +2,14 @@ error[E0308]: mismatched types --> $DIR/float-literal-inference-restrictions.rs:2:18 | LL | let x: f32 = 1; - | --- ^ - | | | - | | expected `f32`, found integer - | | help: use a float literal: `1.0` + | --- ^ expected `f32`, found integer + | | | expected due to this + | +help: use a float literal + | +LL | let x: f32 = 1.0; + | ~~~ error[E0308]: mismatched types --> $DIR/float-literal-inference-restrictions.rs:3:18 diff --git a/tests/ui/mismatched_types/issue-112036.stderr b/tests/ui/mismatched_types/issue-112036.stderr index b93ce4a8674c2..bd446b3d78cb2 100644 --- a/tests/ui/mismatched_types/issue-112036.stderr +++ b/tests/ui/mismatched_types/issue-112036.stderr @@ -2,13 +2,14 @@ error[E0053]: method `drop` has an incompatible type for trait --> $DIR/issue-112036.rs:4:13 | LL | fn drop(self) {} - | ^^^^ - | | - | expected `&mut Foo`, found `Foo` - | help: change the self-receiver type to match the trait: `&mut self` + | ^^^^ expected `&mut Foo`, found `Foo` | = note: expected signature `fn(&mut Foo)` found signature `fn(Foo)` +help: change the self-receiver type to match the trait + | +LL | fn drop(&mut self) {} + | ~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/issue-13033.stderr b/tests/ui/mismatched_types/issue-13033.stderr index 4886fa30e89b1..2a266d40e7717 100644 --- a/tests/ui/mismatched_types/issue-13033.stderr +++ b/tests/ui/mismatched_types/issue-13033.stderr @@ -2,10 +2,7 @@ error[E0053]: method `bar` has an incompatible type for trait --> $DIR/issue-13033.rs:8:30 | LL | fn bar(&mut self, other: &dyn Foo) {} - | ^^^^^^^^ - | | - | types differ in mutability - | help: change the parameter type to match the trait: `&mut dyn Foo` + | ^^^^^^^^ types differ in mutability | note: type in trait --> $DIR/issue-13033.rs:2:30 @@ -14,6 +11,10 @@ LL | fn bar(&mut self, other: &mut dyn Foo); | ^^^^^^^^^^^^ = note: expected signature `fn(&mut Baz, &mut dyn Foo)` found signature `fn(&mut Baz, &dyn Foo)` +help: change the parameter type to match the trait + | +LL | fn bar(&mut self, other: &mut dyn Foo) {} + | ~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/mismatched_types/ref-pat-suggestions.stderr b/tests/ui/mismatched_types/ref-pat-suggestions.stderr index 148ed00b01d14..d45fd8aea1c6a 100644 --- a/tests/ui/mismatched_types/ref-pat-suggestions.stderr +++ b/tests/ui/mismatched_types/ref-pat-suggestions.stderr @@ -314,10 +314,13 @@ LL | let &mut _a = 0; | ^^^^^^^ - this expression has type `{integer}` | | | expected integer, found `&mut _` - | help: to declare a mutable variable use: `mut _a` | = note: expected type `{integer}` found mutable reference `&mut _` +help: to declare a mutable variable use + | +LL | let mut _a = 0; + | ~~~~~~ error[E0308]: mismatched types --> $DIR/ref-pat-suggestions.rs:30:15 diff --git a/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr b/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr index 6e7bf5eb46d92..2e544a62223a0 100644 --- a/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr +++ b/tests/ui/mismatched_types/trait-impl-fn-incompatibility.stderr @@ -2,10 +2,7 @@ error[E0053]: method `foo` has an incompatible type for trait --> $DIR/trait-impl-fn-incompatibility.rs:9:15 | LL | fn foo(x: i16) { } - | ^^^ - | | - | expected `u16`, found `i16` - | help: change the parameter type to match the trait: `u16` + | ^^^ expected `u16`, found `i16` | note: type in trait --> $DIR/trait-impl-fn-incompatibility.rs:2:15 @@ -14,15 +11,16 @@ LL | fn foo(x: u16); | ^^^ = note: expected signature `fn(u16)` found signature `fn(i16)` +help: change the parameter type to match the trait + | +LL | fn foo(x: u16) { } + | ~~~ error[E0053]: method `bar` has an incompatible type for trait --> $DIR/trait-impl-fn-incompatibility.rs:10:28 | LL | fn bar(&mut self, bar: &Bar) { } - | ^^^^ - | | - | types differ in mutability - | help: change the parameter type to match the trait: `&mut Bar` + | ^^^^ types differ in mutability | note: type in trait --> $DIR/trait-impl-fn-incompatibility.rs:3:28 @@ -31,6 +29,10 @@ LL | fn bar(&mut self, bar: &mut Bar); | ^^^^^^^^ = note: expected signature `fn(&mut Bar, &mut Bar)` found signature `fn(&mut Bar, &Bar)` +help: change the parameter type to match the trait + | +LL | fn bar(&mut self, bar: &mut Bar) { } + | ~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/nll/closure-captures.stderr b/tests/ui/nll/closure-captures.stderr index 5233f0b246261..1031d3c778db3 100644 --- a/tests/ui/nll/closure-captures.stderr +++ b/tests/ui/nll/closure-captures.stderr @@ -1,38 +1,46 @@ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/closure-captures.rs:7:5 | -LL | fn one_closure(x: i32) { - | - help: consider changing this to be mutable: `mut x` -LL | || LL | x = 1; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | fn one_closure(mut x: i32) { + | ~~~~~ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/closure-captures.rs:9:5 | -LL | fn one_closure(x: i32) { - | - help: consider changing this to be mutable: `mut x` -... LL | x = 1; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | fn one_closure(mut x: i32) { + | ~~~~~ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/closure-captures.rs:15:9 | -LL | fn two_closures(x: i32) { - | - help: consider changing this to be mutable: `mut x` -... LL | x = 1; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | fn two_closures(mut x: i32) { + | ~~~~~ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/closure-captures.rs:19:9 | -LL | fn two_closures(x: i32) { - | - help: consider changing this to be mutable: `mut x` -... LL | x = 1; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | fn two_closures(mut x: i32) { + | ~~~~~ error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure --> $DIR/closure-captures.rs:27:9 @@ -67,11 +75,13 @@ LL | x = 1;}); error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/closure-captures.rs:39:10 | -LL | fn two_closures_ref(x: i32) { - | - help: consider changing this to be mutable: `mut x` -... LL | x = 1;} | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | fn two_closures_ref(mut x: i32) { + | ~~~~~ error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure --> $DIR/closure-captures.rs:38:9 @@ -91,11 +101,13 @@ LL | x = 1;} error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/closure-captures.rs:43:5 | -LL | fn two_closures_ref(x: i32) { - | - help: consider changing this to be mutable: `mut x` -... LL | x = 1;}); | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | fn two_closures_ref(mut x: i32) { + | ~~~~~ error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure --> $DIR/closure-captures.rs:42:9 diff --git a/tests/ui/nll/coroutine-upvar-mutability.stderr b/tests/ui/nll/coroutine-upvar-mutability.stderr index 8b9be877c8f39..b12944848b689 100644 --- a/tests/ui/nll/coroutine-upvar-mutability.stderr +++ b/tests/ui/nll/coroutine-upvar-mutability.stderr @@ -1,11 +1,13 @@ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/coroutine-upvar-mutability.rs:10:9 | -LL | let x = 0; - | - help: consider changing this to be mutable: `mut x` -... LL | x = 1; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut x = 0; + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/nll/issue-46023.stderr b/tests/ui/nll/issue-46023.stderr index 062e07407ce09..8f82f3e696186 100644 --- a/tests/ui/nll/issue-46023.stderr +++ b/tests/ui/nll/issue-46023.stderr @@ -1,11 +1,13 @@ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/issue-46023.rs:5:9 | -LL | let x = 0; - | - help: consider changing this to be mutable: `mut x` -... LL | x = 1; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut x = 0; + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/nonscalar-cast.stderr b/tests/ui/nonscalar-cast.stderr index 01b4a9a7ce026..be271e264d1a8 100644 --- a/tests/ui/nonscalar-cast.stderr +++ b/tests/ui/nonscalar-cast.stderr @@ -2,9 +2,13 @@ error[E0605]: non-primitive cast: `Foo` as `isize` --> $DIR/nonscalar-cast.rs:15:20 | LL | println!("{}", Foo { x: 1 } as isize); - | ^^^^^^^^^^^^^^^^^^^^^ help: consider using the `From` trait instead: `isize::from(Foo { x: 1 })` + | ^^^^^^^^^^^^^^^^^^^^^ | = note: an `as` expression can only be used to convert between primitive types or to coerce to a specific trait object +help: consider using the `From` trait instead + | +LL | println!("{}", isize::from(Foo { x: 1 })); + | ~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/object-safety/issue-102762.stderr b/tests/ui/object-safety/issue-102762.stderr index e746628aa3774..f626272242608 100644 --- a/tests/ui/object-safety/issue-102762.stderr +++ b/tests/ui/object-safety/issue-102762.stderr @@ -1,9 +1,6 @@ error[E0038]: the trait `Fetcher` cannot be made into an object --> $DIR/issue-102762.rs:18:21 | -LL | fn get<'a>(self: &'a Box) -> Pin> + 'a>> - | ------------- help: consider changing method `get`'s `self` parameter to be `&self`: `&Self` -... LL | fn fetcher() -> Box { | ^^^^^^^^^^^ `Fetcher` cannot be made into an object | @@ -14,13 +11,14 @@ LL | pub trait Fetcher: Send + Sync { | ------- this trait cannot be made into an object... LL | fn get<'a>(self: &'a Box) -> Pin> + 'a>> | ^^^^^^^^^^^^^ ...because method `get`'s `self` parameter cannot be dispatched on +help: consider changing method `get`'s `self` parameter to be `&self` + | +LL | fn get<'a>(self: &Self) -> Pin> + 'a>> + | ~~~~~ error[E0038]: the trait `Fetcher` cannot be made into an object --> $DIR/issue-102762.rs:24:19 | -LL | fn get<'a>(self: &'a Box) -> Pin> + 'a>> - | ------------- help: consider changing method `get`'s `self` parameter to be `&self`: `&Self` -... LL | let fetcher = fetcher(); | ^^^^^^^^^ `Fetcher` cannot be made into an object | @@ -31,13 +29,14 @@ LL | pub trait Fetcher: Send + Sync { | ------- this trait cannot be made into an object... LL | fn get<'a>(self: &'a Box) -> Pin> + 'a>> | ^^^^^^^^^^^^^ ...because method `get`'s `self` parameter cannot be dispatched on +help: consider changing method `get`'s `self` parameter to be `&self` + | +LL | fn get<'a>(self: &Self) -> Pin> + 'a>> + | ~~~~~ error[E0038]: the trait `Fetcher` cannot be made into an object --> $DIR/issue-102762.rs:26:13 | -LL | fn get<'a>(self: &'a Box) -> Pin> + 'a>> - | ------------- help: consider changing method `get`'s `self` parameter to be `&self`: `&Self` -... LL | let _ = fetcher.get(); | ^^^^^^^^^^^^^ `Fetcher` cannot be made into an object | @@ -48,6 +47,10 @@ LL | pub trait Fetcher: Send + Sync { | ------- this trait cannot be made into an object... LL | fn get<'a>(self: &'a Box) -> Pin> + 'a>> | ^^^^^^^^^^^^^ ...because method `get`'s `self` parameter cannot be dispatched on +help: consider changing method `get`'s `self` parameter to be `&self` + | +LL | fn get<'a>(self: &Self) -> Pin> + 'a>> + | ~~~~~ error: aborting due to 3 previous errors diff --git a/tests/ui/parser/duplicate-visibility.stderr b/tests/ui/parser/duplicate-visibility.stderr index 0d1421ee7f4e4..369c107cddca1 100644 --- a/tests/ui/parser/duplicate-visibility.stderr +++ b/tests/ui/parser/duplicate-visibility.stderr @@ -4,10 +4,7 @@ error: expected one of `(`, `async`, `const`, `default`, `extern`, `fn`, `safe`, LL | extern "C" { | - while parsing this item list starting here LL | pub pub fn foo(); - | ^^^ - | | - | expected one of 9 possible tokens - | help: there is already a visibility modifier, remove one + | ^^^ expected one of 9 possible tokens ... LL | } | - the item list ends here @@ -17,6 +14,11 @@ note: explicit visibility first seen here | LL | pub pub fn foo(); | ^^^ +help: there is already a visibility modifier, remove one + | +LL - pub pub fn foo(); +LL + pub fn foo(); + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/emoji-identifiers.stderr b/tests/ui/parser/emoji-identifiers.stderr index 536afc53f0ceb..34957f7f0c060 100644 --- a/tests/ui/parser/emoji-identifiers.stderr +++ b/tests/ui/parser/emoji-identifiers.stderr @@ -90,7 +90,12 @@ LL | fn i_like_to_😅_a_lot() -> 👀 { | ----------------------------- similarly named function `i_like_to_😅_a_lot` defined here ... LL | let _ = i_like_to_😄_a_lot() ➖ 4; - | ^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `i_like_to_😅_a_lot` + | ^^^^^^^^^^^^^^^^^^ + | +help: a function with a similar name exists + | +LL | let _ = i_like_to_😅_a_lot() ➖ 4; + | ~~~~~~~~~~~~~~~~~~ error: aborting due to 10 previous errors diff --git a/tests/ui/parser/eq-less-to-less-eq.stderr b/tests/ui/parser/eq-less-to-less-eq.stderr index 4717d8287ff7b..693d0942e3a99 100644 --- a/tests/ui/parser/eq-less-to-less-eq.stderr +++ b/tests/ui/parser/eq-less-to-less-eq.stderr @@ -2,9 +2,12 @@ error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `{` --> $DIR/eq-less-to-less-eq.rs:4:15 | LL | if a =< b { - | -- ^ expected one of 7 possible tokens - | | - | help: did you mean: `<=` + | ^ expected one of 7 possible tokens + | +help: did you mean + | +LL | if a <= b { + | ~~ error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `{` --> $DIR/eq-less-to-less-eq.rs:12:15 diff --git a/tests/ui/parser/expr-as-stmt.stderr b/tests/ui/parser/expr-as-stmt.stderr index 76a83aa0161bb..c28d2abcf6a60 100644 --- a/tests/ui/parser/expr-as-stmt.stderr +++ b/tests/ui/parser/expr-as-stmt.stderr @@ -81,9 +81,12 @@ error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:64:7 | LL | { foo() } || { true } - | ^^^^^- help: consider using a semicolon here: `;` - | | - | expected `()`, found `i32` + | ^^^^^ expected `()`, found `i32` + | +help: consider using a semicolon here + | +LL | { foo(); } || { true } + | + error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:8:6 diff --git a/tests/ui/parser/fn-field-parse-error-ice.stderr b/tests/ui/parser/fn-field-parse-error-ice.stderr index 3bf68e8cc04fe..a96bc5f78074c 100644 --- a/tests/ui/parser/fn-field-parse-error-ice.stderr +++ b/tests/ui/parser/fn-field-parse-error-ice.stderr @@ -2,7 +2,12 @@ error: expected `,`, or `}`, found keyword `fn` --> $DIR/fn-field-parse-error-ice.rs:4:16 | LL | inner : dyn fn () - | ^ help: try adding a comma: `,` + | ^ + | +help: try adding a comma + | +LL | inner : dyn, fn () + | + error: expected identifier, found keyword `fn` --> $DIR/fn-field-parse-error-ice.rs:4:17 diff --git a/tests/ui/parser/inverted-parameters.stderr b/tests/ui/parser/inverted-parameters.stderr index 8662277820390..4033b4986ce7f 100644 --- a/tests/ui/parser/inverted-parameters.stderr +++ b/tests/ui/parser/inverted-parameters.stderr @@ -2,19 +2,23 @@ error: expected one of `:`, `@`, or `|`, found `bar` --> $DIR/inverted-parameters.rs:4:24 | LL | fn foo(&self, &str bar) {} - | -----^^^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^^^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL | fn foo(&self, : ) {} + | ~~~~~~~~~~~~~~~~~~~~ error: expected one of `:`, `@`, or `|`, found `quux` --> $DIR/inverted-parameters.rs:10:10 | LL | fn baz(S quux, xyzzy: i32) {} - | --^^^^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^^^^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL | fn baz(: , xyzzy: i32) {} + | ~~~~~~~~~~~~~~~~~~~~ error: expected one of `:`, `@`, or `|`, found `a` --> $DIR/inverted-parameters.rs:15:12 @@ -52,10 +56,12 @@ error: expected one of `:`, `@`, or `|`, found `S` --> $DIR/inverted-parameters.rs:27:23 | LL | fn missing_colon(quux S) {} - | -----^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL | fn missing_colon(: ) {} + | ~~~~~~~~~~~~~~~~~~~~ error: aborting due to 6 previous errors diff --git a/tests/ui/parser/issues/issue-113342.stderr b/tests/ui/parser/issues/issue-113342.stderr index 6d9f22f6a7ce8..59e65950534db 100644 --- a/tests/ui/parser/issues/issue-113342.stderr +++ b/tests/ui/parser/issues/issue-113342.stderr @@ -2,10 +2,12 @@ error: expected `fn`, found keyword `pub` --> $DIR/issue-113342.rs:7:12 | LL | extern "C" pub fn id(x: i32) -> i32 { x } - | -----------^^^ - | | | - | | expected `fn` - | help: visibility `pub` must come before `extern "C"`: `pub extern "C"` + | ^^^ expected `fn` + | +help: visibility `pub` must come before `extern "C"` + | +LL | pub extern "C" fn id(x: i32) -> i32 { x } + | ~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-68000-unicode-ident-after-missing-comma.stderr b/tests/ui/parser/issues/issue-68000-unicode-ident-after-missing-comma.stderr index adabb68593c09..e1b5bbed7e558 100644 --- a/tests/ui/parser/issues/issue-68000-unicode-ident-after-missing-comma.stderr +++ b/tests/ui/parser/issues/issue-68000-unicode-ident-after-missing-comma.stderr @@ -2,7 +2,12 @@ error: expected `,`, or `}`, found `ö` --> $DIR/issue-68000-unicode-ident-after-missing-comma.rs:2:22 | LL | pub bar: Vecö - | ^ help: try adding a comma: `,` + | ^ + | +help: try adding a comma + | +LL | pub bar: Vec,ö + | + error: expected `:`, found `}` --> $DIR/issue-68000-unicode-ident-after-missing-comma.rs:4:1 diff --git a/tests/ui/parser/issues/issue-70549-resolve-after-recovered-self-ctor.stderr b/tests/ui/parser/issues/issue-70549-resolve-after-recovered-self-ctor.stderr index ec0af9a6caf1e..b4e386b406825 100644 --- a/tests/ui/parser/issues/issue-70549-resolve-after-recovered-self-ctor.stderr +++ b/tests/ui/parser/issues/issue-70549-resolve-after-recovered-self-ctor.stderr @@ -8,10 +8,12 @@ error: expected one of `:`, `@`, or `|`, found keyword `Self` --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:4:17 | LL | fn foo(&mur Self) {} - | -----^^^^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^^^^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL | fn foo(: ) {} + | ~~~~~~~~~~~~~~~~~~~~ error: unexpected lifetime `'static` in pattern --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:13 @@ -29,10 +31,12 @@ error: expected one of `:`, `@`, or `|`, found keyword `Self` --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:8:25 | LL | fn bar(&'static mur Self) {} - | -------------^^^^ - | | | - | | expected one of `:`, `@`, or `|` - | help: declare the type after the parameter binding: `: ` + | ^^^^ expected one of `:`, `@`, or `|` + | +help: declare the type after the parameter binding + | +LL | fn bar(: ) {} + | ~~~~~~~~~~~~~~~~~~~~ error: expected one of `:`, `@`, or `|`, found keyword `Self` --> $DIR/issue-70549-resolve-after-recovered-self-ctor.rs:14:17 diff --git a/tests/ui/parser/issues/issue-76437-async.stderr b/tests/ui/parser/issues/issue-76437-async.stderr index 483599135f566..8639bbf2c17f2 100644 --- a/tests/ui/parser/issues/issue-76437-async.stderr +++ b/tests/ui/parser/issues/issue-76437-async.stderr @@ -2,10 +2,12 @@ error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found keyword `pub` --> $DIR/issue-76437-async.rs:4:11 | LL | async pub fn t() {} - | ------^^^ - | | | - | | expected one of `extern`, `fn`, `safe`, or `unsafe` - | help: visibility `pub` must come before `async`: `pub async` + | ^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` + | +help: visibility `pub` must come before `async` + | +LL | pub async fn t() {} + | ~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-76437-const-async-unsafe.stderr b/tests/ui/parser/issues/issue-76437-const-async-unsafe.stderr index a703fc4e8a452..0b5f924ed6cab 100644 --- a/tests/ui/parser/issues/issue-76437-const-async-unsafe.stderr +++ b/tests/ui/parser/issues/issue-76437-const-async-unsafe.stderr @@ -2,10 +2,12 @@ error: expected one of `extern` or `fn`, found keyword `pub` --> $DIR/issue-76437-const-async-unsafe.rs:4:24 | LL | const async unsafe pub fn t() {} - | -------------------^^^ - | | | - | | expected one of `extern` or `fn` - | help: visibility `pub` must come before `const async unsafe`: `pub const async unsafe` + | ^^^ expected one of `extern` or `fn` + | +help: visibility `pub` must come before `const async unsafe` + | +LL | pub const async unsafe fn t() {} + | ~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-76437-const-async.stderr b/tests/ui/parser/issues/issue-76437-const-async.stderr index 81fa8a5f557e0..5a0f819f868c5 100644 --- a/tests/ui/parser/issues/issue-76437-const-async.stderr +++ b/tests/ui/parser/issues/issue-76437-const-async.stderr @@ -2,10 +2,12 @@ error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found keyword `pub` --> $DIR/issue-76437-const-async.rs:4:17 | LL | const async pub fn t() {} - | ------------^^^ - | | | - | | expected one of `extern`, `fn`, `safe`, or `unsafe` - | help: visibility `pub` must come before `const async`: `pub const async` + | ^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` + | +help: visibility `pub` must come before `const async` + | +LL | pub const async fn t() {} + | ~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-76437-const.stderr b/tests/ui/parser/issues/issue-76437-const.stderr index 005a27b7c2498..2eb92d416c1b8 100644 --- a/tests/ui/parser/issues/issue-76437-const.stderr +++ b/tests/ui/parser/issues/issue-76437-const.stderr @@ -2,10 +2,12 @@ error: expected one of `async`, `extern`, `fn`, `safe`, or `unsafe`, found keywo --> $DIR/issue-76437-const.rs:4:11 | LL | const pub fn t() {} - | ------^^^ - | | | - | | expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` - | help: visibility `pub` must come before `const`: `pub const` + | ^^^ expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` + | +help: visibility `pub` must come before `const` + | +LL | pub const fn t() {} + | ~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-76437-pub-crate-unsafe.stderr b/tests/ui/parser/issues/issue-76437-pub-crate-unsafe.stderr index 4ea76179be3f6..6bdc77dd8ed91 100644 --- a/tests/ui/parser/issues/issue-76437-pub-crate-unsafe.stderr +++ b/tests/ui/parser/issues/issue-76437-pub-crate-unsafe.stderr @@ -2,10 +2,12 @@ error: expected one of `extern` or `fn`, found keyword `pub` --> $DIR/issue-76437-pub-crate-unsafe.rs:4:12 | LL | unsafe pub(crate) fn t() {} - | -------^^^------- - | | | - | | expected one of `extern` or `fn` - | help: visibility `pub(crate)` must come before `unsafe`: `pub(crate) unsafe` + | ^^^ expected one of `extern` or `fn` + | +help: visibility `pub(crate)` must come before `unsafe` + | +LL | pub(crate) unsafe fn t() {} + | ~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-76437-unsafe.stderr b/tests/ui/parser/issues/issue-76437-unsafe.stderr index 69f7927750bf0..084593a3ed876 100644 --- a/tests/ui/parser/issues/issue-76437-unsafe.stderr +++ b/tests/ui/parser/issues/issue-76437-unsafe.stderr @@ -2,10 +2,12 @@ error: expected one of `extern` or `fn`, found keyword `pub` --> $DIR/issue-76437-unsafe.rs:4:12 | LL | unsafe pub fn t() {} - | -------^^^ - | | | - | | expected one of `extern` or `fn` - | help: visibility `pub` must come before `unsafe`: `pub unsafe` + | ^^^ expected one of `extern` or `fn` + | +help: visibility `pub` must come before `unsafe` + | +LL | pub unsafe fn t() {} + | ~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr index ed2e4d8154929..692fbc0350953 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/const-async-const.stderr @@ -2,16 +2,18 @@ error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found keyword `const --> $DIR/const-async-const.rs:5:13 | LL | const async const fn test() {} - | ^^^^^ - | | - | expected one of `extern`, `fn`, `safe`, or `unsafe` - | help: `const` already used earlier, remove this one + | ^^^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` | note: `const` first seen here --> $DIR/const-async-const.rs:5:1 | LL | const async const fn test() {} | ^^^^^ +help: `const` already used earlier, remove this one + | +LL - const async const fn test() {} +LL + const async fn test() {} + | error: functions cannot be both `const` and `async` --> $DIR/const-async-const.rs:5:1 diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr index 3f504a9ebfc49..c4f207d7cd331 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/recovery.stderr @@ -2,27 +2,30 @@ error: expected one of `extern` or `fn`, found keyword `const` --> $DIR/recovery.rs:6:12 | LL | unsafe const fn from_u32(val: u32) {} - | -------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `const` must come before `unsafe`: `const unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `const` must come before `unsafe` + | +LL | const unsafe fn from_u32(val: u32) {} + | ~~~~~~~~~~~~ error: expected one of `extern` or `fn`, found keyword `unsafe` --> $DIR/recovery.rs:14:12 | LL | unsafe unsafe fn from_u32(val: u32) {} - | ^^^^^^ - | | - | expected one of `extern` or `fn` - | help: `unsafe` already used earlier, remove this one + | ^^^^^^ expected one of `extern` or `fn` | note: `unsafe` first seen here --> $DIR/recovery.rs:14:5 | LL | unsafe unsafe fn from_u32(val: u32) {} | ^^^^^^ +help: `unsafe` already used earlier, remove this one + | +LL - unsafe unsafe fn from_u32(val: u32) {} +LL + unsafe fn from_u32(val: u32) {} + | error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr index 489e8eefb052e..ec0977e485607 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/several-kw-jump.stderr @@ -2,12 +2,13 @@ error: expected one of `extern` or `fn`, found keyword `const` --> $DIR/several-kw-jump.rs:9:14 | LL | async unsafe const fn test() {} - | -------------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `const` must come before `async unsafe`: `const async unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `const` must come before `async unsafe` + | +LL | const async unsafe fn test() {} + | ~~~~~~~~~~~~~~~~~~ error: functions cannot be both `const` and `async` --> $DIR/several-kw-jump.rs:9:1 diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.stderr index 74989502e7f5d..d66afac46ee1a 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-async.stderr @@ -2,12 +2,13 @@ error: expected one of `extern` or `fn`, found keyword `async` --> $DIR/wrong-async.rs:9:8 | LL | unsafe async fn test() {} - | -------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `async` must come before `unsafe`: `async unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `async` must come before `unsafe` + | +LL | async unsafe fn test() {} + | ~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.stderr index 5958f0c7d2ddd..f5fb163a89cfe 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-const.stderr @@ -2,12 +2,13 @@ error: expected one of `extern` or `fn`, found keyword `const` --> $DIR/wrong-const.rs:9:8 | LL | unsafe const fn test() {} - | -------^^^^^ - | | | - | | expected one of `extern` or `fn` - | help: `const` must come before `unsafe`: `const unsafe` + | ^^^^^ expected one of `extern` or `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `const` must come before `unsafe` + | +LL | const unsafe fn test() {} + | ~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr index 0e9f7c51e1a45..4bc4e56ec4edb 100644 --- a/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr +++ b/tests/ui/parser/issues/issue-87217-keyword-order/wrong-unsafe.stderr @@ -2,12 +2,13 @@ error: expected `fn`, found keyword `unsafe` --> $DIR/wrong-unsafe.rs:9:8 | LL | extern unsafe fn test() {} - | -------^^^^^^ - | | | - | | expected `fn` - | help: `unsafe` must come before `extern`: `unsafe extern` + | ^^^^^^ expected `fn` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `unsafe` must come before `extern` + | +LL | unsafe extern fn test() {} + | ~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87694-duplicated-pub.stderr b/tests/ui/parser/issues/issue-87694-duplicated-pub.stderr index dd75f32f68ff2..50d58ffb2fb35 100644 --- a/tests/ui/parser/issues/issue-87694-duplicated-pub.stderr +++ b/tests/ui/parser/issues/issue-87694-duplicated-pub.stderr @@ -2,16 +2,18 @@ error: expected one of `async`, `extern`, `fn`, `safe`, or `unsafe`, found keywo --> $DIR/issue-87694-duplicated-pub.rs:1:11 | LL | pub const pub fn test() {} - | ^^^ - | | - | expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` - | help: there is already a visibility modifier, remove one + | ^^^ expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` | note: explicit visibility first seen here --> $DIR/issue-87694-duplicated-pub.rs:1:1 | LL | pub const pub fn test() {} | ^^^ +help: there is already a visibility modifier, remove one + | +LL - pub const pub fn test() {} +LL + pub const fn test() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-87694-misplaced-pub.stderr b/tests/ui/parser/issues/issue-87694-misplaced-pub.stderr index d35e09dceaf7f..db87583eb5de4 100644 --- a/tests/ui/parser/issues/issue-87694-misplaced-pub.stderr +++ b/tests/ui/parser/issues/issue-87694-misplaced-pub.stderr @@ -2,10 +2,12 @@ error: expected one of `async`, `extern`, `fn`, `safe`, or `unsafe`, found keywo --> $DIR/issue-87694-misplaced-pub.rs:1:7 | LL | const pub fn test() {} - | ------^^^ - | | | - | | expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` - | help: visibility `pub` must come before `const`: `pub const` + | ^^^ expected one of `async`, `extern`, `fn`, `safe`, or `unsafe` + | +help: visibility `pub` must come before `const` + | +LL | pub const fn test() {} + | ~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/issues/issue-89396.stderr b/tests/ui/parser/issues/issue-89396.stderr index 41ce07050746a..6744f2cf07eea 100644 --- a/tests/ui/parser/issues/issue-89396.stderr +++ b/tests/ui/parser/issues/issue-89396.stderr @@ -2,19 +2,23 @@ error: expected one of `=>`, `if`, or `|`, found `=` --> $DIR/issue-89396.rs:9:17 | LL | Some(_) = true, - | ^ - | | - | expected one of `=>`, `if`, or `|` - | help: use a fat arrow to start a match arm: `=>` + | ^ expected one of `=>`, `if`, or `|` + | +help: use a fat arrow to start a match arm + | +LL | Some(_) => true, + | ~~ error: expected one of `=>`, `@`, `if`, or `|`, found `->` --> $DIR/issue-89396.rs:12:14 | LL | None -> false, - | ^^ - | | - | expected one of `=>`, `@`, `if`, or `|` - | help: use a fat arrow to start a match arm: `=>` + | ^^ expected one of `=>`, `@`, `if`, or `|` + | +help: use a fat arrow to start a match arm + | +LL | None => false, + | ~~ error: aborting due to 2 previous errors diff --git a/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr b/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr index 2df5cca24f06c..fcc0c730f781d 100644 --- a/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr +++ b/tests/ui/parser/issues/recover-ge-as-fat-arrow.stderr @@ -2,10 +2,12 @@ error: expected one of `...`, `..=`, `..`, `=>`, `if`, or `|`, found `>=` --> $DIR/recover-ge-as-fat-arrow.rs:4:11 | LL | 1 >= {} - | ^^ - | | - | expected one of `...`, `..=`, `..`, `=>`, `if`, or `|` - | help: use a fat arrow to start a match arm: `=>` + | ^^ expected one of `...`, `..=`, `..`, `=>`, `if`, or `|` + | +help: use a fat arrow to start a match arm + | +LL | 1 => {} + | ~~ error[E0308]: mismatched types --> $DIR/recover-ge-as-fat-arrow.rs:5:29 diff --git a/tests/ui/parser/kw-in-trait-bounds.stderr b/tests/ui/parser/kw-in-trait-bounds.stderr index 3c54e03195031..4a1ad3667373d 100644 --- a/tests/ui/parser/kw-in-trait-bounds.stderr +++ b/tests/ui/parser/kw-in-trait-bounds.stderr @@ -90,37 +90,57 @@ error[E0405]: cannot find trait `r#struct` in this scope --> $DIR/kw-in-trait-bounds.rs:16:10 | LL | fn _g(_: impl struct, _: &dyn struct) - | ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct` + | ^^^^^^ ... LL | trait Struct {} | ------------ similarly named trait `Struct` defined here + | +help: a trait with a similar name exists (notice the capitalization difference) + | +LL | fn _g(_: impl struct, _: &dyn struct) + | ~~~~~~ error[E0405]: cannot find trait `r#struct` in this scope --> $DIR/kw-in-trait-bounds.rs:30:8 | LL | B: struct, - | ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct` + | ^^^^^^ ... LL | trait Struct {} | ------------ similarly named trait `Struct` defined here + | +help: a trait with a similar name exists (notice the capitalization difference) + | +LL | B: Struct, + | ~~~~~~ error[E0405]: cannot find trait `r#struct` in this scope --> $DIR/kw-in-trait-bounds.rs:16:29 | LL | fn _g(_: impl struct, _: &dyn struct) - | ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct` + | ^^^^^^ ... LL | trait Struct {} | ------------ similarly named trait `Struct` defined here + | +help: a trait with a similar name exists (notice the capitalization difference) + | +LL | fn _g(_: impl Struct, _: &dyn struct) + | ~~~~~~ error[E0405]: cannot find trait `r#struct` in this scope --> $DIR/kw-in-trait-bounds.rs:16:45 | LL | fn _g(_: impl struct, _: &dyn struct) - | ^^^^^^ help: a trait with a similar name exists (notice the capitalization): `Struct` + | ^^^^^^ ... LL | trait Struct {} | ------------ similarly named trait `Struct` defined here + | +help: a trait with a similar name exists (notice the capitalization difference) + | +LL | fn _g(_: impl struct, _: &dyn Struct) + | ~~~~~~ error: aborting due to 12 previous errors diff --git a/tests/ui/parser/misspelled-macro-rules.stderr b/tests/ui/parser/misspelled-macro-rules.stderr index fc718d8556dfe..b0eb1f12c1d35 100644 --- a/tests/ui/parser/misspelled-macro-rules.stderr +++ b/tests/ui/parser/misspelled-macro-rules.stderr @@ -2,9 +2,12 @@ error: expected one of `(`, `[`, or `{`, found `thing` --> $DIR/misspelled-macro-rules.rs:7:14 | LL | marco_rules! thing { - | ----------- ^^^^^ expected one of `(`, `[`, or `{` - | | - | help: perhaps you meant to define a macro: `macro_rules` + | ^^^^^ expected one of `(`, `[`, or `{` + | +help: perhaps you meant to define a macro + | +LL | macro_rules! thing { + | ~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/qualified-path-in-turbofish.stderr b/tests/ui/parser/qualified-path-in-turbofish.stderr index 6e5af8cc1f0cc..6cb8d309ee1fb 100644 --- a/tests/ui/parser/qualified-path-in-turbofish.stderr +++ b/tests/ui/parser/qualified-path-in-turbofish.stderr @@ -2,7 +2,12 @@ error: found single colon before projection in qualified path --> $DIR/qualified-path-in-turbofish.rs:17:27 | LL | template::<:Ty>(); - | ^ help: use double colon: `::` + | ^ + | +help: use double colon + | +LL | template::<::Ty>(); + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/range-exclusive-dotdotlt.stderr b/tests/ui/parser/range-exclusive-dotdotlt.stderr index af25e1df343de..9a38473b64403 100644 --- a/tests/ui/parser/range-exclusive-dotdotlt.stderr +++ b/tests/ui/parser/range-exclusive-dotdotlt.stderr @@ -2,17 +2,25 @@ error: expected type, found `10` --> $DIR/range-exclusive-dotdotlt.rs:2:17 | LL | let _ = 0..<10; - | -^^ expected type - | | - | help: remove the `<` to write an exclusive range + | ^^ expected type + | +help: remove the `<` to write an exclusive range + | +LL - let _ = 0..<10; +LL + let _ = 0..10; + | error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `;` --> $DIR/range-exclusive-dotdotlt.rs:8:20 | LL | let _ = 0.. $DIR/range-exclusive-dotdotlt.rs:14:18 @@ -24,17 +32,25 @@ error: expected type, found `1` --> $DIR/range-exclusive-dotdotlt.rs:19:26 | LL | let _ = [1, 2, 3][..<1]; - | -^ expected type - | | - | help: remove the `<` to write an exclusive range + | ^ expected type + | +help: remove the `<` to write an exclusive range + | +LL - let _ = [1, 2, 3][..<1]; +LL + let _ = [1, 2, 3][..1]; + | error: expected one of `!`, `(`, `+`, `::`, `<`, `>`, or `as`, found `]` --> $DIR/range-exclusive-dotdotlt.rs:25:29 | LL | let _ = [1, 2, 3][.. $DIR/range-exclusive-dotdotlt.rs:31:30 diff --git a/tests/ui/parser/raw/raw-byte-string-eof.stderr b/tests/ui/parser/raw/raw-byte-string-eof.stderr index 88fd53904c43f..6a126c712a168 100644 --- a/tests/ui/parser/raw/raw-byte-string-eof.stderr +++ b/tests/ui/parser/raw/raw-byte-string-eof.stderr @@ -2,11 +2,13 @@ error[E0748]: unterminated raw string --> $DIR/raw-byte-string-eof.rs:2:5 | LL | br##"a"#; - | ^ - help: consider terminating the string here: `##` - | | - | unterminated raw string + | ^ unterminated raw string | = note: this raw string should be terminated with `"##` +help: consider terminating the string here + | +LL | br##"a"##; + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/raw/raw-str-unbalanced.stderr b/tests/ui/parser/raw/raw-str-unbalanced.stderr index eac8c06c1df5c..d957e555883b6 100644 --- a/tests/ui/parser/raw/raw-str-unbalanced.stderr +++ b/tests/ui/parser/raw/raw-str-unbalanced.stderr @@ -2,18 +2,30 @@ error: too many `#` when terminating raw string --> $DIR/raw-str-unbalanced.rs:2:10 | LL | r#""## - | -----^ help: remove the extra `#` + | -----^ | | | this raw string started with 1 `#` + | +help: remove the extra `#` + | +LL - r#""## +LL + r#""# + | error: too many `#` when terminating raw string --> $DIR/raw-str-unbalanced.rs:7:9 | LL | / r#" LL | | "#### - | | -^^^ help: remove the extra `#`s + | | -^^^ | |________| | this raw string started with 1 `#` + | +help: remove the extra `#`s + | +LL - "#### +LL + "# + | error: expected `;`, found `#` --> $DIR/raw-str-unbalanced.rs:10:28 @@ -28,9 +40,15 @@ error: too many `#` when terminating raw string --> $DIR/raw-str-unbalanced.rs:16:28 | LL | const B: &'static str = r""## - | ---^^ help: remove the extra `#`s + | ---^^ | | | this raw string started with 0 `#`s + | +help: remove the extra `#`s + | +LL - const B: &'static str = r""## +LL + const B: &'static str = r"" + | error: aborting due to 4 previous errors diff --git a/tests/ui/parser/raw/raw-string-2.stderr b/tests/ui/parser/raw/raw-string-2.stderr index 90dd9775e62e4..a73bcec7a87d2 100644 --- a/tests/ui/parser/raw/raw-string-2.stderr +++ b/tests/ui/parser/raw/raw-string-2.stderr @@ -2,9 +2,13 @@ error[E0748]: unterminated raw string --> $DIR/raw-string-2.rs:2:13 | LL | let x = r###"here's a long string"# "# "##; - | ^ unterminated raw string -- help: consider terminating the string here: `###` + | ^ unterminated raw string | = note: this raw string should be terminated with `"###` +help: consider terminating the string here + | +LL | let x = r###"here's a long string"# "# "###; + | ~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/raw/raw-string.stderr b/tests/ui/parser/raw/raw-string.stderr index 6654ef7a75a42..413ca1e7342d3 100644 --- a/tests/ui/parser/raw/raw-string.stderr +++ b/tests/ui/parser/raw/raw-string.stderr @@ -2,11 +2,13 @@ error[E0748]: unterminated raw string --> $DIR/raw-string.rs:2:13 | LL | let x = r##"lol"#; - | ^ - help: consider terminating the string here: `##` - | | - | unterminated raw string + | ^ unterminated raw string | = note: this raw string should be terminated with `"##` +help: consider terminating the string here + | +LL | let x = r##"lol"##; + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/recover/recover-unticked-labels.stderr b/tests/ui/parser/recover/recover-unticked-labels.stderr index fbd108ca613c7..6638b35a86263 100644 --- a/tests/ui/parser/recover/recover-unticked-labels.stderr +++ b/tests/ui/parser/recover/recover-unticked-labels.stderr @@ -18,11 +18,14 @@ error[E0425]: cannot find value `label` in this scope --> $DIR/recover-unticked-labels.rs:4:26 | LL | 'label: loop { break label }; - | ------ ^^^^^ - | | | - | | not found in this scope - | | help: use the similarly named label: `'label` + | ------ ^^^^^ not found in this scope + | | | a label with a similar name exists + | +help: use the similarly named label + | +LL | 'label: loop { break 'label }; + | ~~~~~~ error: aborting due to 3 previous errors diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr b/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr index fda0919b9b647..7a3561c205300 100644 --- a/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr +++ b/tests/ui/parser/removed-syntax/removed-syntax-field-let-2.stderr @@ -2,25 +2,29 @@ error: expected identifier, found keyword `let` --> $DIR/removed-syntax-field-let-2.rs:2:5 | LL | let x: i32, - | ^^^- - | | - | expected identifier, found keyword - | help: remove this `let` keyword + | ^^^ expected identifier, found keyword | = note: the `let` keyword is not allowed in `struct` fields = note: see for more information +help: remove this `let` keyword + | +LL - let x: i32, +LL + x: i32, + | error: expected identifier, found keyword `let` --> $DIR/removed-syntax-field-let-2.rs:4:5 | LL | let y: i32, - | ^^^- - | | - | expected identifier, found keyword - | help: remove this `let` keyword + | ^^^ expected identifier, found keyword | = note: the `let` keyword is not allowed in `struct` fields = note: see for more information +help: remove this `let` keyword + | +LL - let y: i32, +LL + y: i32, + | error[E0063]: missing fields `x` and `y` in initializer of `Foo` --> $DIR/removed-syntax-field-let-2.rs:9:13 diff --git a/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr b/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr index 339d056e6360f..48e439c8c2c34 100644 --- a/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr +++ b/tests/ui/parser/removed-syntax/removed-syntax-field-let.stderr @@ -2,13 +2,15 @@ error: expected identifier, found keyword `let` --> $DIR/removed-syntax-field-let.rs:2:5 | LL | let foo: (), - | ^^^- - | | - | expected identifier, found keyword - | help: remove this `let` keyword + | ^^^ expected identifier, found keyword | = note: the `let` keyword is not allowed in `struct` fields = note: see for more information +help: remove this `let` keyword + | +LL - let foo: (), +LL + foo: (), + | error: aborting due to 1 previous error diff --git a/tests/ui/parser/removed-syntax/removed-syntax-with-1.stderr b/tests/ui/parser/removed-syntax/removed-syntax-with-1.stderr index 78042678a87bb..02de9d979cb4b 100644 --- a/tests/ui/parser/removed-syntax/removed-syntax-with-1.stderr +++ b/tests/ui/parser/removed-syntax/removed-syntax-with-1.stderr @@ -2,10 +2,14 @@ error: expected one of `,`, `.`, `?`, `}`, or an operator, found `with` --> $DIR/removed-syntax-with-1.rs:8:25 | LL | let b = S { foo: () with a, bar: () }; - | - -^^^^ expected one of `,`, `.`, `?`, `}`, or an operator - | | | - | | help: try adding a comma: `,` + | - ^^^^ expected one of `,`, `.`, `?`, `}`, or an operator + | | | while parsing this struct + | +help: try adding a comma + | +LL | let b = S { foo: (), with a, bar: () }; + | + error: aborting due to 1 previous error diff --git a/tests/ui/parser/struct-default-values-and-missing-field-separator.stderr b/tests/ui/parser/struct-default-values-and-missing-field-separator.stderr index 7f16ebcfc3ace..756cd838587cb 100644 --- a/tests/ui/parser/struct-default-values-and-missing-field-separator.stderr +++ b/tests/ui/parser/struct-default-values-and-missing-field-separator.stderr @@ -38,13 +38,23 @@ error: expected `,`, or `}`, found `field2` --> $DIR/struct-default-values-and-missing-field-separator.rs:18:16 | LL | field1: i32 - | ^ help: try adding a comma: `,` + | ^ + | +help: try adding a comma + | +LL | field1: i32, + | + error: expected `,`, or `}`, found `field3` --> $DIR/struct-default-values-and-missing-field-separator.rs:19:14 | LL | field2: E - | ^ help: try adding a comma: `,` + | ^ + | +help: try adding a comma + | +LL | field2: E, + | + error: default values on `struct` fields aren't supported --> $DIR/struct-default-values-and-missing-field-separator.rs:20:16 diff --git a/tests/ui/parser/struct-filed-with-attr.stderr b/tests/ui/parser/struct-filed-with-attr.stderr index d850ed620de43..8799ea4cfb099 100644 --- a/tests/ui/parser/struct-filed-with-attr.stderr +++ b/tests/ui/parser/struct-filed-with-attr.stderr @@ -2,7 +2,12 @@ error: expected `,`, or `}`, found `#` --> $DIR/struct-filed-with-attr.rs:5:14 | LL | owo: bool - | ^ help: try adding a comma: `,` + | ^ + | +help: try adding a comma + | +LL | owo: bool, + | + error: aborting due to 1 previous error diff --git a/tests/ui/parser/suggest-assoc-const.stderr b/tests/ui/parser/suggest-assoc-const.stderr index 6e29fad98d466..70ebeded31374 100644 --- a/tests/ui/parser/suggest-assoc-const.stderr +++ b/tests/ui/parser/suggest-assoc-const.stderr @@ -2,7 +2,12 @@ error: non-item in item list --> $DIR/suggest-assoc-const.rs:5:5 | LL | let _X: i32; - | ^^^ help: consider using `const` instead of `let` for associated const: `const` + | ^^^ + | +help: consider using `const` instead of `let` for associated const + | +LL | const _X: i32; + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/parser/suggest-removing-semicolon-after-impl-trait-items.stderr b/tests/ui/parser/suggest-removing-semicolon-after-impl-trait-items.stderr index 396c76ac85f2f..f406799bf5543 100644 --- a/tests/ui/parser/suggest-removing-semicolon-after-impl-trait-items.stderr +++ b/tests/ui/parser/suggest-removing-semicolon-after-impl-trait-items.stderr @@ -4,12 +4,15 @@ error: non-item in item list LL | trait Foo { | - item list starts here LL | fn bar() {}; - | ^ - | | - | non-item starts here - | help: consider removing this semicolon + | ^ non-item starts here LL | } | - item list ends here + | +help: consider removing this semicolon + | +LL - fn bar() {}; +LL + fn bar() {} + | error: aborting due to 1 previous error diff --git a/tests/ui/pattern/issue-106862.stderr b/tests/ui/pattern/issue-106862.stderr index 27f8ac97284eb..74c082e1b3375 100644 --- a/tests/ui/pattern/issue-106862.stderr +++ b/tests/ui/pattern/issue-106862.stderr @@ -5,7 +5,12 @@ LL | FooB { x: i32, y: i32 } | ----------------------- `FooB` defined here ... LL | FooB(a, b) => println!("{} {}", a, b), - | ^^^^^^^^^^ help: use struct pattern syntax instead: `FooB { x: a, y: b }` + | ^^^^^^^^^^ + | +help: use struct pattern syntax instead + | +LL | FooB { x: a, y: b } => println!("{} {}", a, b), + | ~~~~~~~~~~~~~~~~~~~ error[E0532]: expected tuple struct or tuple variant, found variant `FooB` --> $DIR/issue-106862.rs:22:9 @@ -14,7 +19,12 @@ LL | FooB { x: i32, y: i32 } | ----------------------- `FooB` defined here ... LL | FooB(x, y) => println!("{} {}", x, y), - | ^^^^^^^^^^ help: use struct pattern syntax instead: `FooB { x, y }` + | ^^^^^^^^^^ + | +help: use struct pattern syntax instead + | +LL | FooB { x, y } => println!("{} {}", x, y), + | ~~~~~~~~~~~~~ error[E0532]: expected tuple struct or tuple variant, found variant `FooA` --> $DIR/issue-106862.rs:28:9 @@ -23,7 +33,12 @@ LL | FooA { opt_x: Option, y: i32 }, | ----------------------------------- `FooA` defined here ... LL | FooA(Some(x), y) => println!("{} {}", x, y), - | ^^^^^^^^^^^^^^^^ help: use struct pattern syntax instead: `FooA { opt_x: Some(x), y }` + | ^^^^^^^^^^^^^^^^ + | +help: use struct pattern syntax instead + | +LL | FooA { opt_x: Some(x), y } => println!("{} {}", x, y), + | ~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0532]: expected tuple struct or tuple variant, found variant `FooB` --> $DIR/issue-106862.rs:34:9 @@ -32,7 +47,12 @@ LL | FooB { x: i32, y: i32 } | ----------------------- `FooB` defined here ... LL | FooB(a, _, _) => println!("{}", a), - | ^^^^^^^^^^^^^ help: use struct pattern syntax instead: `FooB { x: a, y: _ }` + | ^^^^^^^^^^^^^ + | +help: use struct pattern syntax instead + | +LL | FooB { x: a, y: _ } => println!("{}", a), + | ~~~~~~~~~~~~~~~~~~~ error[E0532]: expected tuple struct or tuple variant, found variant `FooB` --> $DIR/issue-106862.rs:40:9 @@ -41,7 +61,12 @@ LL | FooB { x: i32, y: i32 } | ----------------------- `FooB` defined here ... LL | FooB() => (), - | ^^^^^^ help: use struct pattern syntax instead: `FooB { x, y }` + | ^^^^^^ + | +help: use struct pattern syntax instead + | +LL | FooB { x, y } => (), + | ~~~~~~~~~~~~~ error: aborting due to 5 previous errors diff --git a/tests/ui/pattern/no-match-tuple-variant-self-ctor.struct_.stderr b/tests/ui/pattern/no-match-tuple-variant-self-ctor.struct_.stderr index 5ed3979feb807..60ed95a2c5776 100644 --- a/tests/ui/pattern/no-match-tuple-variant-self-ctor.struct_.stderr +++ b/tests/ui/pattern/no-match-tuple-variant-self-ctor.struct_.stderr @@ -5,7 +5,12 @@ LL | struct S {} | ----------- `S` defined here ... LL | let Self = S; - | ^ help: use struct literal syntax instead: `S {}` + | ^ + | +help: use struct literal syntax instead + | +LL | let Self = S {}; + | ~~~~ error[E0533]: expected unit struct, found self constructor `Self` --> $DIR/no-match-tuple-variant-self-ctor.rs:30:17 diff --git a/tests/ui/pattern/pat-tuple-underfield.stderr b/tests/ui/pattern/pat-tuple-underfield.stderr index e75f9b38da566..939529e0cf240 100644 --- a/tests/ui/pattern/pat-tuple-underfield.stderr +++ b/tests/ui/pattern/pat-tuple-underfield.stderr @@ -5,7 +5,12 @@ LL | S(i32, f32), | ----------- `E::S` defined here ... LL | E::S => {} - | ^^^^ help: use the tuple variant pattern syntax instead: `E::S(_, _)` + | ^^^^ + | +help: use the tuple variant pattern syntax instead + | +LL | E::S(_, _) => {} + | ~~~~~~~~~~ error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields --> $DIR/pat-tuple-underfield.rs:9:11 diff --git a/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr b/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr index 68538255eddf0..212489a03e3a2 100644 --- a/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr +++ b/tests/ui/pattern/patkind-ref-binding-issue-114896.stderr @@ -1,10 +1,13 @@ error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable --> $DIR/patkind-ref-binding-issue-114896.rs:7:9 | -LL | let &b = a; - | -- help: consider changing this to be mutable: `&(mut b)` LL | b.make_ascii_uppercase(); | ^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | let &(mut b) = a; + | ~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr b/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr index 39283133ac7c8..0cef457358980 100644 --- a/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr +++ b/tests/ui/pattern/patkind-ref-binding-issue-122415.stderr @@ -1,10 +1,13 @@ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/patkind-ref-binding-issue-122415.rs:7:12 | -LL | fn foo(&x: &i32) { - | -- help: consider changing this to be mutable: `&(mut x)` LL | mutate(&mut x); | ^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | fn foo(&(mut x): &i32) { + | ~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/pattern/pattern-error-continue.stderr b/tests/ui/pattern/pattern-error-continue.stderr index 10fcccb030162..79467296d3369 100644 --- a/tests/ui/pattern/pattern-error-continue.stderr +++ b/tests/ui/pattern/pattern-error-continue.stderr @@ -54,10 +54,12 @@ error[E0433]: failed to resolve: use of undeclared type `E` --> $DIR/pattern-error-continue.rs:33:9 | LL | E::V => {} - | ^ - | | - | use of undeclared type `E` - | help: an enum with a similar name exists: `A` + | ^ use of undeclared type `E` + | +help: an enum with a similar name exists + | +LL | A::V => {} + | ~ error: aborting due to 5 previous errors diff --git a/tests/ui/proc-macro/gen-macro-rules-hygiene.stderr b/tests/ui/proc-macro/gen-macro-rules-hygiene.stderr index df7c4f72eb0b6..6c8a29a7a42f0 100644 --- a/tests/ui/proc-macro/gen-macro-rules-hygiene.stderr +++ b/tests/ui/proc-macro/gen-macro-rules-hygiene.stderr @@ -13,18 +13,27 @@ error[E0425]: cannot find value `local_use` in this scope --> $DIR/gen-macro-rules-hygiene.rs:12:1 | LL | gen_macro_rules!(); - | ^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `local_def` + | ^^^^^^^^^^^^^^^^^^ ... LL | generated!(); | ------------ in this macro invocation | = note: this error originates in the macro `generated` (in Nightly builds, run with -Z macro-backtrace for more info) +help: a local variable with a similar name exists + | +LL | local_def; + | ~~~~~~~~~ error[E0425]: cannot find value `local_def` in this scope --> $DIR/gen-macro-rules-hygiene.rs:21:9 | LL | local_def; - | ^^^^^^^^^ help: a local variable with a similar name exists: `local_use` + | ^^^^^^^^^ + | +help: a local variable with a similar name exists + | +LL | local_use; + | ~~~~~~~~~ error: aborting due to 3 previous errors diff --git a/tests/ui/proc-macro/issue-37788.stderr b/tests/ui/proc-macro/issue-37788.stderr index 9ce783073fdca..c23ebd02dc56d 100644 --- a/tests/ui/proc-macro/issue-37788.stderr +++ b/tests/ui/proc-macro/issue-37788.stderr @@ -5,12 +5,14 @@ LL | fn main() { | - expected `()` because of default return type LL | // Test that constructing the `visible_parent_map` (in `cstore_impl.rs`) does not ICE. LL | std::cell::Cell::new(0) - | ^^^^^^^^^^^^^^^^^^^^^^^- help: consider using a semicolon here: `;` - | | - | expected `()`, found `Cell<{integer}>` + | ^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Cell<{integer}>` | = note: expected unit type `()` found struct `Cell<{integer}>` +help: consider using a semicolon here + | +LL | std::cell::Cell::new(0); + | + error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/lints_in_proc_macros.stderr b/tests/ui/proc-macro/lints_in_proc_macros.stderr index 244d218608be7..09069a38e6e09 100644 --- a/tests/ui/proc-macro/lints_in_proc_macros.stderr +++ b/tests/ui/proc-macro/lints_in_proc_macros.stderr @@ -2,9 +2,13 @@ error[E0425]: cannot find value `foobar2` in this scope --> $DIR/lints_in_proc_macros.rs:9:5 | LL | bang_proc_macro2!(); - | ^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `foobar` + | ^^^^^^^^^^^^^^^^^^^ | = note: this error originates in the macro `bang_proc_macro2` (in Nightly builds, run with -Z macro-backtrace for more info) +help: a local variable with a similar name exists + | +LL | foobar; + | ~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/proc-macro/mixed-site-span.stderr b/tests/ui/proc-macro/mixed-site-span.stderr index 1378608012464..427b8e50ac302 100644 --- a/tests/ui/proc-macro/mixed-site-span.stderr +++ b/tests/ui/proc-macro/mixed-site-span.stderr @@ -10,15 +10,24 @@ error[E0425]: cannot find value `local_use` in this scope --> $DIR/mixed-site-span.rs:13:9 | LL | proc_macro_rules!(); - | ^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `local_def` + | ^^^^^^^^^^^^^^^^^^^ | = note: this error originates in the macro `proc_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info) +help: a local variable with a similar name exists + | +LL | local_def; + | ~~~~~~~~~ error[E0425]: cannot find value `local_def` in this scope --> $DIR/mixed-site-span.rs:17:9 | LL | local_def; - | ^^^^^^^^^ help: a local variable with a similar name exists: `local_use` + | ^^^^^^^^^ + | +help: a local variable with a similar name exists + | +LL | local_use; + | ~~~~~~~~~ error[E0412]: cannot find type `ItemUse` in crate `$crate` --> $DIR/mixed-site-span.rs:24:1 diff --git a/tests/ui/proc-macro/parent-source-spans.stderr b/tests/ui/proc-macro/parent-source-spans.stderr index a3b27fd7bcc1b..bff7d7c94586c 100644 --- a/tests/ui/proc-macro/parent-source-spans.stderr +++ b/tests/ui/proc-macro/parent-source-spans.stderr @@ -140,7 +140,7 @@ error[E0425]: cannot find value `ok` in this scope --> $DIR/parent-source-spans.rs:29:5 | LL | parent_source_spans!($($tokens)*); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a tuple variant with a similar name exists: `Ok` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... LL | one!("hello", "world"); | ---------------------- in this macro invocation @@ -149,12 +149,16 @@ LL | one!("hello", "world"); = note: similarly named tuple variant `Ok` defined here | = note: this error originates in the macro `parent_source_spans` which comes from the expansion of the macro `one` (in Nightly builds, run with -Z macro-backtrace for more info) +help: a tuple variant with a similar name exists + | +LL | Ok; + | ~~ error[E0425]: cannot find value `ok` in this scope --> $DIR/parent-source-spans.rs:29:5 | LL | parent_source_spans!($($tokens)*); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a tuple variant with a similar name exists: `Ok` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... LL | two!("yay", "rust"); | ------------------- in this macro invocation @@ -163,12 +167,16 @@ LL | two!("yay", "rust"); = note: similarly named tuple variant `Ok` defined here | = note: this error originates in the macro `parent_source_spans` which comes from the expansion of the macro `two` (in Nightly builds, run with -Z macro-backtrace for more info) +help: a tuple variant with a similar name exists + | +LL | Ok; + | ~~ error[E0425]: cannot find value `ok` in this scope --> $DIR/parent-source-spans.rs:29:5 | LL | parent_source_spans!($($tokens)*); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: a tuple variant with a similar name exists: `Ok` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... LL | three!("hip", "hop"); | -------------------- in this macro invocation @@ -177,6 +185,10 @@ LL | three!("hip", "hop"); = note: similarly named tuple variant `Ok` defined here | = note: this error originates in the macro `parent_source_spans` which comes from the expansion of the macro `three` (in Nightly builds, run with -Z macro-backtrace for more info) +help: a tuple variant with a similar name exists + | +LL | Ok; + | ~~ error: aborting due to 21 previous errors diff --git a/tests/ui/proc-macro/proc-macro-attributes.stderr b/tests/ui/proc-macro/proc-macro-attributes.stderr index 140d879069040..565fa278ab613 100644 --- a/tests/ui/proc-macro/proc-macro-attributes.stderr +++ b/tests/ui/proc-macro/proc-macro-attributes.stderr @@ -2,7 +2,12 @@ error: cannot find attribute `C` in this scope --> $DIR/proc-macro-attributes.rs:9:3 | LL | #[C] - | ^ help: a derive helper attribute with a similar name exists: `B` + | ^ + | +help: a derive helper attribute with a similar name exists + | +LL | #[B] + | ~ error[E0659]: `B` is ambiguous --> $DIR/proc-macro-attributes.rs:6:3 diff --git a/tests/ui/proc-macro/resolve-error.stderr b/tests/ui/proc-macro/resolve-error.stderr index e7639f474c75e..c198cb1cb38cb 100644 --- a/tests/ui/proc-macro/resolve-error.stderr +++ b/tests/ui/proc-macro/resolve-error.stderr @@ -2,12 +2,17 @@ error: cannot find macro `bang_proc_macrp` in this scope --> $DIR/resolve-error.rs:60:5 | LL | bang_proc_macrp!(); - | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `bang_proc_macro` + | ^^^^^^^^^^^^^^^ | ::: $DIR/auxiliary/test-macros.rs:15:1 | LL | pub fn empty(_: TokenStream) -> TokenStream { | ------------------------------------------- similarly named macro `bang_proc_macro` defined here + | +help: a macro with a similar name exists + | +LL | bang_proc_macro!(); + | ~~~~~~~~~~~~~~~ error: cannot find macro `Dlona` in this scope --> $DIR/resolve-error.rs:57:5 @@ -22,7 +27,12 @@ LL | macro_rules! attr_proc_mac { | -------------------------- similarly named macro `attr_proc_mac` defined here ... LL | attr_proc_macra!(); - | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `attr_proc_mac` + | ^^^^^^^^^^^^^^^ + | +help: a macro with a similar name exists + | +LL | attr_proc_mac!(); + | ~~~~~~~~~~~~~ error: cannot find macro `FooWithLongNama` in this scope --> $DIR/resolve-error.rs:51:5 @@ -31,7 +41,12 @@ LL | macro_rules! FooWithLongNam { | --------------------------- similarly named macro `FooWithLongNam` defined here ... LL | FooWithLongNama!(); - | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `FooWithLongNam` + | ^^^^^^^^^^^^^^^ + | +help: a macro with a similar name exists + | +LL | FooWithLongNam!(); + | ~~~~~~~~~~~~~~ error: cannot find derive macro `attr_proc_macra` in this scope --> $DIR/resolve-error.rs:45:10 @@ -51,18 +66,23 @@ error: cannot find derive macro `Dlona` in this scope --> $DIR/resolve-error.rs:40:10 | LL | #[derive(Dlona)] - | ^^^^^ help: a derive macro with a similar name exists: `Clona` + | ^^^^^ | ::: $DIR/auxiliary/derive-clona.rs:11:1 | LL | pub fn derive_clonea(input: TokenStream) -> TokenStream { | ------------------------------------------------------- similarly named derive macro `Clona` defined here + | +help: a derive macro with a similar name exists + | +LL | #[derive(Clona)] + | ~~~~~ error: cannot find derive macro `Dlona` in this scope --> $DIR/resolve-error.rs:40:10 | LL | #[derive(Dlona)] - | ^^^^^ help: a derive macro with a similar name exists: `Clona` + | ^^^^^ | ::: $DIR/auxiliary/derive-clona.rs:11:1 | @@ -70,26 +90,39 @@ LL | pub fn derive_clonea(input: TokenStream) -> TokenStream { | ------------------------------------------------------- similarly named derive macro `Clona` defined here | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: a derive macro with a similar name exists + | +LL | #[derive(Clona)] + | ~~~~~ error: cannot find derive macro `Dlone` in this scope --> $DIR/resolve-error.rs:35:10 | LL | #[derive(Dlone)] - | ^^^^^ help: a derive macro with a similar name exists: `Clone` + | ^^^^^ --> $SRC_DIR/core/src/clone.rs:LL:COL | = note: similarly named derive macro `Clone` defined here + | +help: a derive macro with a similar name exists + | +LL | #[derive(Clone)] + | ~~~~~ error: cannot find derive macro `Dlone` in this scope --> $DIR/resolve-error.rs:35:10 | LL | #[derive(Dlone)] - | ^^^^^ help: a derive macro with a similar name exists: `Clone` + | ^^^^^ --> $SRC_DIR/core/src/clone.rs:LL:COL | = note: similarly named derive macro `Clone` defined here | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: a derive macro with a similar name exists + | +LL | #[derive(Clone)] + | ~~~~~ error: cannot find attribute `FooWithLongNan` in this scope --> $DIR/resolve-error.rs:32:3 @@ -101,29 +134,39 @@ error: cannot find attribute `attr_proc_macra` in this scope --> $DIR/resolve-error.rs:28:3 | LL | #[attr_proc_macra] - | ^^^^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `attr_proc_macro` + | ^^^^^^^^^^^^^^^ | ::: $DIR/auxiliary/test-macros.rs:20:1 | LL | pub fn empty_attr(_: TokenStream, _: TokenStream) -> TokenStream { | ---------------------------------------------------------------- similarly named attribute macro `attr_proc_macro` defined here + | +help: an attribute macro with a similar name exists + | +LL | #[attr_proc_macro] + | ~~~~~~~~~~~~~~~ error: cannot find derive macro `FooWithLongNan` in this scope --> $DIR/resolve-error.rs:22:10 | LL | #[derive(FooWithLongNan)] - | ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName` + | ^^^^^^^^^^^^^^ | ::: $DIR/auxiliary/derive-foo.rs:11:1 | LL | pub fn derive_foo(input: TokenStream) -> TokenStream { | ---------------------------------------------------- similarly named derive macro `FooWithLongName` defined here + | +help: a derive macro with a similar name exists + | +LL | #[derive(FooWithLongName)] + | ~~~~~~~~~~~~~~~ error: cannot find derive macro `FooWithLongNan` in this scope --> $DIR/resolve-error.rs:22:10 | LL | #[derive(FooWithLongNan)] - | ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName` + | ^^^^^^^^^^^^^^ | ::: $DIR/auxiliary/derive-foo.rs:11:1 | @@ -131,6 +174,10 @@ LL | pub fn derive_foo(input: TokenStream) -> TokenStream { | ---------------------------------------------------- similarly named derive macro `FooWithLongName` defined here | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: a derive macro with a similar name exists + | +LL | #[derive(FooWithLongName)] + | ~~~~~~~~~~~~~~~ error: aborting due to 14 previous errors diff --git a/tests/ui/regions/outlives-with-missing.stderr b/tests/ui/regions/outlives-with-missing.stderr index 0e3aaaf5fdbd0..40904db9457e1 100644 --- a/tests/ui/regions/outlives-with-missing.stderr +++ b/tests/ui/regions/outlives-with-missing.stderr @@ -5,7 +5,12 @@ LL | impl HandlerWrapper { | - similarly named type parameter `H` defined here ... LL | T: Send + Sync + 'static, - | ^ help: a type parameter with a similar name exists: `H` + | ^ + | +help: a type parameter with a similar name exists + | +LL | H: Send + Sync + 'static, + | ~ error: aborting due to 1 previous error diff --git a/tests/ui/resolve/112590-2.stderr b/tests/ui/resolve/112590-2.stderr index 0db20249d27f5..bd2a02dd7cf6f 100644 --- a/tests/ui/resolve/112590-2.stderr +++ b/tests/ui/resolve/112590-2.stderr @@ -61,10 +61,12 @@ error[E0433]: failed to resolve: use of undeclared crate or module `vec` --> $DIR/112590-2.rs:23:24 | LL | let _t: Vec = vec::new(); - | ^^^ - | | - | use of undeclared crate or module `vec` - | help: a struct with a similar name exists (notice the capitalization): `Vec` + | ^^^ use of undeclared crate or module `vec` + | +help: a struct with a similar name exists (notice the capitalization difference) + | +LL | let _t: Vec = Vec::new(); + | ~~~ error: aborting due to 5 previous errors diff --git a/tests/ui/resolve/issue-100365.stderr b/tests/ui/resolve/issue-100365.stderr index 372d772666804..2d9bab4304d46 100644 --- a/tests/ui/resolve/issue-100365.stderr +++ b/tests/ui/resolve/issue-100365.stderr @@ -2,19 +2,34 @@ error[E0423]: expected value, found trait `Into` --> $DIR/issue-100365.rs:2:16 | LL | let addr = Into::.into([127, 0, 0, 1]); - | ^^^^^^^^^^^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::` + | ^^^^^^^^^^^^^^^^^^^^^^^^ + | +help: use the path separator to refer to an item + | +LL | let addr = Into::::into([127, 0, 0, 1]); + | ~~ error[E0423]: expected value, found trait `Into` --> $DIR/issue-100365.rs:6:13 | LL | let _ = Into.into(()); - | ^^^^- help: use the path separator to refer to an item: `::` + | ^^^^ + | +help: use the path separator to refer to an item + | +LL | let _ = Into::into(()); + | ~~ error[E0423]: expected value, found trait `Into` --> $DIR/issue-100365.rs:10:13 | LL | let _ = Into::<()>.into; - | ^^^^^^^^^^- help: use the path separator to refer to an item: `::` + | ^^^^^^^^^^ + | +help: use the path separator to refer to an item + | +LL | let _ = Into::<()>::into; + | ~~ error[E0423]: expected value, found trait `std::iter::Iterator` --> $DIR/issue-100365.rs:17:9 @@ -42,12 +57,16 @@ error[E0423]: expected value, found trait `Into` --> $DIR/issue-100365.rs:25:9 | LL | Into::.into("") - | ^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::` + | ^^^^^^^^^^^^^^ ... LL | let _ = create!(); | --------- in this macro invocation | = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) +help: use the path separator to refer to an item + | +LL | Into::::into("") + | ~~ error: aborting due to 6 previous errors diff --git a/tests/ui/resolve/issue-10200.stderr b/tests/ui/resolve/issue-10200.stderr index 7b218694b269e..29c40e32aff62 100644 --- a/tests/ui/resolve/issue-10200.stderr +++ b/tests/ui/resolve/issue-10200.stderr @@ -5,7 +5,12 @@ LL | struct Foo(bool); | ----------------- similarly named tuple struct `Foo` defined here ... LL | foo(x) - | ^^^ help: a tuple struct with a similar name exists (notice the capitalization): `Foo` + | ^^^ + | +help: a tuple struct with a similar name exists (notice the capitalization difference) + | +LL | Foo(x) + | ~~~ error: aborting due to 1 previous error diff --git a/tests/ui/resolve/issue-22692.stderr b/tests/ui/resolve/issue-22692.stderr index 6962aa161e92a..be0634ebffc96 100644 --- a/tests/ui/resolve/issue-22692.stderr +++ b/tests/ui/resolve/issue-22692.stderr @@ -2,19 +2,34 @@ error[E0423]: expected value, found struct `String` --> $DIR/issue-22692.rs:2:13 | LL | let _ = String.new(); - | ^^^^^^- help: use the path separator to refer to an item: `::` + | ^^^^^^ + | +help: use the path separator to refer to an item + | +LL | let _ = String::new(); + | ~~ error[E0423]: expected value, found struct `String` --> $DIR/issue-22692.rs:6:13 | LL | let _ = String.default; - | ^^^^^^- help: use the path separator to refer to an item: `::` + | ^^^^^^ + | +help: use the path separator to refer to an item + | +LL | let _ = String::default; + | ~~ error[E0423]: expected value, found struct `Vec` --> $DIR/issue-22692.rs:10:13 | LL | let _ = Vec::<()>.with_capacity(1); - | ^^^^^^^^^- help: use the path separator to refer to an item: `::` + | ^^^^^^^^^ + | +help: use the path separator to refer to an item + | +LL | let _ = Vec::<()>::with_capacity(1); + | ~~ error[E0423]: expected value, found struct `std::cell::Cell` --> $DIR/issue-22692.rs:17:9 @@ -50,23 +65,31 @@ error[E0423]: expected value, found struct `Vec` --> $DIR/issue-22692.rs:26:9 | LL | Vec.new() - | ^^^- help: use the path separator to refer to an item: `::` + | ^^^ ... LL | let _ = create!(type method); | -------------------- in this macro invocation | = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) +help: use the path separator to refer to an item + | +LL | Vec::new() + | ~~ error[E0423]: expected value, found struct `Vec` --> $DIR/issue-22692.rs:31:9 | LL | Vec.new - | ^^^- help: use the path separator to refer to an item: `::` + | ^^^ ... LL | let _ = create!(type field); | ------------------- in this macro invocation | = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) +help: use the path separator to refer to an item + | +LL | Vec::new + | ~~ error[E0423]: expected value, found struct `std::cell::Cell` --> $DIR/issue-22692.rs:17:9 diff --git a/tests/ui/resolve/issue-3214.stderr b/tests/ui/resolve/issue-3214.stderr index 5b57c1baf90ba..614d3b21ff2cc 100644 --- a/tests/ui/resolve/issue-3214.stderr +++ b/tests/ui/resolve/issue-3214.stderr @@ -12,15 +12,18 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-3214.rs:6:22 | LL | impl Drop for Foo { - | ^^^--- help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: struct defined here, with 0 generic parameters --> $DIR/issue-3214.rs:2:12 | LL | struct Foo { | ^^^ +help: remove these generics + | +LL - impl Drop for Foo { +LL + impl Drop for Foo { + | error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/issue-49074.stderr b/tests/ui/resolve/issue-49074.stderr index bbfeb4ea9483a..281bb95756c2d 100644 --- a/tests/ui/resolve/issue-49074.stderr +++ b/tests/ui/resolve/issue-49074.stderr @@ -10,7 +10,12 @@ error: cannot find attribute `marco_use` in this scope --> $DIR/issue-49074.rs:3:3 | LL | #[marco_use] // typo - | ^^^^^^^^^ help: a built-in attribute with a similar name exists: `macro_use` + | ^^^^^^^^^ + | +help: a built-in attribute with a similar name exists + | +LL | #[macro_use] // typo + | ~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/issue-6702.stderr b/tests/ui/resolve/issue-6702.stderr index d1ceee3e56e82..cb0a690b36203 100644 --- a/tests/ui/resolve/issue-6702.stderr +++ b/tests/ui/resolve/issue-6702.stderr @@ -7,7 +7,12 @@ LL | | } | |_- `Monster` defined here ... LL | let _m = Monster(); - | ^^^^^^^^^ help: use struct literal syntax instead: `Monster { damage: val }` + | ^^^^^^^^^ + | +help: use struct literal syntax instead + | +LL | let _m = Monster { damage: val }; + | ~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/resolve/levenshtein.stderr b/tests/ui/resolve/levenshtein.stderr index cf478210132ed..9c89813b50c62 100644 --- a/tests/ui/resolve/levenshtein.stderr +++ b/tests/ui/resolve/levenshtein.stderr @@ -2,7 +2,12 @@ error[E0412]: cannot find type `esize` in this scope --> $DIR/levenshtein.rs:5:11 | LL | fn foo(c: esize) {} // Misspelled primitive type name. - | ^^^^^ help: a builtin type with a similar name exists: `isize` + | ^^^^^ + | +help: a builtin type with a similar name exists + | +LL | fn foo(c: isize) {} // Misspelled primitive type name. + | ~~~~~ error[E0412]: cannot find type `Baz` in this scope --> $DIR/levenshtein.rs:10:10 @@ -11,16 +16,26 @@ LL | enum Bar { } | -------- similarly named enum `Bar` defined here LL | LL | type A = Baz; // Misspelled type name. - | ^^^ help: an enum with a similar name exists: `Bar` + | ^^^ + | +help: an enum with a similar name exists + | +LL | type A = Bar; // Misspelled type name. + | ~~~ error[E0412]: cannot find type `Opiton` in this scope --> $DIR/levenshtein.rs:12:10 | LL | type B = Opiton; // Misspelled type name from the prelude. - | ^^^^^^ help: an enum with a similar name exists: `Option` + | ^^^^^^ --> $SRC_DIR/core/src/option.rs:LL:COL | = note: similarly named enum `Option` defined here + | +help: an enum with a similar name exists + | +LL | type B = Option; // Misspelled type name from the prelude. + | ~~~~~~ error[E0412]: cannot find type `Baz` in this scope --> $DIR/levenshtein.rs:16:14 @@ -35,7 +50,12 @@ LL | const MAX_ITEM: usize = 10; | --------------------------- similarly named constant `MAX_ITEM` defined here ... LL | let v = [0u32; MAXITEM]; // Misspelled constant name. - | ^^^^^^^ help: a constant with a similar name exists: `MAX_ITEM` + | ^^^^^^^ + | +help: a constant with a similar name exists + | +LL | let v = [0u32; MAX_ITEM]; // Misspelled constant name. + | ~~~~~~~~ error[E0412]: cannot find type `first` in module `m` --> $DIR/levenshtein.rs:28:15 @@ -44,7 +64,12 @@ LL | pub struct First; | ----------------- similarly named struct `First` defined here ... LL | let b: m::first = m::second; // Misspelled item in module. - | ^^^^^ help: a struct with a similar name exists (notice the capitalization): `First` + | ^^^^^ + | +help: a struct with a similar name exists (notice the capitalization difference) + | +LL | let b: m::First = m::second; // Misspelled item in module. + | ~~~~~ error[E0425]: cannot find value `second` in module `m` --> $DIR/levenshtein.rs:28:26 @@ -53,7 +78,12 @@ LL | pub struct Second; | ------------------ similarly named unit struct `Second` defined here ... LL | let b: m::first = m::second; // Misspelled item in module. - | ^^^^^^ help: a unit struct with a similar name exists (notice the capitalization): `Second` + | ^^^^^^ + | +help: a unit struct with a similar name exists (notice the capitalization difference) + | +LL | let b: m::first = m::Second; // Misspelled item in module. + | ~~~~~~ error[E0425]: cannot find function `foobar` in this scope --> $DIR/levenshtein.rs:26:5 @@ -62,7 +92,12 @@ LL | fn foo_bar() {} | ------------ similarly named function `foo_bar` defined here ... LL | foobar(); // Misspelled function name. - | ^^^^^^ help: a function with a similar name exists: `foo_bar` + | ^^^^^^ + | +help: a function with a similar name exists + | +LL | foo_bar(); // Misspelled function name. + | ~~~~~~~ error: aborting due to 8 previous errors diff --git a/tests/ui/resolve/privacy-enum-ctor.stderr b/tests/ui/resolve/privacy-enum-ctor.stderr index ee3aecddcc342..c5062ae1c0af3 100644 --- a/tests/ui/resolve/privacy-enum-ctor.stderr +++ b/tests/ui/resolve/privacy-enum-ctor.stderr @@ -141,13 +141,17 @@ LL | pub enum E { | ---------- similarly named enum `E` defined here ... LL | let _: Z = m::n::Z; - | ^ help: an enum with a similar name exists: `E` + | ^ | note: enum `m::Z` exists but is inaccessible --> $DIR/privacy-enum-ctor.rs:11:9 | LL | pub(in m) enum Z { | ^^^^^^^^^^^^^^^^ not accessible +help: an enum with a similar name exists + | +LL | let _: E = m::n::Z; + | ~ error[E0423]: expected value, found enum `m::n::Z` --> $DIR/privacy-enum-ctor.rs:57:16 @@ -182,13 +186,17 @@ LL | pub enum E { | ---------- similarly named enum `E` defined here ... LL | let _: Z = m::n::Z::Fn; - | ^ help: an enum with a similar name exists: `E` + | ^ | note: enum `m::Z` exists but is inaccessible --> $DIR/privacy-enum-ctor.rs:11:9 | LL | pub(in m) enum Z { | ^^^^^^^^^^^^^^^^ not accessible +help: an enum with a similar name exists + | +LL | let _: E = m::n::Z::Fn; + | ~ error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:64:12 @@ -197,13 +205,17 @@ LL | pub enum E { | ---------- similarly named enum `E` defined here ... LL | let _: Z = m::n::Z::Struct; - | ^ help: an enum with a similar name exists: `E` + | ^ | note: enum `m::Z` exists but is inaccessible --> $DIR/privacy-enum-ctor.rs:11:9 | LL | pub(in m) enum Z { | ^^^^^^^^^^^^^^^^ not accessible +help: an enum with a similar name exists + | +LL | let _: E = m::n::Z::Struct; + | ~ error[E0412]: cannot find type `Z` in this scope --> $DIR/privacy-enum-ctor.rs:68:12 @@ -212,13 +224,17 @@ LL | pub enum E { | ---------- similarly named enum `E` defined here ... LL | let _: Z = m::n::Z::Unit {}; - | ^ help: an enum with a similar name exists: `E` + | ^ | note: enum `m::Z` exists but is inaccessible --> $DIR/privacy-enum-ctor.rs:11:9 | LL | pub(in m) enum Z { | ^^^^^^^^^^^^^^^^ not accessible +help: an enum with a similar name exists + | +LL | let _: E = m::n::Z::Unit {}; + | ~ error[E0603]: enum `Z` is private --> $DIR/privacy-enum-ctor.rs:57:22 diff --git a/tests/ui/resolve/privacy-struct-ctor.stderr b/tests/ui/resolve/privacy-struct-ctor.stderr index c1fcaaf05738f..4a517feaac563 100644 --- a/tests/ui/resolve/privacy-struct-ctor.stderr +++ b/tests/ui/resolve/privacy-struct-ctor.stderr @@ -5,10 +5,12 @@ LL | pub struct S(u8); | ----------------- similarly named tuple struct `S` defined here ... LL | Z; - | ^ - | | - | constructor is not visible here due to private fields - | help: a tuple struct with a similar name exists: `S` + | ^ constructor is not visible here due to private fields + | +help: a tuple struct with a similar name exists + | +LL | S; + | ~ error[E0423]: expected value, found struct `S` --> $DIR/privacy-struct-ctor.rs:33:5 @@ -25,7 +27,12 @@ LL | | } | |_____- `S2` defined here ... LL | S2; - | ^^ help: use struct literal syntax instead: `S2 { s: val }` + | ^^ + | +help: use struct literal syntax instead + | +LL | S2 { s: val }; + | ~~~~~~~~~~~~~ error[E0423]: expected value, found struct `xcrate::S` --> $DIR/privacy-struct-ctor.rs:43:5 diff --git a/tests/ui/resolve/suggest-path-for-tuple-struct.stderr b/tests/ui/resolve/suggest-path-for-tuple-struct.stderr index 4764cf2db20e8..12c631f5a8300 100644 --- a/tests/ui/resolve/suggest-path-for-tuple-struct.stderr +++ b/tests/ui/resolve/suggest-path-for-tuple-struct.stderr @@ -2,13 +2,23 @@ error[E0423]: expected value, found struct `SomeTupleStruct` --> $DIR/suggest-path-for-tuple-struct.rs:22:13 | LL | let _ = SomeTupleStruct.new(); - | ^^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::` + | ^^^^^^^^^^^^^^^ + | +help: use the path separator to refer to an item + | +LL | let _ = SomeTupleStruct::new(); + | ~~ error[E0423]: expected value, found struct `SomeRegularStruct` --> $DIR/suggest-path-for-tuple-struct.rs:24:13 | LL | let _ = SomeRegularStruct.new(); - | ^^^^^^^^^^^^^^^^^- help: use the path separator to refer to an item: `::` + | ^^^^^^^^^^^^^^^^^ + | +help: use the path separator to refer to an item + | +LL | let _ = SomeRegularStruct::new(); + | ~~ error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr b/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr index a4ce0deeb70f5..04d3b4d0e902f 100644 --- a/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr +++ b/tests/ui/resolve/suggest-path-instead-of-mod-dot-item.stderr @@ -2,19 +2,34 @@ error[E0423]: expected value, found module `a` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:17:5 | LL | a.I - | ^- help: use the path separator to refer to an item: `::` + | ^ + | +help: use the path separator to refer to an item + | +LL | a::I + | ~~ error[E0423]: expected value, found module `a` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:23:5 | LL | a.g() - | ^- help: use the path separator to refer to an item: `::` + | ^ + | +help: use the path separator to refer to an item + | +LL | a::g() + | ~~ error[E0423]: expected value, found module `a` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:29:5 | LL | a.b.J - | ^- help: use the path separator to refer to an item: `::` + | ^ + | +help: use the path separator to refer to an item + | +LL | a::b.J + | ~~ error[E0423]: expected value, found module `a::b` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:35:5 @@ -38,7 +53,12 @@ error[E0423]: expected value, found module `a` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:42:5 | LL | a.b.f(); - | ^- help: use the path separator to refer to an item: `::` + | ^ + | +help: use the path separator to refer to an item + | +LL | a::b.f(); + | ~~ error[E0423]: expected value, found module `a::b` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:46:12 @@ -47,9 +67,12 @@ LL | pub const I: i32 = 1; | --------------------- similarly named constant `I` defined here ... LL | v.push(a::b); - | ^^^- - | | - | help: a constant with a similar name exists: `I` + | ^^^^ + | +help: a constant with a similar name exists + | +LL | v.push(a::I); + | ~ error[E0423]: expected value, found module `a::b` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:52:5 @@ -76,9 +99,12 @@ LL | pub const I: i32 = 1; | --------------------- similarly named constant `I` defined here ... LL | a::b - | ^^^- - | | - | help: a constant with a similar name exists: `I` + | ^^^^ + | +help: a constant with a similar name exists + | +LL | a::I + | ~ error[E0423]: expected function, found module `a::b` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:65:5 @@ -87,9 +113,12 @@ LL | pub const I: i32 = 1; | --------------------- similarly named constant `I` defined here ... LL | a::b() - | ^^^- - | | - | help: a constant with a similar name exists: `I` + | ^^^^ + | +help: a constant with a similar name exists + | +LL | a::I() + | ~ error[E0423]: expected value, found module `a` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:72:9 @@ -117,23 +146,31 @@ error[E0423]: expected value, found module `a` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:80:9 | LL | a.f() - | ^- help: use the path separator to refer to an item: `::` + | ^ ... LL | let _ = create!(method); | --------------- in this macro invocation | = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) +help: use the path separator to refer to an item + | +LL | a::f() + | ~~ error[E0423]: expected value, found module `a` --> $DIR/suggest-path-instead-of-mod-dot-item.rs:85:9 | LL | a.f - | ^- help: use the path separator to refer to an item: `::` + | ^ ... LL | let _ = create!(field); | -------------- in this macro invocation | = note: this error originates in the macro `create` (in Nightly builds, run with -Z macro-backtrace for more info) +help: use the path separator to refer to an item + | +LL | a::f + | ~~ error: aborting due to 13 previous errors diff --git a/tests/ui/resolve/tuple-struct-alias.stderr b/tests/ui/resolve/tuple-struct-alias.stderr index a739ea43eed47..fc36fc1a6d8b7 100644 --- a/tests/ui/resolve/tuple-struct-alias.stderr +++ b/tests/ui/resolve/tuple-struct-alias.stderr @@ -5,9 +5,13 @@ LL | struct S(u8, u16); | ------------------ similarly named tuple struct `S` defined here ... LL | A(..) => {} - | ^ help: a tuple struct with a similar name exists: `S` + | ^ | = note: can't use a type alias as a constructor +help: a tuple struct with a similar name exists + | +LL | S(..) => {} + | ~ error[E0423]: expected function, tuple struct or tuple variant, found type alias `A` --> $DIR/tuple-struct-alias.rs:5:13 @@ -16,9 +20,13 @@ LL | struct S(u8, u16); | ------------------ similarly named tuple struct `S` defined here ... LL | let s = A(0, 1); - | ^ help: a tuple struct with a similar name exists: `S` + | ^ | = note: can't use a type alias as a constructor +help: a tuple struct with a similar name exists + | +LL | let s = S(0, 1); + | ~ error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr b/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr index 0306c8af87d85..9ea0811fe5d4a 100644 --- a/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr +++ b/tests/ui/resolve/typo-suggestion-for-variable-with-name-similar-to-struct-field.stderr @@ -5,7 +5,12 @@ LL | config: String, | -------------- a field by that name exists in `Self` ... LL | Self { config } - | ^^^^^^ help: a local variable with a similar name exists: `cofig` + | ^^^^^^ + | +help: a local variable with a similar name exists + | +LL | Self { cofig } + | ~~~~~ error[E0425]: cannot find value `config` in this scope --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:11:20 @@ -14,7 +19,12 @@ LL | config: String, | -------------- a field by that name exists in `Self` ... LL | println!("{config}"); - | ^^^^^^ help: a local variable with a similar name exists: `cofig` + | ^^^^^^ + | +help: a local variable with a similar name exists + | +LL | println!("{cofig}"); + | ~~~~~ error[E0425]: cannot find value `config` in this scope --> $DIR/typo-suggestion-for-variable-with-name-similar-to-struct-field.rs:15:20 diff --git a/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr b/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr index f4fb7fd955f2b..2ac35ef02b376 100644 --- a/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr +++ b/tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr @@ -2,10 +2,12 @@ error[E0433]: failed to resolve: could not find `Struc` in `module` --> $DIR/typo-suggestion-mistyped-in-path.rs:35:13 | LL | module::Struc::foo(); - | ^^^^^ - | | - | could not find `Struc` in `module` - | help: a struct with a similar name exists: `Struct` + | ^^^^^ could not find `Struc` in `module` + | +help: a struct with a similar name exists + | +LL | module::Struct::foo(); + | ~~~~~~ error[E0599]: no function or associated item named `fob` found for struct `Struct` in the current scope --> $DIR/typo-suggestion-mistyped-in-path.rs:23:13 @@ -25,10 +27,12 @@ error[E0433]: failed to resolve: use of undeclared type `Struc` --> $DIR/typo-suggestion-mistyped-in-path.rs:27:5 | LL | Struc::foo(); - | ^^^^^ - | | - | use of undeclared type `Struc` - | help: a struct with a similar name exists: `Struct` + | ^^^^^ use of undeclared type `Struc` + | +help: a struct with a similar name exists + | +LL | Struct::foo(); + | ~~~~~~ error[E0433]: failed to resolve: use of undeclared crate or module `modul` --> $DIR/typo-suggestion-mistyped-in-path.rs:31:5 @@ -45,10 +49,12 @@ error[E0433]: failed to resolve: use of undeclared type `Trai` --> $DIR/typo-suggestion-mistyped-in-path.rs:39:5 | LL | Trai::foo(); - | ^^^^ - | | - | use of undeclared type `Trai` - | help: a trait with a similar name exists: `Trait` + | ^^^^ use of undeclared type `Trai` + | +help: a trait with a similar name exists + | +LL | Trait::foo(); + | ~~~~~ error: aborting due to 5 previous errors diff --git a/tests/ui/return/return-impl-trait-bad.stderr b/tests/ui/return/return-impl-trait-bad.stderr index 6277c5feb20e9..425aba603d0f9 100644 --- a/tests/ui/return/return-impl-trait-bad.stderr +++ b/tests/ui/return/return-impl-trait-bad.stderr @@ -45,10 +45,8 @@ error[E0308]: mismatched types --> $DIR/return-impl-trait-bad.rs:28:5 | LL | fn used_in_trait() -> T - | - - - | | | - | | expected `T` because of return type - | | help: consider using an impl return type: `impl Send` + | - - expected `T` because of return type + | | | expected this type parameter ... LL | "don't suggest this, because the generic param is used in the bound." @@ -57,6 +55,10 @@ LL | "don't suggest this, because the generic param is used in the bound." = note: expected type parameter `T` found reference `&'static str` = note: the caller chooses a type for `T` which can be different from `&'static str` +help: consider using an impl return type + | +LL | fn used_in_trait() -> impl Send + | ~~~~~~~~~ error: aborting due to 4 previous errors diff --git a/tests/ui/return/return-impl-trait.stderr b/tests/ui/return/return-impl-trait.stderr index 114ae0c244516..276473c3b9891 100644 --- a/tests/ui/return/return-impl-trait.stderr +++ b/tests/ui/return/return-impl-trait.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/return-impl-trait.rs:15:5 | LL | fn bar() -> T - | - - - | | | - | | expected `T` because of return type - | expected this type parameter help: consider using an impl return type: `impl Trait + std::marker::Sync + Send` + | - expected this type parameter - expected `T` because of return type ... LL | () | ^^ expected type parameter `T`, found `()` @@ -13,15 +10,17 @@ LL | () = note: expected type parameter `T` found unit type `()` = note: the caller chooses a type for `T` which can be different from `()` +help: consider using an impl return type + | +LL | fn bar() -> impl Trait + std::marker::Sync + Send + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0308]: mismatched types --> $DIR/return-impl-trait.rs:23:5 | LL | fn other_bounds() -> T - | - - - | | | - | | expected `T` because of return type - | | help: consider using an impl return type: `impl Trait` + | - - expected `T` because of return type + | | | expected this type parameter ... LL | () @@ -30,6 +29,10 @@ LL | () = note: expected type parameter `T` found unit type `()` = note: the caller chooses a type for `T` which can be different from `()` +help: consider using an impl return type + | +LL | fn other_bounds() -> impl Trait + | ~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/const.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/const.stderr index 1c8e8d5b0a7db..538e31637238b 100644 --- a/tests/ui/rfcs/rfc-2005-default-binding-mode/const.stderr +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/const.stderr @@ -11,7 +11,11 @@ LL | FOO => {}, | | | expected `&Foo`, found `Foo` | `FOO` is interpreted as a constant, not a new binding - | help: introduce a new binding instead: `other_foo` + | +help: introduce a new binding instead + | +LL | other_foo => {}, + | ~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params-cross-crate.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params-cross-crate.stderr index cc870ad336cd1..bbc25fbb712c2 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params-cross-crate.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params-cross-crate.stderr @@ -2,57 +2,69 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/no-explicit-const-params-cross-crate.rs:14:5 | LL | foo::(); - | ^^^--------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: function defined here, with 0 generic parameters --> $DIR/auxiliary/cross-crate.rs:3:14 | LL | pub const fn foo() {} | ^^^ +help: remove these generics + | +LL - foo::(); +LL + foo(); + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/no-explicit-const-params-cross-crate.rs:16:12 | LL | <() as Bar>::bar(); - | ^^^------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/auxiliary/cross-crate.rs:6:11 | LL | pub trait Bar { | ^^^ +help: remove these generics + | +LL - <() as Bar>::bar(); +LL + <() as Bar>::bar(); + | error[E0107]: function takes 0 generic arguments but 1 generic argument was supplied --> $DIR/no-explicit-const-params-cross-crate.rs:7:5 | LL | foo::(); - | ^^^-------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: function defined here, with 0 generic parameters --> $DIR/auxiliary/cross-crate.rs:3:14 | LL | pub const fn foo() {} | ^^^ +help: remove these generics + | +LL - foo::(); +LL + foo(); + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/no-explicit-const-params-cross-crate.rs:9:12 | LL | <() as Bar>::bar(); - | ^^^------ help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/auxiliary/cross-crate.rs:6:11 | LL | pub trait Bar { | ^^^ +help: remove these generics + | +LL - <() as Bar>::bar(); +LL + <() as Bar>::bar(); + | error: aborting due to 4 previous errors diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.stderr index 39aa5825611f3..80802a5a4d223 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/effects/no-explicit-const-params.stderr @@ -11,29 +11,35 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/no-explicit-const-params.rs:22:5 | LL | foo::(); - | ^^^--------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: function defined here, with 0 generic parameters --> $DIR/no-explicit-const-params.rs:3:10 | LL | const fn foo() {} | ^^^ +help: remove these generics + | +LL - foo::(); +LL + foo(); + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/no-explicit-const-params.rs:24:12 | LL | <() as Bar>::bar(); - | ^^^------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/no-explicit-const-params.rs:6:7 | LL | trait Bar { | ^^^ +help: remove these generics + | +LL - <() as Bar>::bar(); +LL + <() as Bar>::bar(); + | error[E0308]: mismatched types --> $DIR/no-explicit-const-params.rs:24:5 @@ -48,29 +54,35 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/no-explicit-const-params.rs:15:5 | LL | foo::(); - | ^^^-------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: function defined here, with 0 generic parameters --> $DIR/no-explicit-const-params.rs:3:10 | LL | const fn foo() {} | ^^^ +help: remove these generics + | +LL - foo::(); +LL + foo(); + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/no-explicit-const-params.rs:17:12 | LL | <() as Bar>::bar(); - | ^^^------ help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/no-explicit-const-params.rs:6:7 | LL | trait Bar { | ^^^ +help: remove these generics + | +LL - <() as Bar>::bar(); +LL + <() as Bar>::bar(); + | error: aborting due to 5 previous errors; 1 warning emitted diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr index 011232f30b8a6..c8a817436c699 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/ice-120503-async-const-method.stderr @@ -2,12 +2,13 @@ error: expected one of `extern`, `fn`, `safe`, or `unsafe`, found keyword `const --> $DIR/ice-120503-async-const-method.rs:7:11 | LL | async const fn bar(&self) { - | ------^^^^^ - | | | - | | expected one of `extern`, `fn`, `safe`, or `unsafe` - | help: `const` must come before `async`: `const async` + | ^^^^^ expected one of `extern`, `fn`, `safe`, or `unsafe` | = note: keyword order for functions declaration is `pub`, `default`, `const`, `async`, `unsafe`, `extern` +help: `const` must come before `async` + | +LL | const async fn bar(&self) { + | ~~~~~~~~~~~ error[E0379]: functions in trait impls cannot be declared const --> $DIR/ice-120503-async-const-method.rs:7:11 @@ -59,10 +60,15 @@ error[E0425]: cannot find function `main8` in this scope --> $DIR/ice-120503-async-const-method.rs:13:9 | LL | main8().await; - | ^^^^^ help: a function with a similar name exists: `main` + | ^^^^^ ... LL | fn main() {} | --------- similarly named function `main` defined here + | +help: a function with a similar name exists + | +LL | main().await; + | ~~~~ error[E0391]: cycle detected when computing type of opaque `::bar::{opaque#0}` --> $DIR/ice-120503-async-const-method.rs:7:5 diff --git a/tests/ui/rust-2021/array-into-iter-ambiguous.stderr b/tests/ui/rust-2021/array-into-iter-ambiguous.stderr index 2a724bd307200..c8c23b07373b6 100644 --- a/tests/ui/rust-2021/array-into-iter-ambiguous.stderr +++ b/tests/ui/rust-2021/array-into-iter-ambiguous.stderr @@ -2,7 +2,7 @@ warning: trait method `into_iter` will become ambiguous in Rust 2021 --> $DIR/array-into-iter-ambiguous.rs:24:13 | LL | let y = points.into_iter(); - | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `MyIntoIter::into_iter(points)` + | ^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2021 = note: for more information, see @@ -11,6 +11,10 @@ note: the lint level is defined here | LL | #![warn(array_into_iter)] | ^^^^^^^^^^^^^^^ +help: disambiguate the associated function + | +LL | let y = MyIntoIter::into_iter(points); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: 1 warning emitted diff --git a/tests/ui/rust-2021/future-prelude-collision-generic-trait.stderr b/tests/ui/rust-2021/future-prelude-collision-generic-trait.stderr index f38da132b5e87..517ddac966c6d 100644 --- a/tests/ui/rust-2021/future-prelude-collision-generic-trait.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-generic-trait.stderr @@ -2,7 +2,7 @@ warning: trait-associated function `try_from` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-generic-trait.rs:24:9 | LL | U::try_from(self) - | ^^^^^^^^^^^ help: disambiguate the associated function: `>::try_from` + | ^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see @@ -11,6 +11,10 @@ note: the lint level is defined here | LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: disambiguate the associated function + | +LL | >::try_from(self) + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: 1 warning emitted diff --git a/tests/ui/rust-2021/future-prelude-collision-generic.stderr b/tests/ui/rust-2021/future-prelude-collision-generic.stderr index 9893b3ebaa657..2cb1766b5666f 100644 --- a/tests/ui/rust-2021/future-prelude-collision-generic.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-generic.stderr @@ -2,7 +2,7 @@ warning: trait-associated function `from_iter` will become ambiguous in Rust 202 --> $DIR/future-prelude-collision-generic.rs:28:5 | LL | Generic::from_iter(1); - | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: ` as MyFromIter>::from_iter` + | ^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see @@ -11,24 +11,36 @@ note: the lint level is defined here | LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: disambiguate the associated function + | +LL | as MyFromIter>::from_iter(1); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-generic.rs:31:5 | LL | Generic::<'static, i32>::from_iter(1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: ` as MyFromIter>::from_iter` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | as MyFromIter>::from_iter(1); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-generic.rs:34:5 | LL | Generic::<'_, _>::from_iter(1); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: ` as MyFromIter>::from_iter` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | as MyFromIter>::from_iter(1); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: 3 warnings emitted diff --git a/tests/ui/rust-2021/future-prelude-collision-imported.stderr b/tests/ui/rust-2021/future-prelude-collision-imported.stderr index c1d72d0df2187..78bb665e2d7a5 100644 --- a/tests/ui/rust-2021/future-prelude-collision-imported.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-imported.stderr @@ -2,7 +2,7 @@ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-imported.rs:27:22 | LL | let _: u32 = 3u8.try_into().unwrap(); - | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)` + | ^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see @@ -11,33 +11,49 @@ note: the lint level is defined here | LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: disambiguate the associated function + | +LL | let _: u32 = TryIntoU32::try_into(3u8).unwrap(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-imported.rs:40:22 | LL | let _: u32 = 3u8.try_into().unwrap(); - | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `crate::m::TryIntoU32::try_into(3u8)` + | ^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | let _: u32 = crate::m::TryIntoU32::try_into(3u8).unwrap(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-imported.rs:53:22 | LL | let _: u32 = 3u8.try_into().unwrap(); - | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `super::m::TryIntoU32::try_into(3u8)` + | ^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | let _: u32 = super::m::TryIntoU32::try_into(3u8).unwrap(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-imported.rs:64:22 | LL | let _: u32 = 3u8.try_into().unwrap(); - | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)` + | ^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | let _: u32 = TryIntoU32::try_into(3u8).unwrap(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~ warning: 4 warnings emitted diff --git a/tests/ui/rust-2021/future-prelude-collision-macros.stderr b/tests/ui/rust-2021/future-prelude-collision-macros.stderr index 4d4a076995805..fa36edaa24f3b 100644 --- a/tests/ui/rust-2021/future-prelude-collision-macros.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-macros.stderr @@ -2,7 +2,7 @@ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-macros.rs:39:5 | LL | foo!().try_into(todo!()); - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `MyTry::try_into(foo!(), todo!())` + | ^^^^^^^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see @@ -11,15 +11,23 @@ note: the lint level is defined here | LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: disambiguate the associated function + | +LL | MyTry::try_into(foo!(), todo!()); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait-associated function `try_from` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-macros.rs:42:5 | LL | ::try_from(0); - | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `::try_from` + | ^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | ::try_from(0); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: 2 warnings emitted diff --git a/tests/ui/rust-2021/future-prelude-collision-turbofish.stderr b/tests/ui/rust-2021/future-prelude-collision-turbofish.stderr index c0ef80fd84153..4bda9816b8309 100644 --- a/tests/ui/rust-2021/future-prelude-collision-turbofish.stderr +++ b/tests/ui/rust-2021/future-prelude-collision-turbofish.stderr @@ -2,7 +2,7 @@ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-turbofish.rs:19:5 | LL | x.try_into::().or(Err("foo"))?.checked_sub(1); - | ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `AnnotatableTryInto::try_into::(x)` + | ^^^^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see @@ -11,15 +11,23 @@ note: the lint level is defined here | LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: disambiguate the associated function + | +LL | AnnotatableTryInto::try_into::(x).or(Err("foo"))?.checked_sub(1); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-turbofish.rs:23:5 | LL | x.try_into::().or(Err("foo"))?; - | ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `AnnotatableTryInto::try_into::(x)` + | ^^^^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | AnnotatableTryInto::try_into::(x).or(Err("foo"))?; + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: 2 warnings emitted diff --git a/tests/ui/rust-2021/future-prelude-collision.stderr b/tests/ui/rust-2021/future-prelude-collision.stderr index cae113ff7113b..49100e5ae3c15 100644 --- a/tests/ui/rust-2021/future-prelude-collision.stderr +++ b/tests/ui/rust-2021/future-prelude-collision.stderr @@ -2,7 +2,7 @@ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:56:18 | LL | let _: u32 = 3u8.try_into().unwrap(); - | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(3u8)` + | ^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see @@ -11,69 +11,101 @@ note: the lint level is defined here | LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: disambiguate the associated function + | +LL | let _: u32 = TryIntoU32::try_into(3u8).unwrap(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait-associated function `try_from` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:61:13 | LL | let _ = u32::try_from(3u8).unwrap(); - | ^^^^^^^^^^^^^ help: disambiguate the associated function: `::try_from` + | ^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | let _ = ::try_from(3u8).unwrap(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:66:13 | LL | let _ = >::from_iter(vec![1u8, 2, 3, 4, 5, 6].into_iter()); - | ^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: ` as FromByteIterator>::from_iter` + | ^^^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | let _ = as FromByteIterator>::from_iter(vec![1u8, 2, 3, 4, 5, 6].into_iter()); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait-associated function `try_from` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:74:18 | LL | let _: u32 = <_>::try_from(3u8).unwrap(); - | ^^^^^^^^^^^^^ help: disambiguate the associated function: `<_ as TryFromU8>::try_from` + | ^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | let _: u32 = <_ as TryFromU8>::try_from(3u8).unwrap(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:79:18 | LL | let _: u32 = (&3u8).try_into().unwrap(); - | ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(*(&3u8))` + | ^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | let _: u32 = TryIntoU32::try_into(*(&3u8)).unwrap(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:84:18 | LL | let _: u32 = 3.0.try_into().unwrap(); - | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(&3.0)` + | ^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | let _: u32 = TryIntoU32::try_into(&3.0).unwrap(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:90:18 | LL | let _: u32 = mut_ptr.try_into().unwrap(); - | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(mut_ptr as *const _)` + | ^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | let _: u32 = TryIntoU32::try_into(mut_ptr as *const _).unwrap(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: trait-associated function `try_from` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:95:13 | LL | let _ = U32Alias::try_from(3u8).unwrap(); - | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `::try_from` + | ^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see +help: disambiguate the associated function + | +LL | let _ = ::try_from(3u8).unwrap(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: 8 warnings emitted diff --git a/tests/ui/rust-2021/generic-type-collision.stderr b/tests/ui/rust-2021/generic-type-collision.stderr index 1ec61044f4a57..ea56ce0d23f35 100644 --- a/tests/ui/rust-2021/generic-type-collision.stderr +++ b/tests/ui/rust-2021/generic-type-collision.stderr @@ -2,7 +2,7 @@ warning: trait-associated function `from_iter` will become ambiguous in Rust 202 --> $DIR/generic-type-collision.rs:15:5 | LL | >::from_iter(None); - | ^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: ` as MyTrait<_>>::from_iter` + | ^^^^^^^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see @@ -11,6 +11,10 @@ note: the lint level is defined here | LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: disambiguate the associated function + | +LL | as MyTrait<_>>::from_iter(None); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: 1 warning emitted diff --git a/tests/ui/rust-2021/inherent-dyn-collision.stderr b/tests/ui/rust-2021/inherent-dyn-collision.stderr index d9e720dd9af8f..26fdc1d525e44 100644 --- a/tests/ui/rust-2021/inherent-dyn-collision.stderr +++ b/tests/ui/rust-2021/inherent-dyn-collision.stderr @@ -2,7 +2,7 @@ warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/inherent-dyn-collision.rs:42:9 | LL | get_dyn_trait().try_into().unwrap() - | ^^^^^^^^^^^^^^^ help: disambiguate the method call: `(&*get_dyn_trait())` + | ^^^^^^^^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! = note: for more information, see @@ -11,6 +11,10 @@ note: the lint level is defined here | LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: disambiguate the method call + | +LL | (&*get_dyn_trait()).try_into().unwrap() + | ~~~~~~~~~~~~~~~~~~~ warning: 1 warning emitted diff --git a/tests/ui/rust-2024/box-slice-into-iter-ambiguous.stderr b/tests/ui/rust-2024/box-slice-into-iter-ambiguous.stderr index 9cc79a7b12947..19a86456421cf 100644 --- a/tests/ui/rust-2024/box-slice-into-iter-ambiguous.stderr +++ b/tests/ui/rust-2024/box-slice-into-iter-ambiguous.stderr @@ -2,7 +2,7 @@ warning: trait method `into_iter` will become ambiguous in Rust 2024 --> $DIR/box-slice-into-iter-ambiguous.rs:24:13 | LL | let y = points.into_iter(); - | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `MyIntoIter::into_iter(points)` + | ^^^^^^^^^^^^^^^^^^ | = warning: this changes meaning in Rust 2024 note: the lint level is defined here @@ -10,6 +10,10 @@ note: the lint level is defined here | LL | #![warn(boxed_slice_into_iter)] | ^^^^^^^^^^^^^^^^^^^^^ +help: disambiguate the associated function + | +LL | let y = MyIntoIter::into_iter(points); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning: 1 warning emitted diff --git a/tests/ui/self/arbitrary-self-types-not-object-safe.curr.stderr b/tests/ui/self/arbitrary-self-types-not-object-safe.curr.stderr index fdd18c6b37b5c..003ba9615d779 100644 --- a/tests/ui/self/arbitrary-self-types-not-object-safe.curr.stderr +++ b/tests/ui/self/arbitrary-self-types-not-object-safe.curr.stderr @@ -1,9 +1,6 @@ error[E0038]: the trait `Foo` cannot be made into an object --> $DIR/arbitrary-self-types-not-object-safe.rs:33:32 | -LL | fn foo(self: &Rc) -> usize; - | --------- help: consider changing method `foo`'s `self` parameter to be `&self`: `&Self` -... LL | let x = Rc::new(5usize) as Rc; | ^^^^^^^^^^^ `Foo` cannot be made into an object | @@ -15,13 +12,14 @@ LL | trait Foo { LL | fn foo(self: &Rc) -> usize; | ^^^^^^^^^ ...because method `foo`'s `self` parameter cannot be dispatched on = help: only type `usize` implements the trait, consider using it directly instead +help: consider changing method `foo`'s `self` parameter to be `&self` + | +LL | fn foo(self: &Self) -> usize; + | ~~~~~ error[E0038]: the trait `Foo` cannot be made into an object --> $DIR/arbitrary-self-types-not-object-safe.rs:33:13 | -LL | fn foo(self: &Rc) -> usize; - | --------- help: consider changing method `foo`'s `self` parameter to be `&self`: `&Self` -... LL | let x = Rc::new(5usize) as Rc; | ^^^^^^^^^^^^^^^ `Foo` cannot be made into an object | @@ -34,6 +32,10 @@ LL | fn foo(self: &Rc) -> usize; | ^^^^^^^^^ ...because method `foo`'s `self` parameter cannot be dispatched on = help: only type `usize` implements the trait, consider using it directly instead = note: required for the cast from `Rc` to `Rc` +help: consider changing method `foo`'s `self` parameter to be `&self` + | +LL | fn foo(self: &Self) -> usize; + | ~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr b/tests/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr index 363ba072c8169..d88271e0d1373 100644 --- a/tests/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr +++ b/tests/ui/self/arbitrary-self-types-not-object-safe.object_safe_for_dispatch.stderr @@ -1,9 +1,6 @@ error[E0038]: the trait `Foo` cannot be made into an object --> $DIR/arbitrary-self-types-not-object-safe.rs:33:13 | -LL | fn foo(self: &Rc) -> usize; - | --------- help: consider changing method `foo`'s `self` parameter to be `&self`: `&Self` -... LL | let x = Rc::new(5usize) as Rc; | ^^^^^^^^^^^^^^^ `Foo` cannot be made into an object | @@ -16,6 +13,10 @@ LL | fn foo(self: &Rc) -> usize; | ^^^^^^^^^ ...because method `foo`'s `self` parameter cannot be dispatched on = help: only type `usize` implements the trait, consider using it directly instead = note: required for the cast from `Rc` to `Rc` +help: consider changing method `foo`'s `self` parameter to be `&self` + | +LL | fn foo(self: &Self) -> usize; + | ~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/self/suggest-self-2.stderr b/tests/ui/self/suggest-self-2.stderr index 4bd025ea07630..80c29563ec73d 100644 --- a/tests/ui/self/suggest-self-2.stderr +++ b/tests/ui/self/suggest-self-2.stderr @@ -2,25 +2,34 @@ error[E0425]: cannot find function `bar` in this scope --> $DIR/suggest-self-2.rs:5:9 | LL | bar(self); - | ^^^------ - | | - | help: try calling `bar` as a method: `self.bar()` + | ^^^ + | +help: try calling `bar` as a method + | +LL | self.bar(); + | ~~~~~~~~~~ error[E0425]: cannot find function `bar` in this scope --> $DIR/suggest-self-2.rs:9:9 | LL | bar(&&self, 102); - | ^^^------------- - | | - | help: try calling `bar` as a method: `self.bar(102)` + | ^^^ + | +help: try calling `bar` as a method + | +LL | self.bar(102); + | ~~~~~~~~~~~~~ error[E0425]: cannot find function `bar` in this scope --> $DIR/suggest-self-2.rs:13:9 | LL | bar(&mut self, 102, &"str"); - | ^^^------------------------ - | | - | help: try calling `bar` as a method: `self.bar(102, &"str")` + | ^^^ + | +help: try calling `bar` as a method + | +LL | self.bar(102, &"str"); + | ~~~~~~~~~~~~~~~~~~~~~ error[E0425]: cannot find function `bar` in this scope --> $DIR/suggest-self-2.rs:17:9 diff --git a/tests/ui/seq-args.stderr b/tests/ui/seq-args.stderr index a5b0f8e98dca0..bb46a11d90262 100644 --- a/tests/ui/seq-args.stderr +++ b/tests/ui/seq-args.stderr @@ -2,29 +2,35 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/seq-args.rs:4:13 | LL | impl Seq for Vec { - | ^^^--- help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/seq-args.rs:2:11 | LL | trait Seq { } | ^^^ +help: remove these generics + | +LL - impl Seq for Vec { +LL + impl Seq for Vec { + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/seq-args.rs:9:10 | LL | impl Seq for u32 { - | ^^^------ help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/seq-args.rs:2:11 | LL | trait Seq { } | ^^^ +help: remove these generics + | +LL - impl Seq for u32 { +LL + impl Seq for u32 { + | error: aborting due to 2 previous errors diff --git a/tests/ui/span/issue-24690.stderr b/tests/ui/span/issue-24690.stderr index 73e166e6403e4..ddd6f235fb62d 100644 --- a/tests/ui/span/issue-24690.stderr +++ b/tests/ui/span/issue-24690.stderr @@ -15,15 +15,24 @@ warning: variable `theTwo` should have a snake case name --> $DIR/issue-24690.rs:12:9 | LL | let theTwo = 2; - | ^^^^^^ help: convert the identifier to snake case: `the_two` + | ^^^^^^ | = note: `#[warn(non_snake_case)]` on by default +help: convert the identifier to snake case + | +LL | let the_two = 2; + | ~~~~~~~ warning: variable `theOtherTwo` should have a snake case name --> $DIR/issue-24690.rs:13:9 | LL | let theOtherTwo = 2; - | ^^^^^^^^^^^ help: convert the identifier to snake case: `the_other_two` + | ^^^^^^^^^^^ + | +help: convert the identifier to snake case + | +LL | let the_other_two = 2; + | ~~~~~~~~~~~~~ warning: 3 warnings emitted diff --git a/tests/ui/span/suggestion-non-ascii.stderr b/tests/ui/span/suggestion-non-ascii.stderr index 6e6e31a5698b8..deccf6f2fff50 100644 --- a/tests/ui/span/suggestion-non-ascii.stderr +++ b/tests/ui/span/suggestion-non-ascii.stderr @@ -2,7 +2,12 @@ error[E0608]: cannot index into a value of type `({integer},)` --> $DIR/suggestion-non-ascii.rs:3:24 | LL | println!("☃{}", tup[0]); - | ^^^ help: to access tuple elements, use: `.0` + | ^^^ + | +help: to access tuple elements, use + | +LL | println!("☃{}", tup.0); + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/span/suggestion-raw-68962.stderr b/tests/ui/span/suggestion-raw-68962.stderr index 2e25f5cbdf58d..220ddc1fe1f55 100644 --- a/tests/ui/span/suggestion-raw-68962.stderr +++ b/tests/ui/span/suggestion-raw-68962.stderr @@ -2,7 +2,12 @@ error[E0425]: cannot find value `fina` in this scope --> $DIR/suggestion-raw-68962.rs:7:5 | LL | fina; - | ^^^^ help: a local variable with a similar name exists: `r#final` + | ^^^^ + | +help: a local variable with a similar name exists + | +LL | r#final; + | ~~~~~~~ error[E0425]: cannot find function `f` in this scope --> $DIR/suggestion-raw-68962.rs:10:5 @@ -11,7 +16,12 @@ LL | fn r#fn() {} | --------- similarly named function `r#fn` defined here ... LL | f(); - | ^ help: a function with a similar name exists: `r#fn` + | ^ + | +help: a function with a similar name exists + | +LL | r#fn(); + | ~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/span/typo-suggestion.stderr b/tests/ui/span/typo-suggestion.stderr index 61d4e06119c4f..107bfb7fb8968 100644 --- a/tests/ui/span/typo-suggestion.stderr +++ b/tests/ui/span/typo-suggestion.stderr @@ -8,7 +8,12 @@ error[E0425]: cannot find value `fob` in this scope --> $DIR/typo-suggestion.rs:8:26 | LL | println!("Hello {}", fob); - | ^^^ help: a local variable with a similar name exists: `foo` + | ^^^ + | +help: a local variable with a similar name exists + | +LL | println!("Hello {}", foo); + | ~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/specialization/specialization-default-projection.stderr b/tests/ui/specialization/specialization-default-projection.stderr index b8b81876d8131..38ef943ca78a6 100644 --- a/tests/ui/specialization/specialization-default-projection.stderr +++ b/tests/ui/specialization/specialization-default-projection.stderr @@ -29,14 +29,16 @@ LL | fn monomorphic() -> () { | -- expected `()` because of return type ... LL | generic::<()>() - | ^^^^^^^^^^^^^^^- help: consider using a semicolon here: `;` - | | - | expected `()`, found associated type + | ^^^^^^^^^^^^^^^ expected `()`, found associated type | = note: expected unit type `()` found associated type `<() as Foo>::Assoc` = help: consider constraining the associated type `<() as Foo>::Assoc` to `()` = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html +help: consider using a semicolon here + | +LL | generic::<()>(); + | + error: aborting due to 2 previous errors; 1 warning emitted diff --git a/tests/ui/stability-attribute/issue-109177.stderr b/tests/ui/stability-attribute/issue-109177.stderr index 9c2ac591ace05..dab96a1ccb48a 100644 --- a/tests/ui/stability-attribute/issue-109177.stderr +++ b/tests/ui/stability-attribute/issue-109177.stderr @@ -2,12 +2,17 @@ error[E0425]: cannot find function `foo1` in crate `similar_unstable_method` --> $DIR/issue-109177.rs:7:30 | LL | similar_unstable_method::foo1(); - | ^^^^ help: a function with a similar name exists: `foo` + | ^^^^ | ::: $DIR/auxiliary/similar-unstable-method.rs:5:1 | LL | pub fn foo() {} | ------------ similarly named function `foo` defined here + | +help: a function with a similar name exists + | +LL | similar_unstable_method::foo(); + | ~~~ error[E0599]: no method named `foo1` found for struct `Foo` in the current scope --> $DIR/issue-109177.rs:11:9 diff --git a/tests/ui/stability-attribute/suggest-vec-allocator-api.stderr b/tests/ui/stability-attribute/suggest-vec-allocator-api.stderr index d7fcba4ced55d..11362ba518ed7 100644 --- a/tests/ui/stability-attribute/suggest-vec-allocator-api.stderr +++ b/tests/ui/stability-attribute/suggest-vec-allocator-api.stderr @@ -2,13 +2,15 @@ error[E0658]: use of unstable library feature 'allocator_api' --> $DIR/suggest-vec-allocator-api.rs:2:20 | LL | let _: Vec = vec![]; - | ----^ - | | - | help: consider wrapping the inner types in tuple: `(u8, _)` + | ^ | = note: see issue #32838 for more information = help: add `#![feature(allocator_api)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: consider wrapping the inner types in tuple + | +LL | let _: Vec<(u8, _)> = vec![]; + | ~~~~~~~ error[E0658]: use of unstable library feature 'allocator_api' --> $DIR/suggest-vec-allocator-api.rs:6:9 @@ -40,13 +42,15 @@ error[E0658]: use of unstable library feature 'allocator_api' --> $DIR/suggest-vec-allocator-api.rs:7:24 | LL | let _ = Vec::::new(); - | -----^ - | | - | help: consider wrapping the inner types in tuple: `(u16, _)` + | ^ | = note: see issue #32838 for more information = help: add `#![feature(allocator_api)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: consider wrapping the inner types in tuple + | +LL | let _ = Vec::<(u16, _)>::new(); + | ~~~~~~~~ error: aborting due to 4 previous errors diff --git a/tests/ui/structs/struct-fields-shorthand-unresolved.stderr b/tests/ui/structs/struct-fields-shorthand-unresolved.stderr index b485c17c1b270..d20574e1d827e 100644 --- a/tests/ui/structs/struct-fields-shorthand-unresolved.stderr +++ b/tests/ui/structs/struct-fields-shorthand-unresolved.stderr @@ -2,7 +2,12 @@ error[E0425]: cannot find value `y` in this scope --> $DIR/struct-fields-shorthand-unresolved.rs:10:9 | LL | y - | ^ help: a local variable with a similar name exists: `x` + | ^ + | +help: a local variable with a similar name exists + | +LL | x + | ~ error: aborting due to 1 previous error diff --git a/tests/ui/structs/struct-missing-comma.stderr b/tests/ui/structs/struct-missing-comma.stderr index 4fdd47a480651..4f5c2a53cbab1 100644 --- a/tests/ui/structs/struct-missing-comma.stderr +++ b/tests/ui/structs/struct-missing-comma.stderr @@ -2,7 +2,12 @@ error: expected `,`, or `}`, found keyword `pub` --> $DIR/struct-missing-comma.rs:5:17 | LL | pub foo: u32 - | ^ help: try adding a comma: `,` + | ^ + | +help: try adding a comma + | +LL | pub foo: u32, + | + error: aborting due to 1 previous error diff --git a/tests/ui/structs/struct-path-associated-type.stderr b/tests/ui/structs/struct-path-associated-type.stderr index 0c9d2aad5d827..edcb0bcc8332a 100644 --- a/tests/ui/structs/struct-path-associated-type.stderr +++ b/tests/ui/structs/struct-path-associated-type.stderr @@ -8,15 +8,18 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/struct-path-associated-type.rs:14:16 | LL | let z = T::A:: {}; - | ^------ help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/struct-path-associated-type.rs:4:10 | LL | type A; | ^ +help: remove these generics + | +LL - let z = T::A:: {}; +LL + let z = T::A {}; + | error[E0071]: expected struct, variant or union type, found associated type --> $DIR/struct-path-associated-type.rs:14:13 @@ -34,15 +37,18 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/struct-path-associated-type.rs:25:16 | LL | let z = T::A:: {}; - | ^------ help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/struct-path-associated-type.rs:4:10 | LL | type A; | ^ +help: remove these generics + | +LL - let z = T::A:: {}; +LL + let z = T::A {}; + | error[E0223]: ambiguous associated type --> $DIR/struct-path-associated-type.rs:32:13 diff --git a/tests/ui/structs/structure-constructor-type-mismatch.stderr b/tests/ui/structs/structure-constructor-type-mismatch.stderr index 63dda459396b8..cb77a66312f29 100644 --- a/tests/ui/structs/structure-constructor-type-mismatch.stderr +++ b/tests/ui/structs/structure-constructor-type-mismatch.stderr @@ -2,101 +2,123 @@ error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:17:12 | LL | x: 1, - | ^ - | | - | expected `f32`, found integer - | help: use a float literal: `1.0` + | ^ expected `f32`, found integer + | +help: use a float literal + | +LL | x: 1.0, + | ~~~ error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:20:12 | LL | y: 2, - | ^ - | | - | expected `f32`, found integer - | help: use a float literal: `2.0` + | ^ expected `f32`, found integer + | +help: use a float literal + | +LL | y: 2.0, + | ~~~ error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:26:12 | LL | x: 3, - | ^ - | | - | expected `f32`, found integer - | help: use a float literal: `3.0` + | ^ expected `f32`, found integer + | +help: use a float literal + | +LL | x: 3.0, + | ~~~ error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:29:12 | LL | y: 4, - | ^ - | | - | expected `f32`, found integer - | help: use a float literal: `4.0` + | ^ expected `f32`, found integer + | +help: use a float literal + | +LL | y: 4.0, + | ~~~ error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:35:12 | LL | x: 5, - | ^ - | | - | expected `f32`, found integer - | help: use a float literal: `5.0` + | ^ expected `f32`, found integer + | +help: use a float literal + | +LL | x: 5.0, + | ~~~ error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:42:12 | LL | x: 7, - | ^ - | | - | expected `f32`, found integer - | help: use a float literal: `7.0` + | ^ expected `f32`, found integer + | +help: use a float literal + | +LL | x: 7.0, + | ~~~ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied --> $DIR/structure-constructor-type-mismatch.rs:48:15 | LL | let pt3 = PointF:: { - | ^^^^^^------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^ expected 0 generic arguments | note: type alias defined here, with 0 generic parameters --> $DIR/structure-constructor-type-mismatch.rs:6:6 | LL | type PointF = Point; | ^^^^^^ +help: remove these generics + | +LL - let pt3 = PointF:: { +LL + let pt3 = PointF { + | error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:49:12 | LL | x: 9, - | ^ - | | - | expected `f32`, found integer - | help: use a float literal: `9.0` + | ^ expected `f32`, found integer + | +help: use a float literal + | +LL | x: 9.0, + | ~~~ error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:50:12 | LL | y: 10, - | ^^ - | | - | expected `f32`, found integer - | help: use a float literal: `10.0` + | ^^ expected `f32`, found integer + | +help: use a float literal + | +LL | y: 10.0, + | ~~~~ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied --> $DIR/structure-constructor-type-mismatch.rs:54:9 | LL | PointF:: { .. } => {} - | ^^^^^^------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^ expected 0 generic arguments | note: type alias defined here, with 0 generic parameters --> $DIR/structure-constructor-type-mismatch.rs:6:6 | LL | type PointF = Point; | ^^^^^^ +help: remove these generics + | +LL - PointF:: { .. } => {} +LL + PointF { .. } => {} + | error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:54:9 diff --git a/tests/ui/suggestions/assoc-const-as-field.stderr b/tests/ui/suggestions/assoc-const-as-field.stderr index 0f58ce65049e9..6c095e52ac9e5 100644 --- a/tests/ui/suggestions/assoc-const-as-field.stderr +++ b/tests/ui/suggestions/assoc-const-as-field.stderr @@ -2,7 +2,12 @@ error[E0423]: expected value, found struct `Mod::Foo` --> $DIR/assoc-const-as-field.rs:11:9 | LL | foo(Mod::Foo.Bar); - | ^^^^^^^^- help: use the path separator to refer to an item: `::` + | ^^^^^^^^ + | +help: use the path separator to refer to an item + | +LL | foo(Mod::Foo::Bar); + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/attribute-typos.stderr b/tests/ui/suggestions/attribute-typos.stderr index b871c9b45a56c..acd6cbb0fb870 100644 --- a/tests/ui/suggestions/attribute-typos.stderr +++ b/tests/ui/suggestions/attribute-typos.stderr @@ -8,22 +8,37 @@ error: cannot find attribute `rustc_err` in this scope --> $DIR/attribute-typos.rs:7:3 | LL | #[rustc_err] - | ^^^^^^^^^ help: a built-in attribute with a similar name exists: `rustc_error` + | ^^^^^^^^^ + | +help: a built-in attribute with a similar name exists + | +LL | #[rustc_error] + | ~~~~~~~~~~~ error: cannot find attribute `tests` in this scope --> $DIR/attribute-typos.rs:4:3 | LL | #[tests] - | ^^^^^ help: an attribute macro with a similar name exists: `test` + | ^^^^^ --> $SRC_DIR/core/src/macros/mod.rs:LL:COL | = note: similarly named attribute macro `test` defined here + | +help: an attribute macro with a similar name exists + | +LL | #[test] + | ~~~~ error: cannot find attribute `deprcated` in this scope --> $DIR/attribute-typos.rs:1:3 | LL | #[deprcated] - | ^^^^^^^^^ help: a built-in attribute with a similar name exists: `deprecated` + | ^^^^^^^^^ + | +help: a built-in attribute with a similar name exists + | +LL | #[deprecated] + | ~~~~~~~~~~ error: aborting due to 4 previous errors diff --git a/tests/ui/suggestions/const-no-type.stderr b/tests/ui/suggestions/const-no-type.stderr index bd703992fd4a6..a0f91ef30a495 100644 --- a/tests/ui/suggestions/const-no-type.stderr +++ b/tests/ui/suggestions/const-no-type.stderr @@ -2,25 +2,45 @@ error: missing type for `const` item --> $DIR/const-no-type.rs:33:8 | LL | const C = 42; - | ^ help: provide a type for the constant: `: i32` + | ^ + | +help: provide a type for the constant + | +LL | const C: i32 = 42; + | +++++ error: missing type for `const` item --> $DIR/const-no-type.rs:38:8 | LL | const D = &&42; - | ^ help: provide a type for the constant: `: &&i32` + | ^ + | +help: provide a type for the constant + | +LL | const D: &&i32 = &&42; + | +++++++ error: missing type for `static` item --> $DIR/const-no-type.rs:43:9 | LL | static S = Vec::::new(); - | ^ help: provide a type for the static variable: `: Vec` + | ^ + | +help: provide a type for the static variable + | +LL | static S: Vec = Vec::::new(); + | +++++++++++++ error: missing type for `static mut` item --> $DIR/const-no-type.rs:48:14 | LL | static mut SM = "abc"; - | ^ help: provide a type for the static variable: `: &str` + | ^ + | +help: provide a type for the static variable + | +LL | static mut SM: &str = "abc"; + | ++++++ error: missing type for `const` item --> $DIR/const-no-type.rs:14:9 diff --git a/tests/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr b/tests/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr index 0cd6267b3b313..5fde8146ef16d 100644 --- a/tests/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr +++ b/tests/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr @@ -2,10 +2,15 @@ error[E0573]: expected type, found module `result` --> $DIR/do-not-attempt-to-add-suggestions-with-no-changes.rs:2:6 | LL | impl result { - | ^^^^^^ help: an enum with a similar name exists: `Result` + | ^^^^^^ --> $SRC_DIR/core/src/result.rs:LL:COL | = note: similarly named enum `Result` defined here + | +help: an enum with a similar name exists + | +LL | impl Result { + | ~~~~~~ error[E0573]: expected type, found variant `Err` --> $DIR/do-not-attempt-to-add-suggestions-with-no-changes.rs:3:25 diff --git a/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr index 60ab392f55de8..838cd305cd019 100644 --- a/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr +++ b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr @@ -35,12 +35,15 @@ LL | Pin::new(x) | -------- ^ expected `Box + Send>`, found type parameter `F` | | | arguments to this function are incorrect - | help: use `Box::pin` to pin and box this expression: `Box::pin` | = note: expected struct `Box + Send>` found type parameter `F` note: associated function defined here --> $SRC_DIR/core/src/pin.rs:LL:COL +help: use `Box::pin` to pin and box this expression + | +LL | Box::pin(x) + | ~~~~~~~~ error[E0277]: `dyn Future + Send` cannot be unpinned --> $DIR/expected-boxed-future-isnt-pinned.rs:19:14 diff --git a/tests/ui/suggestions/fn-trait-notation.stderr b/tests/ui/suggestions/fn-trait-notation.stderr index 9b47c8c02a782..9e539f517d3fb 100644 --- a/tests/ui/suggestions/fn-trait-notation.stderr +++ b/tests/ui/suggestions/fn-trait-notation.stderr @@ -2,31 +2,43 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje --> $DIR/fn-trait-notation.rs:4:8 | LL | F: Fn, - | ^^^^^^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn(i32) -> i32` + | ^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #29625 for more information = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: use parenthetical notation instead + | +LL | F: Fn(i32) -> i32, + | ~~~~~~~~~~~~~~ error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change --> $DIR/fn-trait-notation.rs:6:8 | LL | G: Fn<(i32, i32, ), Output = (i32, i32)>, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn(i32, i32) -> (i32, i32)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #29625 for more information = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: use parenthetical notation instead + | +LL | G: Fn(i32, i32) -> (i32, i32), + | ~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change --> $DIR/fn-trait-notation.rs:7:8 | LL | H: Fn<(i32,), Output = i32>, - | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn(i32) -> i32` + | ^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #29625 for more information = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: use parenthetical notation instead + | +LL | H: Fn(i32) -> i32, + | ~~~~~~~~~~~~~~ error[E0059]: type parameter to bare `Fn` trait must be a tuple --> $DIR/fn-trait-notation.rs:4:8 diff --git a/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr b/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr index e74c2c4214fe2..32400a70ea089 100644 --- a/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr +++ b/tests/ui/suggestions/impl-trait-return-trailing-semicolon.stderr @@ -5,9 +5,13 @@ LL | fn foo() -> impl Bar { | ^^^^^^^^ the trait `Bar` is not implemented for `()` LL | LL | 5; - | -- help: remove this semicolon - | | - | this expression has type `{integer}`, which implements `Bar` + | - this expression has type `{integer}`, which implements `Bar` + | +help: remove this semicolon + | +LL - 5; +LL + 5 + | error[E0277]: the trait bound `(): Bar` is not satisfied --> $DIR/impl-trait-return-trailing-semicolon.rs:15:13 diff --git a/tests/ui/suggestions/issue-101421.stderr b/tests/ui/suggestions/issue-101421.stderr index ececba5fb1baa..1a64f5313cf53 100644 --- a/tests/ui/suggestions/issue-101421.stderr +++ b/tests/ui/suggestions/issue-101421.stderr @@ -2,15 +2,18 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-101421.rs:10:8 | LL | ().f::<()>(()); - | ^------ help: remove these generics - | | - | expected 0 generic arguments + | ^ expected 0 generic arguments | note: method defined here, with 0 generic parameters --> $DIR/issue-101421.rs:2:8 | LL | fn f(&self, _: ()); | ^ +help: remove these generics + | +LL - ().f::<()>(()); +LL + ().f(()); + | error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/issue-102354.stderr b/tests/ui/suggestions/issue-102354.stderr index 8340d9340f9b2..9ca3bf3e7728d 100644 --- a/tests/ui/suggestions/issue-102354.stderr +++ b/tests/ui/suggestions/issue-102354.stderr @@ -2,10 +2,7 @@ error[E0599]: no method named `func` found for type `i32` in the current scope --> $DIR/issue-102354.rs:9:7 | LL | x.func(); - | --^^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `i32::func()` + | ^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in the trait `Trait` @@ -13,6 +10,10 @@ note: the candidate is defined in the trait `Trait` | LL | fn func() {} | ^^^^^^^^^ +help: use associated function syntax instead + | +LL | i32::func(); + | ~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/issue-103646.stderr b/tests/ui/suggestions/issue-103646.stderr index 8d0e8652392d6..c6c54fd589c12 100644 --- a/tests/ui/suggestions/issue-103646.stderr +++ b/tests/ui/suggestions/issue-103646.stderr @@ -4,10 +4,7 @@ error[E0599]: no method named `nya` found for type parameter `T` in the current LL | fn uwu(c: T) { | - method `nya` not found for this type parameter LL | c.nya(); - | --^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `T::nya()` + | ^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in the trait `Cat` @@ -15,6 +12,10 @@ note: the candidate is defined in the trait `Cat` | LL | fn nya() {} | ^^^^^^^^ +help: use associated function syntax instead + | +LL | T::nya(); + | ~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/issue-104287.stderr b/tests/ui/suggestions/issue-104287.stderr index ed59b2e7a2d3b..b65d3ad4d318a 100644 --- a/tests/ui/suggestions/issue-104287.stderr +++ b/tests/ui/suggestions/issue-104287.stderr @@ -2,15 +2,18 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-104287.rs:10:5 | LL | foo::<()>(x); - | ^^^------ help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: method defined here, with 0 generic parameters --> $DIR/issue-104287.rs:6:8 | LL | fn foo(&self) {} | ^^^ +help: remove these generics + | +LL - foo::<()>(x); +LL + foo(x); + | error[E0425]: cannot find function `foo` in this scope --> $DIR/issue-104287.rs:10:5 diff --git a/tests/ui/suggestions/issue-105226.stderr b/tests/ui/suggestions/issue-105226.stderr index f16a809010390..541608414e871 100644 --- a/tests/ui/suggestions/issue-105226.stderr +++ b/tests/ui/suggestions/issue-105226.stderr @@ -4,12 +4,16 @@ error: non-item in item list LL | impl S { | - item list starts here LL | fn hello

(&self, val: &P) where P: fmt::Display; { - | - ^ non-item starts here - | | - | help: consider removing this semicolon + | ^ non-item starts here ... LL | } | - item list ends here + | +help: consider removing this semicolon + | +LL - fn hello

(&self, val: &P) where P: fmt::Display; { +LL + fn hello

(&self, val: &P) where P: fmt::Display { + | error: associated function in `impl` without body --> $DIR/issue-105226.rs:7:5 diff --git a/tests/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.stderr b/tests/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.stderr index 3c3bc2305e079..bf7fd85d53304 100644 --- a/tests/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.stderr +++ b/tests/ui/suggestions/issue-51055-missing-semicolon-between-call-and-tuple.stderr @@ -5,11 +5,14 @@ LL | fn vindictive() -> bool { true } | ----------------------- `vindictive` defined here returns `bool` ... LL | vindictive() - | -^^^^^^^^^^^- help: consider using a semicolon here to finish the statement: `;` - | _____| - | | + | _____-^^^^^^^^^^^ LL | | (1, 2) | |__________- call expression requires function + | +help: consider using a semicolon here to finish the statement + | +LL | vindictive(); + | + error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/issue-61226.stderr b/tests/ui/suggestions/issue-61226.stderr index 890950b1ae9db..cd541b7bc98d3 100644 --- a/tests/ui/suggestions/issue-61226.stderr +++ b/tests/ui/suggestions/issue-61226.stderr @@ -5,7 +5,12 @@ LL | struct X {} | ----------- `X` defined here LL | fn main() { LL | let _ = vec![X]; //… - | ^ help: use struct literal syntax instead: `X {}` + | ^ + | +help: use struct literal syntax instead + | +LL | let _ = vec![X {}]; //… + | ~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/issue-66968-suggest-sorted-words.stderr b/tests/ui/suggestions/issue-66968-suggest-sorted-words.stderr index ce0087fbfcbab..503893f07fc01 100644 --- a/tests/ui/suggestions/issue-66968-suggest-sorted-words.stderr +++ b/tests/ui/suggestions/issue-66968-suggest-sorted-words.stderr @@ -2,7 +2,12 @@ error[E0425]: cannot find value `a_variable_longer_name` in this scope --> $DIR/issue-66968-suggest-sorted-words.rs:3:20 | LL | println!("{}", a_variable_longer_name); - | ^^^^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `a_longer_variable_name` + | ^^^^^^^^^^^^^^^^^^^^^^ + | +help: a local variable with a similar name exists + | +LL | println!("{}", a_longer_variable_name); + | ~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/issue-81098.stderr b/tests/ui/suggestions/issue-81098.stderr index 4dc47a2028243..c9bface2a7ccd 100644 --- a/tests/ui/suggestions/issue-81098.stderr +++ b/tests/ui/suggestions/issue-81098.stderr @@ -13,12 +13,15 @@ error[E0277]: `()` doesn't implement `std::fmt::Display` LL | fn ok() -> impl core::fmt::Display { | ^^^^^^^^^^^^^^^^^^^^^^^ `()` cannot be formatted with the default formatter LL | 1; - | -- help: remove this semicolon - | | - | this expression has type `{integer}`, which implements `std::fmt::Display` + | - this expression has type `{integer}`, which implements `std::fmt::Display` | = help: the trait `std::fmt::Display` is not implemented for `()` = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead +help: remove this semicolon + | +LL - 1; +LL + 1 + | error: aborting due to 2 previous errors diff --git a/tests/ui/suggestions/issue-83892.stderr b/tests/ui/suggestions/issue-83892.stderr index 7dbffcfca4ede..0a17349f436dc 100644 --- a/tests/ui/suggestions/issue-83892.stderr +++ b/tests/ui/suggestions/issue-83892.stderr @@ -6,8 +6,11 @@ LL | fn main() { LL | match () { LL | () => func() | ^^^^^^ expected `()`, found `u8` -LL | } - | - help: consider using a semicolon here: `;` + | +help: consider using a semicolon here + | +LL | }; + | + error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/issue-84700.stderr b/tests/ui/suggestions/issue-84700.stderr index ac9f5ab0b0cbb..a818c231b8a7d 100644 --- a/tests/ui/suggestions/issue-84700.stderr +++ b/tests/ui/suggestions/issue-84700.stderr @@ -5,7 +5,12 @@ LL | Cow, | --- `FarmAnimal::Cow` defined here ... LL | FarmAnimal::Cow(_) => "moo".to_string(), - | ^^^^^^^^^^^^^^^^^^ help: use this syntax instead: `FarmAnimal::Cow` + | ^^^^^^^^^^^^^^^^^^ + | +help: use this syntax instead + | +LL | FarmAnimal::Cow => "moo".to_string(), + | ~~~~~~~~~~~~~~~ error[E0164]: expected tuple struct or tuple variant, found struct variant `FarmAnimal::Chicken` --> $DIR/issue-84700.rs:17:9 diff --git a/tests/ui/suggestions/issue-89064.stderr b/tests/ui/suggestions/issue-89064.stderr index be09dd8951208..f1bb3c2adc74f 100644 --- a/tests/ui/suggestions/issue-89064.stderr +++ b/tests/ui/suggestions/issue-89064.stderr @@ -46,15 +46,18 @@ error[E0107]: associated function takes 0 generic arguments but 1 generic argume --> $DIR/issue-89064.rs:27:21 | LL | let _ = A::::foo::(); - | ^^^----- help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: associated function defined here, with 0 generic parameters --> $DIR/issue-89064.rs:4:8 | LL | fn foo() {} | ^^^ +help: remove these generics + | +LL - let _ = A::::foo::(); +LL + let _ = A::::foo(); + | error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied --> $DIR/issue-89064.rs:31:16 diff --git a/tests/ui/suggestions/match-ergonomics.stderr b/tests/ui/suggestions/match-ergonomics.stderr index a3e059e8ac646..1984790b12812 100644 --- a/tests/ui/suggestions/match-ergonomics.stderr +++ b/tests/ui/suggestions/match-ergonomics.stderr @@ -17,18 +17,24 @@ LL + [v] => {}, error[E0529]: expected an array or slice, found `Vec` --> $DIR/match-ergonomics.rs:8:9 | -LL | match x { - | - help: consider slicing here: `x[..]` LL | [&v] => {}, | ^^^^ pattern cannot match with input type `Vec` + | +help: consider slicing here + | +LL | match x[..] { + | ~~~~~ error[E0529]: expected an array or slice, found `Vec` --> $DIR/match-ergonomics.rs:20:9 | -LL | match x { - | - help: consider slicing here: `x[..]` LL | [v] => {}, | ^^^ pattern cannot match with input type `Vec` + | +help: consider slicing here + | +LL | match x[..] { + | ~~~~~ error[E0308]: mismatched types --> $DIR/match-ergonomics.rs:29:9 diff --git a/tests/ui/suggestions/missing-semicolon.stderr b/tests/ui/suggestions/missing-semicolon.stderr index 54a64f664b501..f5f3ae2983059 100644 --- a/tests/ui/suggestions/missing-semicolon.stderr +++ b/tests/ui/suggestions/missing-semicolon.stderr @@ -20,11 +20,14 @@ error[E0618]: expected function, found `{integer}` LL | let x = 5; | - `x` has type `{integer}` LL | let y = x - | ^- help: consider using a semicolon here to finish the statement: `;` - | _____________| - | | + | _____________^ LL | | () | |______- call expression requires function + | +help: consider using a semicolon here to finish the statement + | +LL | let y = x; + | + error[E0618]: expected function, found `{integer}` --> $DIR/missing-semicolon.rs:11:13 @@ -32,11 +35,14 @@ error[E0618]: expected function, found `{integer}` LL | let x = 5; | - `x` has type `{integer}` LL | let y = x - | ^- help: consider using a semicolon here to finish the statement: `;` - | _____________| - | | + | _____________^ LL | | (); | |______- call expression requires function + | +help: consider using a semicolon here to finish the statement + | +LL | let y = x; + | + error[E0618]: expected function, found `{integer}` --> $DIR/missing-semicolon.rs:16:5 @@ -44,31 +50,40 @@ error[E0618]: expected function, found `{integer}` LL | let x = 5; | - `x` has type `{integer}` LL | x - | ^- help: consider using a semicolon here to finish the statement: `;` - | _____| - | | + | _____^ LL | | () | |______- call expression requires function + | +help: consider using a semicolon here to finish the statement + | +LL | x; + | + error[E0618]: expected function, found `{integer}` --> $DIR/missing-semicolon.rs:31:13 | LL | let y = 5 - | ^- help: consider using a semicolon here to finish the statement: `;` - | _____________| - | | + | _____________^ LL | | () | |______- call expression requires function + | +help: consider using a semicolon here to finish the statement + | +LL | let y = 5; + | + error[E0618]: expected function, found `{integer}` --> $DIR/missing-semicolon.rs:35:5 | LL | 5 - | ^- help: consider using a semicolon here to finish the statement: `;` - | _____| - | | + | _____^ LL | | (); | |______- call expression requires function + | +help: consider using a semicolon here to finish the statement + | +LL | 5; + | + error: aborting due to 7 previous errors diff --git a/tests/ui/suggestions/object-unsafe-trait-should-use-self-2021-without-dyn.stderr b/tests/ui/suggestions/object-unsafe-trait-should-use-self-2021-without-dyn.stderr index 60eb72ab4f768..30e3d53059b5d 100644 --- a/tests/ui/suggestions/object-unsafe-trait-should-use-self-2021-without-dyn.stderr +++ b/tests/ui/suggestions/object-unsafe-trait-should-use-self-2021-without-dyn.stderr @@ -77,9 +77,7 @@ error[E0038]: the trait `C` cannot be made into an object --> $DIR/object-unsafe-trait-should-use-self-2021-without-dyn.rs:18:20 | LL | fn f(&self, c: C) -> C; - | ----- ^ `C` cannot be made into an object - | | - | help: consider changing method `f`'s `self` parameter to be `&self` (notice the capitalization): `&Self` + | ^ `C` cannot be made into an object | note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit --> $DIR/object-unsafe-trait-should-use-self-2021-without-dyn.rs:18:10 @@ -88,6 +86,10 @@ LL | trait C { | - this trait cannot be made into an object... LL | fn f(&self, c: C) -> C; | ^^^^^ ...because method `f`'s `self` parameter cannot be dispatched on +help: consider changing method `f`'s `self` parameter to be `&self` (notice the capitalization difference) + | +LL | fn f(&Self, c: C) -> C; + | ~~~~~ error[E0782]: trait objects must include the `dyn` keyword --> $DIR/object-unsafe-trait-should-use-self-2021-without-dyn.rs:4:13 diff --git a/tests/ui/suggestions/parenthesized-deref-suggestion.stderr b/tests/ui/suggestions/parenthesized-deref-suggestion.stderr index 9f185f5dd52b3..8de495a632af6 100644 --- a/tests/ui/suggestions/parenthesized-deref-suggestion.stderr +++ b/tests/ui/suggestions/parenthesized-deref-suggestion.stderr @@ -13,10 +13,12 @@ error[E0609]: no field `0` on type `[u32; 1]` --> $DIR/parenthesized-deref-suggestion.rs:10:21 | LL | (x as [u32; 1]).0; - | ----------------^ - | | | - | | unknown field - | help: instead of using tuple indexing, use array indexing: `(x as [u32; 1])[0]` + | ^ unknown field + | +help: instead of using tuple indexing, use array indexing + | +LL | (x as [u32; 1])[0]; + | ~~~~~~~~~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/suggestions/pattern-slice-vec.stderr b/tests/ui/suggestions/pattern-slice-vec.stderr index f69e7de971a96..aefc7a3441142 100644 --- a/tests/ui/suggestions/pattern-slice-vec.stderr +++ b/tests/ui/suggestions/pattern-slice-vec.stderr @@ -2,42 +2,56 @@ error[E0529]: expected an array or slice, found `Vec` --> $DIR/pattern-slice-vec.rs:8:12 | LL | if let [_, _, _] = foo() {} - | ^^^^^^^^^ ----- help: consider slicing here: `foo()[..]` - | | - | pattern cannot match with input type `Vec` + | ^^^^^^^^^ pattern cannot match with input type `Vec` + | +help: consider slicing here + | +LL | if let [_, _, _] = foo()[..] {} + | ~~~~~~~~~ error[E0529]: expected an array or slice, found `Vec` --> $DIR/pattern-slice-vec.rs:12:12 | LL | if let [] = &foo() {} - | ^^ ------ help: consider slicing here: `&foo()[..]` - | | - | pattern cannot match with input type `Vec` + | ^^ pattern cannot match with input type `Vec` + | +help: consider slicing here + | +LL | if let [] = &foo()[..] {} + | ~~~~~~~~~~ error[E0529]: expected an array or slice, found `Vec` --> $DIR/pattern-slice-vec.rs:16:12 | LL | if let [] = foo() {} - | ^^ ----- help: consider slicing here: `foo()[..]` - | | - | pattern cannot match with input type `Vec` + | ^^ pattern cannot match with input type `Vec` + | +help: consider slicing here + | +LL | if let [] = foo()[..] {} + | ~~~~~~~~~ error[E0529]: expected an array or slice, found `Vec<_>` --> $DIR/pattern-slice-vec.rs:23:9 | -LL | match &v { - | -- help: consider slicing here: `&v[..]` -LL | LL | [5] => {} | ^^^ pattern cannot match with input type `Vec<_>` + | +help: consider slicing here + | +LL | match &v[..] { + | ~~~~~~ error[E0529]: expected an array or slice, found `Vec<{integer}>` --> $DIR/pattern-slice-vec.rs:28:9 | LL | let [..] = vec![1, 2, 3]; - | ^^^^ ------------- help: consider slicing here: `vec![1, 2, 3][..]` - | | - | pattern cannot match with input type `Vec<{integer}>` + | ^^^^ pattern cannot match with input type `Vec<{integer}>` + | +help: consider slicing here + | +LL | let [..] = vec![1, 2, 3][..]; + | ~~~~~~~~~~~~~~~~~ error: aborting due to 5 previous errors diff --git a/tests/ui/suggestions/remove-as_str.stderr b/tests/ui/suggestions/remove-as_str.stderr index 534c497780a95..e7db19b94025c 100644 --- a/tests/ui/suggestions/remove-as_str.stderr +++ b/tests/ui/suggestions/remove-as_str.stderr @@ -2,25 +2,49 @@ error[E0599]: no method named `as_str` found for reference `&str` in the current --> $DIR/remove-as_str.rs:2:7 | LL | s.as_str(); - | -^^^^^^-- help: remove this method call + | ^^^^^^ + | +help: remove this method call + | +LL - s.as_str(); +LL + s; + | error[E0599]: no method named `as_str` found for reference `&'a str` in the current scope --> $DIR/remove-as_str.rs:7:7 | LL | s.as_str(); - | -^^^^^^-- help: remove this method call + | ^^^^^^ + | +help: remove this method call + | +LL - s.as_str(); +LL + s; + | error[E0599]: no method named `as_str` found for mutable reference `&mut str` in the current scope --> $DIR/remove-as_str.rs:12:7 | LL | s.as_str(); - | -^^^^^^-- help: remove this method call + | ^^^^^^ + | +help: remove this method call + | +LL - s.as_str(); +LL + s; + | error[E0599]: no method named `as_str` found for reference `&&str` in the current scope --> $DIR/remove-as_str.rs:17:7 | LL | s.as_str(); - | -^^^^^^-- help: remove this method call + | ^^^^^^ + | +help: remove this method call + | +LL - s.as_str(); +LL + s; + | error: aborting due to 4 previous errors diff --git a/tests/ui/suggestions/return-cycle-2.stderr b/tests/ui/suggestions/return-cycle-2.stderr index 23de2309e8778..98949c2801d2d 100644 --- a/tests/ui/suggestions/return-cycle-2.stderr +++ b/tests/ui/suggestions/return-cycle-2.stderr @@ -2,10 +2,12 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/return-cycle-2.rs:6:34 | LL | fn as_ref(_: i32, _: i32) -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `Token<&'static T>` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn as_ref(_: i32, _: i32) -> Token<&'static T> { + | ~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/return-cycle.stderr b/tests/ui/suggestions/return-cycle.stderr index 604704904410b..f088474c10411 100644 --- a/tests/ui/suggestions/return-cycle.stderr +++ b/tests/ui/suggestions/return-cycle.stderr @@ -2,10 +2,12 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/return-cycle.rs:6:17 | LL | fn new() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `Token<()>` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn new() -> Token<()> { + | ~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/struct-initializer-comma.stderr b/tests/ui/suggestions/struct-initializer-comma.stderr index 5eff43f32cda1..33df141fe037c 100644 --- a/tests/ui/suggestions/struct-initializer-comma.stderr +++ b/tests/ui/suggestions/struct-initializer-comma.stderr @@ -5,12 +5,14 @@ LL | let _ = Foo { | --- while parsing this struct LL | LL | first: true - | - - | | - | expected one of `,`, `.`, `?`, `}`, or an operator - | help: try adding a comma: `,` + | - expected one of `,`, `.`, `?`, `}`, or an operator LL | second: 25 | ^^^^^^ unexpected token + | +help: try adding a comma + | +LL | first: true, + | + error[E0063]: missing field `second` in initializer of `Foo` --> $DIR/struct-initializer-comma.rs:9:13 diff --git a/tests/ui/suggestions/suggest-assoc-fn-call-deref.stderr b/tests/ui/suggestions/suggest-assoc-fn-call-deref.stderr index a30b78692146b..4d8ca68d01294 100644 --- a/tests/ui/suggestions/suggest-assoc-fn-call-deref.stderr +++ b/tests/ui/suggestions/suggest-assoc-fn-call-deref.stderr @@ -2,10 +2,7 @@ error[E0599]: no method named `test` found for struct `Box>` in the cur --> $DIR/suggest-assoc-fn-call-deref.rs:13:7 | LL | x.test(); - | --^^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `Foo::::test()` + | ^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `Foo` @@ -13,6 +10,10 @@ note: the candidate is defined in an impl for the type `Foo` | LL | fn test() -> i32 { 1 } | ^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | Foo::::test(); + | ~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/suggest-assoc-fn-call-for-impl-trait.stderr b/tests/ui/suggestions/suggest-assoc-fn-call-for-impl-trait.stderr index 0df2b08d3be82..29d5ab3106988 100644 --- a/tests/ui/suggestions/suggest-assoc-fn-call-for-impl-trait.stderr +++ b/tests/ui/suggestions/suggest-assoc-fn-call-for-impl-trait.stderr @@ -5,10 +5,7 @@ LL | struct A { | -------- method `foo` not found for this struct ... LL | _a.foo(); - | ---^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `A::foo(_a)` + | ^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in the trait `M` @@ -16,6 +13,10 @@ note: the candidate is defined in the trait `M` | LL | fn foo(_a: Self); | ^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | A::foo(_a); + | ~~~~~~~~~~ error[E0599]: no method named `baz` found for struct `A` in the current scope --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:23:8 @@ -24,10 +25,7 @@ LL | struct A { | -------- method `baz` not found for this struct ... LL | _a.baz(0); - | ---^^^--- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `A::baz(0)` + | ^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in the trait `M` @@ -35,6 +33,10 @@ note: the candidate is defined in the trait `M` | LL | fn baz(_a: i32); | ^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | A::baz(0); + | ~~~~~~~~~ error[E0599]: no method named `bar` found for struct `A` in the current scope --> $DIR/suggest-assoc-fn-call-for-impl-trait.rs:27:8 @@ -43,10 +45,7 @@ LL | struct A { | -------- method `bar` not found for this struct ... LL | _b.bar(); - | ---^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `A::bar(_b)` + | ^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in the trait `M` @@ -54,6 +53,10 @@ note: the candidate is defined in the trait `M` | LL | fn bar(_a: Self); | ^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | A::bar(_b); + | ~~~~~~~~~~ error: aborting due to 3 previous errors diff --git a/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.stderr b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.stderr index 6e4c77deac50f..5d89283cd6d18 100644 --- a/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.stderr +++ b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-placeholder.stderr @@ -5,10 +5,7 @@ LL | struct GenericAssocMethod(T); | ---------------------------- method `default_hello` not found for this struct ... LL | x.default_hello(); - | --^^^^^^^^^^^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `GenericAssocMethod::<_>::default_hello()` + | ^^^^^^^^^^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `GenericAssocMethod` @@ -16,6 +13,10 @@ note: the candidate is defined in an impl for the type `GenericAssocMethod` | LL | fn default_hello() {} | ^^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | GenericAssocMethod::<_>::default_hello(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.stderr b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.stderr index 1bc2592944699..318c5817d203e 100644 --- a/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.stderr +++ b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish-through-deref.stderr @@ -2,10 +2,7 @@ error[E0599]: no method named `hello` found for struct `RefMut<'_, HasAssocMetho --> $DIR/suggest-assoc-fn-call-with-turbofish-through-deref.rs:11:11 | LL | state.hello(); - | ------^^^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `HasAssocMethod::hello()` + | ^^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `HasAssocMethod` @@ -13,6 +10,10 @@ note: the candidate is defined in an impl for the type `HasAssocMethod` | LL | fn hello() {} | ^^^^^^^^^^ +help: use associated function syntax instead + | +LL | HasAssocMethod::hello(); + | ~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.stderr b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.stderr index 92b03fc77142c..45a74d7926d35 100644 --- a/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.stderr +++ b/tests/ui/suggestions/suggest-assoc-fn-call-with-turbofish.stderr @@ -5,10 +5,7 @@ LL | struct GenericAssocMethod(T); | ---------------------------- method `self_ty_ref_hello` not found for this struct ... LL | x.self_ty_ref_hello(); - | --^^^^^^^^^^^^^^^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `GenericAssocMethod::<_>::self_ty_ref_hello(&x)` + | ^^^^^^^^^^^^^^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `GenericAssocMethod` @@ -16,6 +13,10 @@ note: the candidate is defined in an impl for the type `GenericAssocMethod` | LL | fn self_ty_ref_hello(_: &Self) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | GenericAssocMethod::<_>::self_ty_ref_hello(&x); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0599]: no method named `self_ty_hello` found for struct `GenericAssocMethod<{integer}>` in the current scope --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:16:7 @@ -24,10 +25,7 @@ LL | struct GenericAssocMethod(T); | ---------------------------- method `self_ty_hello` not found for this struct ... LL | x.self_ty_hello(); - | --^^^^^^^^^^^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `GenericAssocMethod::<_>::self_ty_hello(x)` + | ^^^^^^^^^^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `GenericAssocMethod` @@ -35,6 +33,10 @@ note: the candidate is defined in an impl for the type `GenericAssocMethod` | LL | fn self_ty_hello(_: Self) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | GenericAssocMethod::<_>::self_ty_hello(x); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0599]: no method named `default_hello` found for struct `GenericAssocMethod` in the current scope --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:20:7 @@ -43,10 +45,7 @@ LL | struct GenericAssocMethod(T); | ---------------------------- method `default_hello` not found for this struct ... LL | y.default_hello(); - | --^^^^^^^^^^^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `GenericAssocMethod::::default_hello()` + | ^^^^^^^^^^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `GenericAssocMethod` @@ -54,6 +53,10 @@ note: the candidate is defined in an impl for the type `GenericAssocMethod` | LL | fn default_hello() {} | ^^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | GenericAssocMethod::::default_hello(); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0599]: no method named `self_ty_ref_hello` found for struct `GenericAssocMethod` in the current scope --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:22:7 @@ -62,10 +65,7 @@ LL | struct GenericAssocMethod(T); | ---------------------------- method `self_ty_ref_hello` not found for this struct ... LL | y.self_ty_ref_hello(); - | --^^^^^^^^^^^^^^^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `GenericAssocMethod::::self_ty_ref_hello(&y)` + | ^^^^^^^^^^^^^^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `GenericAssocMethod` @@ -73,6 +73,10 @@ note: the candidate is defined in an impl for the type `GenericAssocMethod` | LL | fn self_ty_ref_hello(_: &Self) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | GenericAssocMethod::::self_ty_ref_hello(&y); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0599]: no method named `self_ty_hello` found for struct `GenericAssocMethod` in the current scope --> $DIR/suggest-assoc-fn-call-with-turbofish.rs:24:7 @@ -81,10 +85,7 @@ LL | struct GenericAssocMethod(T); | ---------------------------- method `self_ty_hello` not found for this struct ... LL | y.self_ty_hello(); - | --^^^^^^^^^^^^^-- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `GenericAssocMethod::::self_ty_hello(y)` + | ^^^^^^^^^^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `GenericAssocMethod` @@ -92,6 +93,10 @@ note: the candidate is defined in an impl for the type `GenericAssocMethod` | LL | fn self_ty_hello(_: Self) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | GenericAssocMethod::::self_ty_hello(y); + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 5 previous errors diff --git a/tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr b/tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr index 793595784d937..2372aeb214588 100644 --- a/tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr +++ b/tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr @@ -5,10 +5,7 @@ LL | struct A {} | -------- method `hello` not found for this struct ... LL | _a.hello(1); - | ---^^^^^--- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `A::hello(1)` + | ^^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `A` @@ -16,6 +13,10 @@ note: the candidate is defined in an impl for the type `A` | LL | fn hello(_a: i32) {} | ^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | A::hello(1); + | ~~~~~~~~~~~ error[E0599]: no method named `test` found for struct `A` in the current scope --> $DIR/suggest-assoc-fn-call-without-receiver.rs:22:8 @@ -24,10 +25,7 @@ LL | struct A {} | -------- method `test` not found for this struct ... LL | _a.test(1); - | ---^^^^--- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `A::test(_a, 1)` + | ^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `A` @@ -35,6 +33,10 @@ note: the candidate is defined in an impl for the type `A` | LL | fn test(_a: Self, _b: i32) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | A::test(_a, 1); + | ~~~~~~~~~~~~~~ error[E0599]: no method named `hello` found for struct `B<&str>` in the current scope --> $DIR/suggest-assoc-fn-call-without-receiver.rs:26:8 @@ -43,10 +45,7 @@ LL | struct B { | ----------- method `hello` not found for this struct ... LL | _b.hello(1); - | ---^^^^^--- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `B::<&str>::hello(1)` + | ^^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `B` @@ -54,6 +53,10 @@ note: the candidate is defined in an impl for the type `B` | LL | fn hello(_a: i32) {} | ^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | B::<&str>::hello(1); + | ~~~~~~~~~~~~~~~~~~~ error[E0599]: no method named `test` found for struct `B<&str>` in the current scope --> $DIR/suggest-assoc-fn-call-without-receiver.rs:28:8 @@ -62,10 +65,7 @@ LL | struct B { | ----------- method `test` not found for this struct ... LL | _b.test(1); - | ---^^^^--- - | | | - | | this is an associated function, not a method - | help: use associated function syntax instead: `B::<&str>::test(_b, 1)` + | ^^^^ this is an associated function, not a method | = note: found the following associated functions; to be used as methods, functions must have a `self` parameter note: the candidate is defined in an impl for the type `B` @@ -73,6 +73,10 @@ note: the candidate is defined in an impl for the type `B` | LL | fn test(_a: Self, _b: i32) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^ +help: use associated function syntax instead + | +LL | B::<&str>::test(_b, 1); + | ~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 4 previous errors diff --git a/tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.stderr b/tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.stderr index bf7790e2307e0..55be1179d4193 100644 --- a/tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.stderr +++ b/tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.stderr @@ -2,10 +2,12 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/suggest-fn-ptr-for-fn-item-in-fn-ret.rs:7:13 | LL | fn bar() -> _ { Wrapper(foo) } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `Wrapper` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn bar() -> Wrapper { Wrapper(foo) } + | ~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/suggest-variants.stderr b/tests/ui/suggestions/suggest-variants.stderr index a422bc6563541..4f4dd3cddd5a5 100644 --- a/tests/ui/suggestions/suggest-variants.stderr +++ b/tests/ui/suggestions/suggest-variants.stderr @@ -5,7 +5,12 @@ LL | enum Shape { | ---------- variant `Squareee` not found here ... LL | println!("My shape is {:?}", Shape::Squareee { size: 5}); - | ^^^^^^^^ help: there is a variant with a similar name: `Square` + | ^^^^^^^^ + | +help: there is a variant with a similar name + | +LL | println!("My shape is {:?}", Shape::Square { size: 5}); + | ~~~~~~ error[E0599]: no variant named `Circl` found for enum `Shape` --> $DIR/suggest-variants.rs:13:41 @@ -14,7 +19,12 @@ LL | enum Shape { | ---------- variant `Circl` not found here ... LL | println!("My shape is {:?}", Shape::Circl { size: 5}); - | ^^^^^ help: there is a variant with a similar name: `Circle` + | ^^^^^ + | +help: there is a variant with a similar name + | +LL | println!("My shape is {:?}", Shape::Circle { size: 5}); + | ~~~~~~ error[E0599]: no variant named `Rombus` found for enum `Shape` --> $DIR/suggest-variants.rs:14:41 @@ -32,10 +42,12 @@ LL | enum Shape { | ---------- variant or associated item `Squareee` not found for this enum ... LL | Shape::Squareee; - | ^^^^^^^^ - | | - | variant or associated item not found in `Shape` - | help: there is a variant with a similar name: `Square` + | ^^^^^^^^ variant or associated item not found in `Shape` + | +help: there is a variant with a similar name + | +LL | Shape::Square; + | ~~~~~~ error[E0599]: no variant or associated item named `Circl` found for enum `Shape` in the current scope --> $DIR/suggest-variants.rs:16:12 @@ -44,10 +56,12 @@ LL | enum Shape { | ---------- variant or associated item `Circl` not found for this enum ... LL | Shape::Circl; - | ^^^^^ - | | - | variant or associated item not found in `Shape` - | help: there is a variant with a similar name: `Circle` + | ^^^^^ variant or associated item not found in `Shape` + | +help: there is a variant with a similar name + | +LL | Shape::Circle; + | ~~~~~~ error[E0599]: no variant or associated item named `Rombus` found for enum `Shape` in the current scope --> $DIR/suggest-variants.rs:17:12 diff --git a/tests/ui/suggestions/suppress-consider-slicing-issue-120605.stderr b/tests/ui/suggestions/suppress-consider-slicing-issue-120605.stderr index c28d67604da9f..cdd645c8f54bb 100644 --- a/tests/ui/suggestions/suppress-consider-slicing-issue-120605.stderr +++ b/tests/ui/suggestions/suppress-consider-slicing-issue-120605.stderr @@ -2,9 +2,12 @@ error[E0529]: expected an array or slice, found `Vec` --> $DIR/suppress-consider-slicing-issue-120605.rs:7:16 | LL | if let [Struct { a: [] }] = &self.a { - | ^^^^^^^^^^^^^^^^^^ ------- help: consider slicing here: `&self.a[..]` - | | - | pattern cannot match with input type `Vec` + | ^^^^^^^^^^^^^^^^^^ pattern cannot match with input type `Vec` + | +help: consider slicing here + | +LL | if let [Struct { a: [] }] = &self.a[..] { + | ~~~~~~~~~~~ error[E0529]: expected an array or slice, found `Vec` --> $DIR/suppress-consider-slicing-issue-120605.rs:7:29 diff --git a/tests/ui/suggestions/unnamable-types.stderr b/tests/ui/suggestions/unnamable-types.stderr index 6623678fd0c2d..0698c954b7a12 100644 --- a/tests/ui/suggestions/unnamable-types.stderr +++ b/tests/ui/suggestions/unnamable-types.stderr @@ -2,16 +2,23 @@ error: missing type for `const` item --> $DIR/unnamable-types.rs:6:8 | LL | const A = 5; - | ^ help: provide a type for the constant: `: i32` + | ^ + | +help: provide a type for the constant + | +LL | const A: i32 = 5; + | +++++ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/unnamable-types.rs:10:11 | LL | static B: _ = "abc"; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `&str` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | static B: &str = "abc"; + | ~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants --> $DIR/unnamable-types.rs:17:10 @@ -41,13 +48,23 @@ error: missing type for `const` item --> $DIR/unnamable-types.rs:29:8 | LL | const E = foo; - | ^ help: provide a type for the constant: `: fn() -> i32` + | ^ + | +help: provide a type for the constant + | +LL | const E: fn() -> i32 = foo; + | +++++++++++++ error: missing type for `const` item --> $DIR/unnamable-types.rs:32:8 | LL | const F = S { t: foo }; - | ^ help: provide a type for the constant: `: S i32>` + | ^ + | +help: provide a type for the constant + | +LL | const F: S i32> = S { t: foo }; + | ++++++++++++++++ error: missing type for `const` item --> $DIR/unnamable-types.rs:37:8 diff --git a/tests/ui/tag-variant-cast-non-nullary.stderr b/tests/ui/tag-variant-cast-non-nullary.stderr index 2e1dde27d0f98..4b022fcba526a 100644 --- a/tests/ui/tag-variant-cast-non-nullary.stderr +++ b/tests/ui/tag-variant-cast-non-nullary.stderr @@ -2,10 +2,14 @@ error[E0605]: non-primitive cast: `NonNullary` as `isize` --> $DIR/tag-variant-cast-non-nullary.rs:19:15 | LL | let val = v as isize; - | ^^^^^^^^^^ help: consider using the `From` trait instead: `isize::from(v)` + | ^^^^^^^^^^ | = note: an `as` expression can be used to convert enum types to numeric types only if the enum type is unit-only or field-less = note: see https://doc.rust-lang.org/reference/items/enumerations.html#casting for more information +help: consider using the `From` trait instead + | +LL | let val = isize::from(v); + | ~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/target-feature/invalid-attribute.stderr b/tests/ui/target-feature/invalid-attribute.stderr index bf48911edec5f..2803ea649bd9f 100644 --- a/tests/ui/target-feature/invalid-attribute.stderr +++ b/tests/ui/target-feature/invalid-attribute.stderr @@ -156,13 +156,23 @@ error: malformed `target_feature` attribute input --> $DIR/invalid-attribute.rs:25:18 | LL | #[target_feature(bar)] - | ^^^ help: must be of the form: `enable = ".."` + | ^^^ + | +help: must be of the form + | +LL | #[target_feature(enable = "..")] + | ~~~~~~~~~~~~~ error: malformed `target_feature` attribute input --> $DIR/invalid-attribute.rs:27:18 | LL | #[target_feature(disable = "baz")] - | ^^^^^^^^^^^^^^^ help: must be of the form: `enable = ".."` + | ^^^^^^^^^^^^^^^ + | +help: must be of the form + | +LL | #[target_feature(enable = "..")] + | ~~~~~~~~~~~~~ error[E0658]: `#[target_feature(..)]` can only be applied to `unsafe` functions --> $DIR/invalid-attribute.rs:31:1 diff --git a/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr b/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr index 06e2fa5d4d1fd..9193faeb1aa9a 100644 --- a/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr +++ b/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr @@ -117,15 +117,18 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:40:58 | LL | impl, U> YetAnotherTrait for Struct {} - | ^^^^^^ - help: remove this generic argument - | | - | expected 1 generic argument + | ^^^^^^ expected 1 generic argument | note: struct defined here, with 1 generic parameter: `T` --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:26:8 | LL | struct Struct> { | ^^^^^^ - +help: remove this generic argument + | +LL - impl, U> YetAnotherTrait for Struct {} +LL + impl, U> YetAnotherTrait for Struct {} + | error: aborting due to 9 previous errors diff --git a/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr index 0020f9e416df2..16ad577248c10 100644 --- a/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr +++ b/tests/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr @@ -80,10 +80,15 @@ error[E0404]: expected trait, found struct `String` --> $DIR/assoc_type_bound_with_struct.rs:19:51 | LL | fn issue_95327() where ::Assoc: String {} - | ^^^^^^ help: a trait with a similar name exists: `ToString` + | ^^^^^^ --> $SRC_DIR/alloc/src/string.rs:LL:COL | = note: similarly named trait `ToString` defined here + | +help: a trait with a similar name exists + | +LL | fn issue_95327() where ::Assoc: ToString {} + | ~~~~~~~~ error: aborting due to 6 previous errors diff --git a/tests/ui/traits/impl-for-module.stderr b/tests/ui/traits/impl-for-module.stderr index b715c699e89f1..25b0e83d1154a 100644 --- a/tests/ui/traits/impl-for-module.stderr +++ b/tests/ui/traits/impl-for-module.stderr @@ -5,7 +5,12 @@ LL | trait A { | ------- similarly named trait `A` defined here ... LL | impl A for a { - | ^ help: a trait with a similar name exists: `A` + | ^ + | +help: a trait with a similar name exists + | +LL | impl A for A { + | ~ error: aborting due to 1 previous error diff --git a/tests/ui/traits/issue-35869.stderr b/tests/ui/traits/issue-35869.stderr index 6d985bdeaf859..503f9cee246e9 100644 --- a/tests/ui/traits/issue-35869.stderr +++ b/tests/ui/traits/issue-35869.stderr @@ -2,10 +2,7 @@ error[E0053]: method `foo` has an incompatible type for trait --> $DIR/issue-35869.rs:11:15 | LL | fn foo(_: fn(u16) -> ()) {} - | ^^^^^^^^^^^^^ - | | - | expected `u8`, found `u16` - | help: change the parameter type to match the trait: `fn(u8)` + | ^^^^^^^^^^^^^ expected `u8`, found `u16` | note: type in trait --> $DIR/issue-35869.rs:2:15 @@ -14,15 +11,16 @@ LL | fn foo(_: fn(u8) -> ()); | ^^^^^^^^^^^^ = note: expected signature `fn(fn(u8))` found signature `fn(fn(u16))` +help: change the parameter type to match the trait + | +LL | fn foo(_: fn(u8)) {} + | ~~~~~~ error[E0053]: method `bar` has an incompatible type for trait --> $DIR/issue-35869.rs:13:15 | LL | fn bar(_: Option) {} - | ^^^^^^^^^^^ - | | - | expected `u8`, found `u16` - | help: change the parameter type to match the trait: `Option` + | ^^^^^^^^^^^ expected `u8`, found `u16` | note: type in trait --> $DIR/issue-35869.rs:3:15 @@ -31,15 +29,16 @@ LL | fn bar(_: Option); | ^^^^^^^^^^ = note: expected signature `fn(Option)` found signature `fn(Option)` +help: change the parameter type to match the trait + | +LL | fn bar(_: Option) {} + | ~~~~~~~~~~ error[E0053]: method `baz` has an incompatible type for trait --> $DIR/issue-35869.rs:15:15 | LL | fn baz(_: (u16, u16)) {} - | ^^^^^^^^^^ - | | - | expected `u8`, found `u16` - | help: change the parameter type to match the trait: `(u8, u16)` + | ^^^^^^^^^^ expected `u8`, found `u16` | note: type in trait --> $DIR/issue-35869.rs:4:15 @@ -48,15 +47,16 @@ LL | fn baz(_: (u8, u16)); | ^^^^^^^^^ = note: expected signature `fn((u8, _))` found signature `fn((u16, _))` +help: change the parameter type to match the trait + | +LL | fn baz(_: (u8, u16)) {} + | ~~~~~~~~~ error[E0053]: method `qux` has an incompatible type for trait --> $DIR/issue-35869.rs:17:17 | LL | fn qux() -> u16 { 5u16 } - | ^^^ - | | - | expected `u8`, found `u16` - | help: change the output type to match the trait: `u8` + | ^^^ expected `u8`, found `u16` | note: type in trait --> $DIR/issue-35869.rs:5:17 @@ -65,6 +65,10 @@ LL | fn qux() -> u8; | ^^ = note: expected signature `fn() -> u8` found signature `fn() -> u16` +help: change the output type to match the trait + | +LL | fn qux() -> u8 { 5u16 } + | ~~ error: aborting due to 4 previous errors diff --git a/tests/ui/traits/issue-78372.stderr b/tests/ui/traits/issue-78372.stderr index cdcb0cdf2593d..8e5b1b54808c4 100644 --- a/tests/ui/traits/issue-78372.stderr +++ b/tests/ui/traits/issue-78372.stderr @@ -58,9 +58,6 @@ LL | impl DispatchFromDyn> for T {} error[E0038]: the trait `Foo` cannot be made into an object --> $DIR/issue-78372.rs:12:17 | -LL | fn foo(self: Smaht); - | -------------- help: consider changing method `foo`'s `self` parameter to be `&self`: `&Self` -... LL | impl Marker for dyn Foo {} | ^^^^^^^ `Foo` cannot be made into an object | @@ -72,6 +69,10 @@ LL | trait Foo: X {} LL | trait X { LL | fn foo(self: Smaht); | ^^^^^^^^^^^^^^ ...because method `foo`'s `self` parameter cannot be dispatched on +help: consider changing method `foo`'s `self` parameter to be `&self` + | +LL | fn foo(self: &Self); + | ~~~~~ error[E0307]: invalid `self` parameter type: `Smaht` --> $DIR/issue-78372.rs:9:18 diff --git a/tests/ui/traits/object/vs-lifetime.stderr b/tests/ui/traits/object/vs-lifetime.stderr index a69cd140807ff..aab4845a27420 100644 --- a/tests/ui/traits/object/vs-lifetime.stderr +++ b/tests/ui/traits/object/vs-lifetime.stderr @@ -8,15 +8,18 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup --> $DIR/vs-lifetime.rs:11:12 | LL | let _: S<'static, 'static>; - | ^ ------- help: remove this lifetime argument - | | - | expected 1 lifetime argument + | ^ expected 1 lifetime argument | note: struct defined here, with 1 lifetime parameter: `'a` --> $DIR/vs-lifetime.rs:4:8 | LL | struct S<'a, T>(&'a u8, T); | ^ -- +help: remove this lifetime argument + | +LL - let _: S<'static, 'static>; +LL + let _: S<'static, >; + | error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied --> $DIR/vs-lifetime.rs:11:12 diff --git a/tests/ui/traits/test-2.stderr b/tests/ui/traits/test-2.stderr index 3972e539776c4..9916cf97fca95 100644 --- a/tests/ui/traits/test-2.stderr +++ b/tests/ui/traits/test-2.stderr @@ -2,29 +2,35 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/test-2.rs:9:8 | LL | 10.dup::(); - | ^^^------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^ expected 0 generic arguments | note: method defined here, with 0 generic parameters --> $DIR/test-2.rs:4:16 | LL | trait bar { fn dup(&self) -> Self; fn blah(&self); } | ^^^ +help: remove these generics + | +LL - 10.dup::(); +LL + 10.dup(); + | error[E0107]: method takes 1 generic argument but 2 generic arguments were supplied --> $DIR/test-2.rs:11:8 | LL | 10.blah::(); - | ^^^^ --- help: remove this generic argument - | | - | expected 1 generic argument + | ^^^^ expected 1 generic argument | note: method defined here, with 1 generic parameter: `X` --> $DIR/test-2.rs:4:39 | LL | trait bar { fn dup(&self) -> Self; fn blah(&self); } | ^^^^ - +help: remove this generic argument + | +LL - 10.blah::(); +LL + 10.blah::(); + | error[E0038]: the trait `bar` cannot be made into an object --> $DIR/test-2.rs:13:22 diff --git a/tests/ui/traits/wrong-mul-method-signature.stderr b/tests/ui/traits/wrong-mul-method-signature.stderr index 91162cbc1231f..e30b61622ae01 100644 --- a/tests/ui/traits/wrong-mul-method-signature.stderr +++ b/tests/ui/traits/wrong-mul-method-signature.stderr @@ -2,37 +2,40 @@ error[E0053]: method `mul` has an incompatible type for trait --> $DIR/wrong-mul-method-signature.rs:16:21 | LL | fn mul(self, s: &f64) -> Vec1 { - | ^^^^ - | | - | expected `f64`, found `&f64` - | help: change the parameter type to match the trait: `f64` + | ^^^^ expected `f64`, found `&f64` | = note: expected signature `fn(Vec1, _) -> Vec1` found signature `fn(Vec1, &_) -> Vec1` +help: change the parameter type to match the trait + | +LL | fn mul(self, s: f64) -> Vec1 { + | ~~~ error[E0053]: method `mul` has an incompatible type for trait --> $DIR/wrong-mul-method-signature.rs:33:21 | LL | fn mul(self, s: f64) -> Vec2 { - | ^^^ - | | - | expected `Vec2`, found `f64` - | help: change the parameter type to match the trait: `Vec2` + | ^^^ expected `Vec2`, found `f64` | = note: expected signature `fn(Vec2, Vec2) -> f64` found signature `fn(Vec2, f64) -> Vec2` +help: change the parameter type to match the trait + | +LL | fn mul(self, s: Vec2) -> Vec2 { + | ~~~~ error[E0053]: method `mul` has an incompatible type for trait --> $DIR/wrong-mul-method-signature.rs:52:29 | LL | fn mul(self, s: f64) -> f64 { - | ^^^ - | | - | expected `i32`, found `f64` - | help: change the output type to match the trait: `i32` + | ^^^ expected `i32`, found `f64` | = note: expected signature `fn(Vec3, _) -> i32` found signature `fn(Vec3, _) -> f64` +help: change the output type to match the trait + | +LL | fn mul(self, s: f64) -> i32 { + | ~~~ error[E0308]: mismatched types --> $DIR/wrong-mul-method-signature.rs:63:45 diff --git a/tests/ui/transmutability/issue-101739-2.stderr b/tests/ui/transmutability/issue-101739-2.stderr index 38912696c18e3..69cc809e8eb73 100644 --- a/tests/ui/transmutability/issue-101739-2.stderr +++ b/tests/ui/transmutability/issue-101739-2.stderr @@ -1,13 +1,16 @@ error[E0107]: trait takes at most 2 generic arguments but 5 generic arguments were supplied --> $DIR/issue-101739-2.rs:17:14 | -LL | Dst: BikeshedIntrinsicFrom< - | ^^^^^^^^^^^^^^^^^^^^^ expected at most 2 generic arguments -... -LL | / ASSUME_LIFETIMES, -LL | | ASSUME_VALIDITY, -LL | | ASSUME_VISIBILITY, - | |_____________________________- help: remove these generic arguments +LL | Dst: BikeshedIntrinsicFrom< + | ^^^^^^^^^^^^^^^^^^^^^ expected at most 2 generic arguments + | +help: remove these generic arguments + | +LL - ASSUME_LIFETIMES, +LL - ASSUME_VALIDITY, +LL - ASSUME_VISIBILITY, +LL + , + | error[E0308]: mismatched types --> $DIR/issue-101739-2.rs:19:13 diff --git a/tests/ui/try-block/try-block-type-error.stderr b/tests/ui/try-block/try-block-type-error.stderr index 3e9a584a5510a..ab331e95d5e83 100644 --- a/tests/ui/try-block/try-block-type-error.stderr +++ b/tests/ui/try-block/try-block-type-error.stderr @@ -2,10 +2,12 @@ error[E0271]: type mismatch resolving ` as Try>::Output == {integer} --> $DIR/try-block-type-error.rs:10:9 | LL | 42 - | ^^ - | | - | expected `f32`, found integer - | help: use a float literal: `42.0` + | ^^ expected `f32`, found integer + | +help: use a float literal + | +LL | 42.0 + | error[E0271]: type mismatch resolving ` as Try>::Output == ()` --> $DIR/try-block-type-error.rs:16:5 diff --git a/tests/ui/tuple/array-diagnostics.stderr b/tests/ui/tuple/array-diagnostics.stderr index 629ca2b37fa5a..e2dd49f0b76b6 100644 --- a/tests/ui/tuple/array-diagnostics.stderr +++ b/tests/ui/tuple/array-diagnostics.stderr @@ -2,7 +2,12 @@ error[E0618]: expected function, found `(&'static str, {integer})` --> $DIR/array-diagnostics.rs:4:9 | LL | ("C200B40A83", 4) - | ^^^^^^^^^^^^^^^^^- help: consider separating array elements with a comma: `,` + | ^^^^^^^^^^^^^^^^^ + | +help: consider separating array elements with a comma + | +LL | ("C200B40A83", 4), + | + error: aborting due to 1 previous error diff --git a/tests/ui/type-alias-enum-variants/enum-variant-generic-args.stderr b/tests/ui/type-alias-enum-variants/enum-variant-generic-args.stderr index 96a5c13276331..a2dd6805f3d5c 100644 --- a/tests/ui/type-alias-enum-variants/enum-variant-generic-args.stderr +++ b/tests/ui/type-alias-enum-variants/enum-variant-generic-args.stderr @@ -308,29 +308,35 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/enum-variant-generic-args.rs:64:5 | LL | AliasFixed::<()>::TSVariant(()); - | ^^^^^^^^^^------ help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^ expected 0 generic arguments | note: type alias defined here, with 0 generic parameters --> $DIR/enum-variant-generic-args.rs:9:6 | LL | type AliasFixed = Enum<()>; | ^^^^^^^^^^ +help: remove these generics + | +LL - AliasFixed::<()>::TSVariant(()); +LL + AliasFixed::TSVariant(()); + | error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied --> $DIR/enum-variant-generic-args.rs:66:5 | LL | AliasFixed::<()>::TSVariant::<()>(()); - | ^^^^^^^^^^------ help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^ expected 0 generic arguments | note: type alias defined here, with 0 generic parameters --> $DIR/enum-variant-generic-args.rs:9:6 | LL | type AliasFixed = Enum<()>; | ^^^^^^^^^^ +help: remove these generics + | +LL - AliasFixed::<()>::TSVariant::<()>(()); +LL + AliasFixed::TSVariant::<()>(()); + | error[E0109]: type arguments are not allowed on this type --> $DIR/enum-variant-generic-args.rs:66:35 @@ -399,29 +405,35 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/enum-variant-generic-args.rs:82:5 | LL | AliasFixed::<()>::SVariant { v: () }; - | ^^^^^^^^^^------ help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^ expected 0 generic arguments | note: type alias defined here, with 0 generic parameters --> $DIR/enum-variant-generic-args.rs:9:6 | LL | type AliasFixed = Enum<()>; | ^^^^^^^^^^ +help: remove these generics + | +LL - AliasFixed::<()>::SVariant { v: () }; +LL + AliasFixed::SVariant { v: () }; + | error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied --> $DIR/enum-variant-generic-args.rs:84:5 | LL | AliasFixed::<()>::SVariant::<()> { v: () }; - | ^^^^^^^^^^------ help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^ expected 0 generic arguments | note: type alias defined here, with 0 generic parameters --> $DIR/enum-variant-generic-args.rs:9:6 | LL | type AliasFixed = Enum<()>; | ^^^^^^^^^^ +help: remove these generics + | +LL - AliasFixed::<()>::SVariant::<()> { v: () }; +LL + AliasFixed::SVariant::<()> { v: () }; + | error[E0109]: type arguments are not allowed on this type --> $DIR/enum-variant-generic-args.rs:84:34 @@ -474,29 +486,35 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/enum-variant-generic-args.rs:100:5 | LL | AliasFixed::<()>::UVariant; - | ^^^^^^^^^^------ help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^ expected 0 generic arguments | note: type alias defined here, with 0 generic parameters --> $DIR/enum-variant-generic-args.rs:9:6 | LL | type AliasFixed = Enum<()>; | ^^^^^^^^^^ +help: remove these generics + | +LL - AliasFixed::<()>::UVariant; +LL + AliasFixed::UVariant; + | error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied --> $DIR/enum-variant-generic-args.rs:102:5 | LL | AliasFixed::<()>::UVariant::<()>; - | ^^^^^^^^^^------ help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^^^ expected 0 generic arguments | note: type alias defined here, with 0 generic parameters --> $DIR/enum-variant-generic-args.rs:9:6 | LL | type AliasFixed = Enum<()>; | ^^^^^^^^^^ +help: remove these generics + | +LL - AliasFixed::<()>::UVariant::<()>; +LL + AliasFixed::UVariant::<()>; + | error[E0109]: type arguments are not allowed on this type --> $DIR/enum-variant-generic-args.rs:102:34 diff --git a/tests/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr b/tests/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr index 0f42fcbe04d0a..8c5ae3eee0a68 100644 --- a/tests/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr +++ b/tests/ui/type-alias-enum-variants/enum-variant-priority-lint-ambiguous_associated_items.stderr @@ -2,7 +2,7 @@ error: ambiguous associated item --> $DIR/enum-variant-priority-lint-ambiguous_associated_items.rs:32:15 | LL | fn f() -> Self::V { 0 } - | ^^^^^^^ help: use fully-qualified syntax: `::V` + | ^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #57644 @@ -17,6 +17,10 @@ note: `V` could also refer to the associated type defined here LL | type V; | ^^^^^^ = note: `#[deny(ambiguous_associated_items)]` on by default +help: use fully-qualified syntax + | +LL | fn f() -> ::V { 0 } + | ~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/type-alias-impl-trait/constrain_in_projection2.next.stderr b/tests/ui/type-alias-impl-trait/constrain_in_projection2.next.stderr index 0d6eac4216bae..180aabab3adfe 100644 --- a/tests/ui/type-alias-impl-trait/constrain_in_projection2.next.stderr +++ b/tests/ui/type-alias-impl-trait/constrain_in_projection2.next.stderr @@ -2,7 +2,7 @@ error[E0283]: type annotations needed: cannot satisfy `Foo: Trait` --> $DIR/constrain_in_projection2.rs:27:14 | LL | let x = >::Assoc::default(); - | ^^^ help: use the fully qualified path to an implementation: `::Assoc` + | ^^^ | note: multiple `impl`s satisfying `Foo: Trait` found --> $DIR/constrain_in_projection2.rs:18:1 @@ -13,6 +13,10 @@ LL | impl Trait<()> for Foo { LL | impl Trait for Foo { | ^^^^^^^^^^^^^^^^^^^^^^^ = note: associated types cannot be accessed directly on a `trait`, they can only be accessed through a specific `impl` +help: use the fully qualified path to an implementation + | +LL | let x = <::Assoc as Trait>::Assoc::default(); + | ~~~~~~~~~~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/type-alias-impl-trait/unnameable_type.stderr b/tests/ui/type-alias-impl-trait/unnameable_type.stderr index f567b01d29a1b..5b331c5660d9c 100644 --- a/tests/ui/type-alias-impl-trait/unnameable_type.stderr +++ b/tests/ui/type-alias-impl-trait/unnameable_type.stderr @@ -5,10 +5,7 @@ LL | type MyPrivate = impl Sized; | ---------- the found opaque type LL | impl Trait for u32 { LL | fn dont_define_this(private: MyPrivate) { - | ^^^^^^^^^ - | | - | expected `Private`, found opaque type - | help: change the parameter type to match the trait: `Private` + | ^^^^^^^^^ expected `Private`, found opaque type | note: type in trait --> $DIR/unnameable_type.rs:10:39 @@ -17,6 +14,10 @@ LL | fn dont_define_this(_private: Private) {} | ^^^^^^^ = note: expected signature `fn(Private)` found signature `fn(MyPrivate)` +help: change the parameter type to match the trait + | +LL | fn dont_define_this(private: Private) { + | ~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/type/issue-7607-1.stderr b/tests/ui/type/issue-7607-1.stderr index db4c8f25dbc43..2fc6b43071069 100644 --- a/tests/ui/type/issue-7607-1.stderr +++ b/tests/ui/type/issue-7607-1.stderr @@ -2,10 +2,15 @@ error[E0412]: cannot find type `Fo` in this scope --> $DIR/issue-7607-1.rs:5:6 | LL | impl Fo { - | ^^ help: a trait with a similar name exists: `Fn` + | ^^ --> $SRC_DIR/core/src/ops/function.rs:LL:COL | = note: similarly named trait `Fn` defined here + | +help: a trait with a similar name exists + | +LL | impl Fn { + | ~~ error: aborting due to 1 previous error diff --git a/tests/ui/type/type-parameter-defaults-referencing-Self.stderr b/tests/ui/type/type-parameter-defaults-referencing-Self.stderr index 16d08b2672267..a7733cedda906 100644 --- a/tests/ui/type/type-parameter-defaults-referencing-Self.stderr +++ b/tests/ui/type/type-parameter-defaults-referencing-Self.stderr @@ -5,9 +5,13 @@ LL | trait Foo { | ----------------- type parameter `T` must be specified for this ... LL | fn foo(x: &dyn Foo) { } - | ^^^ help: set the type parameter to the desired type: `Foo` + | ^^^ | = note: because of the default `Self` reference, type parameters must be specified on object types +help: set the type parameter to the desired type + | +LL | fn foo(x: &dyn Foo) { } + | ~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/typeck/issue-100164.stderr b/tests/ui/typeck/issue-100164.stderr index 06a132d651429..1fc4ae7cff66c 100644 --- a/tests/ui/typeck/issue-100164.stderr +++ b/tests/ui/typeck/issue-100164.stderr @@ -2,13 +2,23 @@ error: missing type for `const` item --> $DIR/issue-100164.rs:3:10 | LL | const _A: = 123; - | ^ help: provide a type for the constant: `i32` + | ^ + | +help: provide a type for the constant + | +LL | const _A: i32 = 123; + | +++ error: missing type for `const` item --> $DIR/issue-100164.rs:7:14 | LL | const _B: = 123; - | ^ help: provide a type for the constant: `i32` + | ^ + | +help: provide a type for the constant + | +LL | const _B: i32 = 123; + | +++ error: aborting due to 2 previous errors diff --git a/tests/ui/typeck/issue-114423-ice-regression-in-suggestion.stderr b/tests/ui/typeck/issue-114423-ice-regression-in-suggestion.stderr index 4ccfacfb00521..3a21fd4803843 100644 --- a/tests/ui/typeck/issue-114423-ice-regression-in-suggestion.stderr +++ b/tests/ui/typeck/issue-114423-ice-regression-in-suggestion.stderr @@ -14,7 +14,12 @@ error[E0425]: cannot find value `g` in this scope --> $DIR/issue-114423-ice-regression-in-suggestion.rs:11:22 | LL | let _ = RGB { r, g, b }; - | ^ help: a local variable with a similar name exists: `b` + | ^ + | +help: a local variable with a similar name exists + | +LL | let _ = RGB { r, b, b }; + | ~ error[E0308]: mismatched types --> $DIR/issue-114423-ice-regression-in-suggestion.rs:7:50 diff --git a/tests/ui/typeck/issue-120856.stderr b/tests/ui/typeck/issue-120856.stderr index 1fc8b20047355..1c42f3049ff75 100644 --- a/tests/ui/typeck/issue-120856.stderr +++ b/tests/ui/typeck/issue-120856.stderr @@ -2,19 +2,23 @@ error[E0433]: failed to resolve: use of undeclared crate or module `n` --> $DIR/issue-120856.rs:1:37 | LL | pub type Archived = ::Archived; - | ^ - | | - | use of undeclared crate or module `n` - | help: a trait with a similar name exists: `Fn` + | ^ use of undeclared crate or module `n` + | +help: a trait with a similar name exists + | +LL | pub type Archived = ::Archived; + | ~~ error[E0433]: failed to resolve: use of undeclared crate or module `m` --> $DIR/issue-120856.rs:1:25 | LL | pub type Archived = ::Archived; - | ^ - | | - | use of undeclared crate or module `m` - | help: a type parameter with a similar name exists: `T` + | ^ use of undeclared crate or module `m` + | +help: a type parameter with a similar name exists + | +LL | pub type Archived = ::Archived; + | ~ error: aborting due to 2 previous errors diff --git a/tests/ui/typeck/issue-53712.stderr b/tests/ui/typeck/issue-53712.stderr index ec31766324b26..50aee45e03045 100644 --- a/tests/ui/typeck/issue-53712.stderr +++ b/tests/ui/typeck/issue-53712.stderr @@ -2,10 +2,12 @@ error[E0609]: no field `0` on type `[{integer}; 5]` --> $DIR/issue-53712.rs:5:9 | LL | arr.0; - | ----^ - | | | - | | unknown field - | help: instead of using tuple indexing, use array indexing: `arr[0]` + | ^ unknown field + | +help: instead of using tuple indexing, use array indexing + | +LL | arr[0]; + | ~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/typeck/issue-80779.stderr b/tests/ui/typeck/issue-80779.stderr index 2261ba616545f..2e27b128d89f6 100644 --- a/tests/ui/typeck/issue-80779.stderr +++ b/tests/ui/typeck/issue-80779.stderr @@ -2,19 +2,23 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/issue-80779.rs:10:28 | LL | pub fn g(_: T<'static>) -> _ {} - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `()` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | pub fn g(_: T<'static>) -> () {} + | ~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/issue-80779.rs:5:29 | LL | pub fn f<'a>(val: T<'a>) -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `()` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | pub fn f<'a>(val: T<'a>) -> () { + | ~~ error: aborting due to 2 previous errors diff --git a/tests/ui/typeck/issue-83693.stderr b/tests/ui/typeck/issue-83693.stderr index 34bca426116e5..ee8ab14d5923c 100644 --- a/tests/ui/typeck/issue-83693.stderr +++ b/tests/ui/typeck/issue-83693.stderr @@ -2,10 +2,15 @@ error[E0412]: cannot find type `F` in this scope --> $DIR/issue-83693.rs:6:6 | LL | impl F { - | ^ help: a trait with a similar name exists: `Fn` + | ^ --> $SRC_DIR/core/src/ops/function.rs:LL:COL | = note: similarly named trait `Fn` defined here + | +help: a trait with a similar name exists + | +LL | impl Fn { + | ~~ error[E0412]: cannot find type `TestResult` in this scope --> $DIR/issue-83693.rs:9:22 diff --git a/tests/ui/typeck/issue-88844.stderr b/tests/ui/typeck/issue-88844.stderr index 68473f65dcf53..0f4e011faff5d 100644 --- a/tests/ui/typeck/issue-88844.stderr +++ b/tests/ui/typeck/issue-88844.stderr @@ -5,7 +5,12 @@ LL | struct Struct { value: i32 } | ------------- similarly named struct `Struct` defined here ... LL | impl Stuct { - | ^^^^^ help: a struct with a similar name exists: `Struct` + | ^^^^^ + | +help: a struct with a similar name exists + | +LL | impl Struct { + | ~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/typeck/issue-91328.stderr b/tests/ui/typeck/issue-91328.stderr index f2f407bcafff2..b3bf870021e41 100644 --- a/tests/ui/typeck/issue-91328.stderr +++ b/tests/ui/typeck/issue-91328.stderr @@ -1,38 +1,46 @@ error[E0529]: expected an array or slice, found `Vec` --> $DIR/issue-91328.rs:10:12 | -LL | match r { - | - help: consider using `as_deref` here: `r.as_deref()` -LL | LL | Ok([a, b]) => a + b, | ^^^^^^ pattern cannot match with input type `Vec` + | +help: consider using `as_deref` here + | +LL | match r.as_deref() { + | ~~~~~~~~~~~~ error[E0529]: expected an array or slice, found `Vec` --> $DIR/issue-91328.rs:20:14 | -LL | match o { - | - help: consider using `as_deref` here: `o.as_deref()` -LL | LL | Some([a, b]) => a + b, | ^^^^^^ pattern cannot match with input type `Vec` + | +help: consider using `as_deref` here + | +LL | match o.as_deref() { + | ~~~~~~~~~~~~ error[E0529]: expected an array or slice, found `Vec` --> $DIR/issue-91328.rs:30:9 | -LL | match v { - | - help: consider slicing here: `v[..]` -LL | LL | [a, b] => a + b, | ^^^^^^ pattern cannot match with input type `Vec` + | +help: consider slicing here + | +LL | match v[..] { + | ~~~~~ error[E0529]: expected an array or slice, found `Box<[i32; 2]>` --> $DIR/issue-91328.rs:40:14 | -LL | match a { - | - help: consider using `as_deref` here: `a.as_deref()` -LL | LL | Some([a, b]) => a + b, | ^^^^^^ pattern cannot match with input type `Box<[i32; 2]>` + | +help: consider using `as_deref` here + | +LL | match a.as_deref() { + | ~~~~~~~~~~~~ error: aborting due to 4 previous errors diff --git a/tests/ui/typeck/issue-98260.stderr b/tests/ui/typeck/issue-98260.stderr index b7debd335b0fb..1a9834206c0fc 100644 --- a/tests/ui/typeck/issue-98260.stderr +++ b/tests/ui/typeck/issue-98260.stderr @@ -2,10 +2,12 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/issue-98260.rs:3:27 | LL | fn a(aa: B) -> Result<_, B> { - | -------^---- - | | | - | | not allowed in type signatures - | help: replace with the correct return type: `Result<(), B>` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn a(aa: B) -> Result<(), B> { + | ~~~~~~~~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/typeck/mismatched-map-under-self.stderr b/tests/ui/typeck/mismatched-map-under-self.stderr index 322bf349f92fc..59de00a58bbea 100644 --- a/tests/ui/typeck/mismatched-map-under-self.stderr +++ b/tests/ui/typeck/mismatched-map-under-self.stderr @@ -2,10 +2,7 @@ error[E0053]: method `values` has an incompatible type for trait --> $DIR/mismatched-map-under-self.rs:10:15 | LL | fn values(self) -> Self::Values { - | ^^^^ - | | - | expected `&Option`, found `Option` - | help: change the self-receiver type to match the trait: `&self` + | ^^^^ expected `&Option`, found `Option` | note: type in trait --> $DIR/mismatched-map-under-self.rs:4:15 @@ -14,6 +11,10 @@ LL | fn values(&self) -> Self::Values; | ^^^^^ = note: expected signature `fn(&Option<_>)` found signature `fn(Option<_>)` +help: change the self-receiver type to match the trait + | +LL | fn values(&self) -> Self::Values { + | ~~~~~ error[E0631]: type mismatch in function arguments --> $DIR/mismatched-map-under-self.rs:12:18 diff --git a/tests/ui/typeck/typeck-builtin-bound-type-parameters.stderr b/tests/ui/typeck/typeck-builtin-bound-type-parameters.stderr index 9a9b2a68dbed9..3be83682ec9aa 100644 --- a/tests/ui/typeck/typeck-builtin-bound-type-parameters.stderr +++ b/tests/ui/typeck/typeck-builtin-bound-type-parameters.stderr @@ -2,69 +2,99 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/typeck-builtin-bound-type-parameters.rs:1:11 | LL | fn foo1, U>(x: T) {} - | ^^^^--- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^ expected 0 generic arguments + | +help: remove these generics + | +LL - fn foo1, U>(x: T) {} +LL + fn foo1(x: T) {} + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:4:14 | LL | trait Trait: Copy {} - | ^^^^---------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^ expected 0 generic arguments + | +help: remove these generics + | +LL - trait Trait: Copy {} +LL + trait Trait: Copy {} + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:4:14 | LL | trait Trait: Copy {} - | ^^^^---------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^ expected 0 generic arguments | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: remove these generics + | +LL - trait Trait: Copy {} +LL + trait Trait: Copy {} + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:4:14 | LL | trait Trait: Copy {} - | ^^^^---------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^ expected 0 generic arguments | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` +help: remove these generics + | +LL - trait Trait: Copy {} +LL + trait Trait: Copy {} + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:9:21 | LL | struct MyStruct1>(T); - | ^^^^--- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^ expected 0 generic arguments + | +help: remove these generics + | +LL - struct MyStruct1>(T); +LL + struct MyStruct1(T); + | error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:12:25 | LL | struct MyStruct2<'a, T: Copy<'a>>(&'a T); - | ^^^^---- help: remove these generics - | | - | expected 0 lifetime arguments + | ^^^^ expected 0 lifetime arguments + | +help: remove these generics + | +LL - struct MyStruct2<'a, T: Copy<'a>>(&'a T); +LL + struct MyStruct2<'a, T: Copy>(&'a T); + | error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:15:15 | LL | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} - | ^^^^ -- help: remove this lifetime argument - | | - | expected 0 lifetime arguments + | ^^^^ expected 0 lifetime arguments + | +help: remove this lifetime argument + | +LL - fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} +LL + fn foo2<'a, T:Copy<, U>, U>(x: T) {} + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/typeck-builtin-bound-type-parameters.rs:15:15 | LL | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} - | ^^^^ - help: remove this generic argument - | | - | expected 0 generic arguments + | ^^^^ expected 0 generic arguments + | +help: remove this generic argument + | +LL - fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} +LL + fn foo2<'a, T:Copy<'a, >, U>(x: T) {} + | error: aborting due to 8 previous errors diff --git a/tests/ui/typeck/typeck_type_placeholder_item.stderr b/tests/ui/typeck/typeck_type_placeholder_item.stderr index 7977504dae1d6..6e8704deae163 100644 --- a/tests/ui/typeck/typeck_type_placeholder_item.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_item.stderr @@ -48,38 +48,47 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:7:14 | LL | fn test() -> _ { 5 } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `i32` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn test() -> i32 { 5 } + | ~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/typeck_type_placeholder_item.rs:10:16 | LL | fn test2() -> (_, _) { (5, 5) } - | -^--^- - | || | - | || not allowed in type signatures - | |not allowed in type signatures - | help: replace with the correct return type: `(i32, i32)` + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn test2() -> (i32, i32) { (5, 5) } + | ~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/typeck_type_placeholder_item.rs:13:15 | LL | static TEST3: _ = "test"; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `&str` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | static TEST3: &str = "test"; + | ~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/typeck_type_placeholder_item.rs:16:15 | LL | static TEST4: _ = 145; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | static TEST4: i32 = 145; + | ~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/typeck_type_placeholder_item.rs:19:15 @@ -155,19 +164,23 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:48:26 | LL | fn test11(x: &usize) -> &_ { - | -^ - | || - | |not allowed in type signatures - | help: replace with the correct return type: `&'static &'static usize` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn test11(x: &usize) -> &'static &'static usize { + | ~~~~~~~~~~~~~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/typeck_type_placeholder_item.rs:53:52 | LL | unsafe fn test12(x: *const usize) -> *const *const _ { - | --------------^ - | | | - | | not allowed in type signatures - | help: replace with the correct return type: `*const *const usize` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | unsafe fn test12(x: *const usize) -> *const *const usize { + | ~~~~~~~~~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:59:24 @@ -214,16 +227,23 @@ error: missing type for `static` item --> $DIR/typeck_type_placeholder_item.rs:73:13 | LL | static A = 42; - | ^ help: provide a type for the static variable: `: i32` + | ^ + | +help: provide a type for the static variable + | +LL | static A: i32 = 42; + | +++++ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/typeck_type_placeholder_item.rs:75:15 | LL | static B: _ = 42; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | static B: i32 = 42; + | ~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/typeck_type_placeholder_item.rs:77:15 @@ -235,38 +255,47 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:79:21 | LL | fn fn_test() -> _ { 5 } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `i32` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn fn_test() -> i32 { 5 } + | ~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/typeck_type_placeholder_item.rs:82:23 | LL | fn fn_test2() -> (_, _) { (5, 5) } - | -^--^- - | || | - | || not allowed in type signatures - | |not allowed in type signatures - | help: replace with the correct return type: `(i32, i32)` + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn fn_test2() -> (i32, i32) { (5, 5) } + | ~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/typeck_type_placeholder_item.rs:85:22 | LL | static FN_TEST3: _ = "test"; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `&str` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | static FN_TEST3: &str = "test"; + | ~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/typeck_type_placeholder_item.rs:88:22 | LL | static FN_TEST4: _ = 145; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | static FN_TEST4: i32 = 145; + | ~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for static variables --> $DIR/typeck_type_placeholder_item.rs:91:22 @@ -375,20 +404,25 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:132:30 | LL | fn fn_test12(x: i32) -> (_, _) { (x, x) } - | -^--^- - | || | - | || not allowed in type signatures - | |not allowed in type signatures - | help: replace with the correct return type: `(i32, i32)` + | ^ ^ not allowed in type signatures + | | + | not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn fn_test12(x: i32) -> (i32, i32) { (x, x) } + | ~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/typeck_type_placeholder_item.rs:135:33 | LL | fn fn_test13(x: _) -> (i32, _) { (x, x) } - | ------^- - | | | - | | not allowed in type signatures - | help: replace with the correct return type: `(i32, i32)` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn fn_test13(x: _) -> (i32, i32) { (x, x) } + | ~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item.rs:140:31 @@ -550,28 +584,34 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:194:14 | LL | const D: _ = 42; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | const D: i32 = 42; + | ~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/typeck_type_placeholder_item.rs:217:31 | LL | fn value() -> Option<&'static _> { - | ----------------^- - | | | - | | not allowed in type signatures - | help: replace with the correct return type: `Option<&'static u8>` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn value() -> Option<&'static u8> { + | ~~~~~~~~~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants --> $DIR/typeck_type_placeholder_item.rs:222:10 | LL | const _: Option<_> = map(value); - | ^^^^^^^^^ - | | - | not allowed in type signatures - | help: replace with the correct type: `Option` + | ^^^^^^^^^ not allowed in type signatures + | +help: replace with the correct type + | +LL | const _: Option = map(value); + | ~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants --> $DIR/typeck_type_placeholder_item.rs:206:14 @@ -598,10 +638,12 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:225:31 | LL | fn evens_squared(n: usize) -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with an appropriate return type: `impl Iterator` + | ^ not allowed in type signatures + | +help: replace with an appropriate return type + | +LL | fn evens_squared(n: usize) -> impl Iterator { + | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants --> $DIR/typeck_type_placeholder_item.rs:230:10 @@ -619,19 +661,23 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item.rs:41:24 | LL | fn test9(&self) -> _ { () } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `()` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn test9(&self) -> () { () } + | ~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types --> $DIR/typeck_type_placeholder_item.rs:107:31 | LL | fn fn_test9(&self) -> _ { () } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `()` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn fn_test9(&self) -> () { () } + | ~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated types --> $DIR/typeck_type_placeholder_item.rs:202:14 diff --git a/tests/ui/typeck/typeck_type_placeholder_item_help.stderr b/tests/ui/typeck/typeck_type_placeholder_item_help.stderr index 32585e2937b77..a1a71aceb7be4 100644 --- a/tests/ui/typeck/typeck_type_placeholder_item_help.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_item_help.stderr @@ -2,28 +2,34 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item_help.rs:4:15 | LL | fn test1() -> _ { Some(42) } - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `Option` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | fn test1() -> Option { Some(42) } + | ~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants --> $DIR/typeck_type_placeholder_item_help.rs:7:14 | LL | const TEST2: _ = 42u32; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `u32` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | const TEST2: u32 = 42u32; + | ~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for constants --> $DIR/typeck_type_placeholder_item_help.rs:10:14 | LL | const TEST3: _ = Some(42); - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `Option` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | const TEST3: Option = Some(42); + | ~~~~~~~~~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for functions --> $DIR/typeck_type_placeholder_item_help.rs:13:22 @@ -41,19 +47,23 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/typeck_type_placeholder_item_help.rs:25:18 | LL | const TEST6: _ = 13; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | const TEST6: i32 = 13; + | ~~~ error[E0121]: the placeholder `_` is not allowed within types on item signatures for associated constants --> $DIR/typeck_type_placeholder_item_help.rs:18:18 | LL | const TEST5: _ = 42; - | ^ - | | - | not allowed in type signatures - | help: replace with the correct type: `i32` + | ^ not allowed in type signatures + | +help: replace with the correct type + | +LL | const TEST5: i32 = 42; + | ~~~ error[E0308]: mismatched types --> $DIR/typeck_type_placeholder_item_help.rs:30:28 diff --git a/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr b/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr index e4b1c02c20149..65f07bb08320d 100644 --- a/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr @@ -2,15 +2,18 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl --> $DIR/typeck_type_placeholder_lifetime_1.rs:9:12 | LL | let c: Foo<_, _> = Foo { r: &5 }; - | ^^^ - help: remove this generic argument - | | - | expected 1 generic argument + | ^^^ expected 1 generic argument | note: struct defined here, with 1 generic parameter: `T` --> $DIR/typeck_type_placeholder_lifetime_1.rs:4:8 | LL | struct Foo<'a, T:'a> { | ^^^ - +help: remove this generic argument + | +LL - let c: Foo<_, _> = Foo { r: &5 }; +LL + let c: Foo<_, > = Foo { r: &5 }; + | error: aborting due to 1 previous error diff --git a/tests/ui/typeck/typeck_type_placeholder_lifetime_2.stderr b/tests/ui/typeck/typeck_type_placeholder_lifetime_2.stderr index fcb5ecc4042b0..b07cc225ba875 100644 --- a/tests/ui/typeck/typeck_type_placeholder_lifetime_2.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_lifetime_2.stderr @@ -2,15 +2,18 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl --> $DIR/typeck_type_placeholder_lifetime_2.rs:9:12 | LL | let c: Foo<_, usize> = Foo { r: &5 }; - | ^^^ ----- help: remove this generic argument - | | - | expected 1 generic argument + | ^^^ expected 1 generic argument | note: struct defined here, with 1 generic parameter: `T` --> $DIR/typeck_type_placeholder_lifetime_2.rs:4:8 | LL | struct Foo<'a, T:'a> { | ^^^ - +help: remove this generic argument + | +LL - let c: Foo<_, usize> = Foo { r: &5 }; +LL + let c: Foo<_, > = Foo { r: &5 }; + | error: aborting due to 1 previous error diff --git a/tests/ui/ufcs/ufcs-explicit-self-bad.stderr b/tests/ui/ufcs/ufcs-explicit-self-bad.stderr index c48d094daea20..2a8c4edbdb5f3 100644 --- a/tests/ui/ufcs/ufcs-explicit-self-bad.stderr +++ b/tests/ui/ufcs/ufcs-explicit-self-bad.stderr @@ -2,10 +2,7 @@ error[E0053]: method `dummy2` has an incompatible type for trait --> $DIR/ufcs-explicit-self-bad.rs:37:21 | LL | fn dummy2(self: &Bar) {} - | ------^^^^^^^ - | | | - | | expected `&'a Bar`, found `Bar` - | help: change the self-receiver type to match the trait: `&self` + | ^^^^^^^ expected `&'a Bar`, found `Bar` | note: type in trait --> $DIR/ufcs-explicit-self-bad.rs:31:15 @@ -14,6 +11,10 @@ LL | fn dummy2(&self); | ^^^^^ = note: expected signature `fn(&&'a Bar<_>)` found signature `fn(&Bar<_>)` +help: change the self-receiver type to match the trait + | +LL | fn dummy2(&self) {} + | ~~~~~ error[E0307]: invalid `self` parameter type: `isize` --> $DIR/ufcs-explicit-self-bad.rs:8:18 diff --git a/tests/ui/ufcs/ufcs-partially-resolved.stderr b/tests/ui/ufcs/ufcs-partially-resolved.stderr index eef55c8dc686f..ae24a0ed46948 100644 --- a/tests/ui/ufcs/ufcs-partially-resolved.stderr +++ b/tests/ui/ufcs/ufcs-partially-resolved.stderr @@ -5,16 +5,26 @@ LL | type Y = u16; | ------------- similarly named associated type `Y` defined here ... LL | let _: ::N; - | ^ help: an associated type with a similar name exists: `Y` + | ^ + | +help: an associated type with a similar name exists + | +LL | let _: ::Y; + | ~ error[E0404]: expected trait, found enum `E` --> $DIR/ufcs-partially-resolved.rs:20:19 | LL | let _: ::N; - | ^ help: a trait with a similar name exists: `Eq` + | ^ --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named trait `Eq` defined here + | +help: a trait with a similar name exists + | +LL | let _: ::N; + | ~~ error[E0404]: expected trait, found type alias `A` --> $DIR/ufcs-partially-resolved.rs:21:19 @@ -34,16 +44,26 @@ LL | fn Y() {} | ------ similarly named associated function `Y` defined here ... LL | ::N; - | ^ help: an associated function with a similar name exists: `Y` + | ^ + | +help: an associated function with a similar name exists + | +LL | ::Y; + | ~ error[E0404]: expected trait, found enum `E` --> $DIR/ufcs-partially-resolved.rs:23:12 | LL | ::N; - | ^ help: a trait with a similar name exists: `Eq` + | ^ --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named trait `Eq` defined here + | +help: a trait with a similar name exists + | +LL | ::N; + | ~~ error[E0404]: expected trait, found type alias `A` --> $DIR/ufcs-partially-resolved.rs:24:12 @@ -60,19 +80,29 @@ error[E0404]: expected trait, found enum `E` --> $DIR/ufcs-partially-resolved.rs:26:19 | LL | let _: ::Y; - | ^ help: a trait with a similar name exists: `Eq` + | ^ --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named trait `Eq` defined here + | +help: a trait with a similar name exists + | +LL | let _: ::Y; + | ~~ error[E0404]: expected trait, found enum `E` --> $DIR/ufcs-partially-resolved.rs:28:12 | LL | ::Y; - | ^ help: a trait with a similar name exists: `Eq` + | ^ --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named trait `Eq` defined here + | +help: a trait with a similar name exists + | +LL | ::Y; + | ~~ error[E0576]: cannot find associated type `N` in trait `Tr` --> $DIR/ufcs-partially-resolved.rs:30:24 @@ -81,16 +111,26 @@ LL | type Y = u16; | ------------- similarly named associated type `Y` defined here ... LL | let _: ::N::NN; - | ^ help: an associated type with a similar name exists: `Y` + | ^ + | +help: an associated type with a similar name exists + | +LL | let _: ::Y::NN; + | ~ error[E0404]: expected trait, found enum `E` --> $DIR/ufcs-partially-resolved.rs:31:19 | LL | let _: ::N::NN; - | ^ help: a trait with a similar name exists: `Eq` + | ^ --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named trait `Eq` defined here + | +help: a trait with a similar name exists + | +LL | let _: ::N::NN; + | ~~ error[E0404]: expected trait, found type alias `A` --> $DIR/ufcs-partially-resolved.rs:32:19 @@ -110,16 +150,26 @@ LL | type Y = u16; | ------------- similarly named associated type `Y` defined here ... LL | ::N::NN; - | ^ help: an associated type with a similar name exists: `Y` + | ^ + | +help: an associated type with a similar name exists + | +LL | ::Y::NN; + | ~ error[E0404]: expected trait, found enum `E` --> $DIR/ufcs-partially-resolved.rs:34:12 | LL | ::N::NN; - | ^ help: a trait with a similar name exists: `Eq` + | ^ --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named trait `Eq` defined here + | +help: a trait with a similar name exists + | +LL | ::N::NN; + | ~~ error[E0404]: expected trait, found type alias `A` --> $DIR/ufcs-partially-resolved.rs:35:12 @@ -136,19 +186,29 @@ error[E0404]: expected trait, found enum `E` --> $DIR/ufcs-partially-resolved.rs:37:19 | LL | let _: ::Y::NN; - | ^ help: a trait with a similar name exists: `Eq` + | ^ --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named trait `Eq` defined here + | +help: a trait with a similar name exists + | +LL | let _: ::Y::NN; + | ~~ error[E0404]: expected trait, found enum `E` --> $DIR/ufcs-partially-resolved.rs:39:12 | LL | ::Y::NN; - | ^ help: a trait with a similar name exists: `Eq` + | ^ --> $SRC_DIR/core/src/cmp.rs:LL:COL | = note: similarly named trait `Eq` defined here + | +help: a trait with a similar name exists + | +LL | ::Y::NN; + | ~~ error[E0405]: cannot find trait `N` in trait `Tr` --> $DIR/ufcs-partially-resolved.rs:41:23 @@ -217,9 +277,12 @@ LL | type X = u16; | ------------- similarly named associated type `X` defined here ... LL | let _: ::Z; - | ^^^^^^^^^^^^- - | | - | help: an associated type with a similar name exists: `X` + | ^^^^^^^^^^^^^ + | +help: an associated type with a similar name exists + | +LL | let _: ::X; + | ~ error[E0575]: expected method or associated constant, found associated type `Dr::X` --> $DIR/ufcs-partially-resolved.rs:53:5 @@ -228,11 +291,13 @@ LL | fn Z() {} | ------ similarly named associated function `Z` defined here ... LL | ::X; - | ^^^^^^^^^^^^- - | | - | help: an associated function with a similar name exists: `Z` + | ^^^^^^^^^^^^^ | = note: can't use a type alias as a constructor +help: an associated function with a similar name exists + | +LL | ::Z; + | ~ error[E0575]: expected associated type, found associated function `Dr::Z` --> $DIR/ufcs-partially-resolved.rs:54:12 @@ -241,9 +306,12 @@ LL | type X = u16; | ------------- similarly named associated type `X` defined here ... LL | let _: ::Z::N; - | ^^^^^^^^^^^^-^^^ - | | - | help: an associated type with a similar name exists: `X` + | ^^^^^^^^^^^^^^^^ + | +help: an associated type with a similar name exists + | +LL | let _: ::X::N; + | ~ error[E0223]: ambiguous associated type --> $DIR/ufcs-partially-resolved.rs:36:12 diff --git a/tests/ui/ufcs/ufcs-qpath-missing-params.stderr b/tests/ui/ufcs/ufcs-qpath-missing-params.stderr index 2338871218b1c..0ae92d204b6fb 100644 --- a/tests/ui/ufcs/ufcs-qpath-missing-params.stderr +++ b/tests/ui/ufcs/ufcs-qpath-missing-params.stderr @@ -34,15 +34,18 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/ufcs-qpath-missing-params.rs:17:26 | LL | ::into_cow::("foo".to_string()); - | ^^^^^^^^------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^^^^^ expected 0 generic arguments | note: method defined here, with 0 generic parameters --> $DIR/ufcs-qpath-missing-params.rs:4:8 | LL | fn into_cow(self) -> Cow<'a, B>; | ^^^^^^^^ +help: remove these generics + | +LL - ::into_cow::("foo".to_string()); +LL + ::into_cow("foo".to_string()); + | error: aborting due to 3 previous errors diff --git a/tests/ui/unboxed-closures/unboxed-closure-immutable-capture.stderr b/tests/ui/unboxed-closures/unboxed-closure-immutable-capture.stderr index ad5451ced55d0..96c9001387008 100644 --- a/tests/ui/unboxed-closures/unboxed-closure-immutable-capture.stderr +++ b/tests/ui/unboxed-closures/unboxed-closure-immutable-capture.stderr @@ -1,73 +1,90 @@ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/unboxed-closure-immutable-capture.rs:9:13 | -LL | let x = 0; - | - help: consider changing this to be mutable: `mut x` LL | move || x = 1; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut x = 0; + | ~~~~~ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/unboxed-closure-immutable-capture.rs:10:17 | -LL | let x = 0; - | - help: consider changing this to be mutable: `mut x` -LL | move || x = 1; LL | move || set(&mut x); | ^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | let mut x = 0; + | ~~~~~ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/unboxed-closure-immutable-capture.rs:11:13 | -LL | let x = 0; - | - help: consider changing this to be mutable: `mut x` -... LL | move || x = 1; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut x = 0; + | ~~~~~ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/unboxed-closure-immutable-capture.rs:12:17 | -LL | let x = 0; - | - help: consider changing this to be mutable: `mut x` -... LL | move || set(&mut x); | ^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | let mut x = 0; + | ~~~~~ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/unboxed-closure-immutable-capture.rs:13:8 | -LL | let x = 0; - | - help: consider changing this to be mutable: `mut x` -... LL | || x = 1; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut x = 0; + | ~~~~~ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/unboxed-closure-immutable-capture.rs:14:12 | -LL | let x = 0; - | - help: consider changing this to be mutable: `mut x` -... LL | || set(&mut x); | ^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | let mut x = 0; + | ~~~~~ error[E0594]: cannot assign to `x`, as it is not declared as mutable --> $DIR/unboxed-closure-immutable-capture.rs:15:8 | -LL | let x = 0; - | - help: consider changing this to be mutable: `mut x` -... LL | || x = 1; | ^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut x = 0; + | ~~~~~ error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable --> $DIR/unboxed-closure-immutable-capture.rs:16:12 | -LL | let x = 0; - | - help: consider changing this to be mutable: `mut x` -... LL | || set(&mut x); | ^^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | let mut x = 0; + | ~~~~~ error: aborting due to 8 previous errors diff --git a/tests/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr b/tests/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr index e6f34d7e3b4b7..67380721c9f50 100644 --- a/tests/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr +++ b/tests/ui/unboxed-closures/unboxed-closure-sugar-not-used-on-fn.stderr @@ -2,21 +2,29 @@ error[E0658]: the precise format of `Fn`-family traits' type parameters is subje --> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:3:17 | LL | fn bar1(x: &dyn Fn<(), Output=()>) { - | ^^^^^^^^^^^^^^^^^ help: use parenthetical notation instead: `Fn() -> ()` + | ^^^^^^^^^^^^^^^^^ | = note: see issue #29625 for more information = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: use parenthetical notation instead + | +LL | fn bar1(x: &dyn Fn() -> ()) { + | ~~~~~~~~~~ error[E0658]: the precise format of `Fn`-family traits' type parameters is subject to change --> $DIR/unboxed-closure-sugar-not-used-on-fn.rs:7:28 | LL | fn bar2(x: &T) where T: Fn<()> { - | ^^^^^^ help: use parenthetical notation instead: `Fn() -> ()` + | ^^^^^^ | = note: see issue #29625 for more information = help: add `#![feature(unboxed_closures)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date +help: use parenthetical notation instead + | +LL | fn bar2(x: &T) where T: Fn() -> () { + | ~~~~~~~~~~ error: aborting due to 2 previous errors diff --git a/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr b/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr index 5a2de132d70e7..ac56d1d05fae5 100644 --- a/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr +++ b/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr @@ -2,15 +2,18 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:5:17 | LL | fn foo1(_: &dyn Zero()) { - | ^^^^-- help: remove these parenthetical generics - | | - | expected 0 generic arguments + | ^^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:3:7 | LL | trait Zero { fn dummy(&self); } | ^^^^ +help: remove these parenthetical generics + | +LL - fn foo1(_: &dyn Zero()) { +LL + fn foo1(_: &dyn Zero) { + | error[E0220]: associated type `Output` not found for `Zero` --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:5:17 @@ -22,43 +25,52 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:10:17 | LL | fn foo2(_: &dyn Zero) { - | ^^^^------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:3:7 | LL | trait Zero { fn dummy(&self); } | ^^^^ +help: remove these generics + | +LL - fn foo2(_: &dyn Zero) { +LL + fn foo2(_: &dyn Zero) { + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:14:17 | LL | fn foo3(_: &dyn Zero < usize >) { - | ^^^^-------------- help: remove these generics - | | - | expected 0 generic arguments + | ^^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:3:7 | LL | trait Zero { fn dummy(&self); } | ^^^^ +help: remove these generics + | +LL - fn foo3(_: &dyn Zero < usize >) { +LL + fn foo3(_: &dyn Zero) { + | error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:18:17 | LL | fn foo4(_: &dyn Zero(usize)) { - | ^^^^------- help: remove these parenthetical generics - | | - | expected 0 generic arguments + | ^^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:3:7 | LL | trait Zero { fn dummy(&self); } | ^^^^ +help: remove these parenthetical generics + | +LL - fn foo4(_: &dyn Zero(usize)) { +LL + fn foo4(_: &dyn Zero) { + | error[E0220]: associated type `Output` not found for `Zero` --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:18:17 @@ -70,15 +82,18 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:23:17 | LL | fn foo5(_: &dyn Zero ( usize )) { - | ^^^^-------------- help: remove these parenthetical generics - | | - | expected 0 generic arguments + | ^^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:3:7 | LL | trait Zero { fn dummy(&self); } | ^^^^ +help: remove these parenthetical generics + | +LL - fn foo5(_: &dyn Zero ( usize )) { +LL + fn foo5(_: &dyn Zero) { + | error[E0220]: associated type `Output` not found for `Zero` --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:23:17 diff --git a/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr b/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr index 130b193d69c93..3736f25a51ff9 100644 --- a/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr +++ b/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr @@ -2,15 +2,18 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/unboxed-closure-sugar-wrong-trait.rs:5:8 | LL | fn f isize>(x: F) {} - | ^^^^^------- help: remove these parenthetical generics - | | - | expected 0 generic arguments + | ^^^^^ expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/unboxed-closure-sugar-wrong-trait.rs:3:7 | LL | trait Trait {} | ^^^^^ +help: remove these parenthetical generics + | +LL - fn f isize>(x: F) {} +LL + fn f isize>(x: F) {} + | error[E0220]: associated type `Output` not found for `Trait` --> $DIR/unboxed-closure-sugar-wrong-trait.rs:5:24 diff --git a/tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr b/tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr index 5c93ed6d7f70f..78c7851a7e8c0 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.stderr @@ -1,13 +1,16 @@ error[E0596]: cannot borrow `tick1` as mutable, as it is not declared as mutable --> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:16:9 | -LL | let tick1 = || { - | ----- help: consider changing this to be mutable: `mut tick1` LL | counter += 1; | ------- calling `tick1` requires mutable binding due to mutable borrow of `counter` ... LL | tick1(); | ^^^^^ cannot borrow as mutable + | +help: consider changing this to be mutable + | +LL | let mut tick1 = || { + | ~~~~~~~~~ error[E0596]: cannot borrow `tick2` as mutable, as it is not declared as mutable --> $DIR/unboxed-closures-infer-fnmut-calling-fnmut-no-mut.rs:19:5 diff --git a/tests/ui/unboxed-closures/unboxed-closures-mutate-upvar.stderr b/tests/ui/unboxed-closures/unboxed-closures-mutate-upvar.stderr index 26f97b51913df..9341858a74846 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-mutate-upvar.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-mutate-upvar.stderr @@ -1,29 +1,35 @@ error[E0594]: cannot assign to `n`, as it is not declared as mutable --> $DIR/unboxed-closures-mutate-upvar.rs:15:9 | -LL | let n = 0; - | - help: consider changing this to be mutable: `mut n` -LL | let mut f = to_fn_mut(|| { LL | n += 1; | ^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut n = 0; + | ~~~~~ error[E0594]: cannot assign to `n`, as it is not declared as mutable --> $DIR/unboxed-closures-mutate-upvar.rs:32:9 | -LL | let n = 0; - | - help: consider changing this to be mutable: `mut n` -... LL | n += 1; | ^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut n = 0; + | ~~~~~ error[E0594]: cannot assign to `n`, as it is not declared as mutable --> $DIR/unboxed-closures-mutate-upvar.rs:46:9 | -LL | let n = 0; - | - help: consider changing this to be mutable: `mut n` -LL | let mut f = to_fn(move || { LL | n += 1; | ^^^^^^ cannot assign + | +help: consider changing this to be mutable + | +LL | let mut n = 0; + | ~~~~~ error[E0594]: cannot assign to `n`, as it is a captured variable in a `Fn` closure --> $DIR/unboxed-closures-mutate-upvar.rs:53:9 diff --git a/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr b/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr index 5f22c781345ff..88ba4aa15b99c 100644 --- a/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr +++ b/tests/ui/unboxed-closures/unboxed-closures-type-mismatch-closure-from-another-scope.stderr @@ -8,7 +8,12 @@ error[E0425]: cannot find value `y` in this scope --> $DIR/unboxed-closures-type-mismatch-closure-from-another-scope.rs:9:26 | LL | closure(&mut p, &y); - | ^ help: a local variable with a similar name exists: `p` + | ^ + | +help: a local variable with a similar name exists + | +LL | closure(&mut p, &p); + | ~ error[E0308]: mismatched types --> $DIR/unboxed-closures-type-mismatch-closure-from-another-scope.rs:9:17 diff --git a/tests/ui/unsafe/unsafe-fn-autoderef.stderr b/tests/ui/unsafe/unsafe-fn-autoderef.stderr index c3ab802022267..fbdaf9dcea763 100644 --- a/tests/ui/unsafe/unsafe-fn-autoderef.stderr +++ b/tests/ui/unsafe/unsafe-fn-autoderef.stderr @@ -2,10 +2,12 @@ error[E0609]: no field `f` on type `*const Rec` --> $DIR/unsafe-fn-autoderef.rs:19:14 | LL | return p.f; - | --^ - | | | - | | unknown field - | help: `p` is a raw pointer; try dereferencing it: `(*p).f` + | ^ unknown field + | +help: `p` is a raw pointer; try dereferencing it + | +LL | return (*p).f; + | ~~~~~~ error: aborting due to 1 previous error diff --git a/tests/ui/unsigned-literal-negation.stderr b/tests/ui/unsigned-literal-negation.stderr index 0aaa8c3b72f9d..846d778d09dd7 100644 --- a/tests/ui/unsigned-literal-negation.stderr +++ b/tests/ui/unsigned-literal-negation.stderr @@ -2,34 +2,37 @@ error[E0600]: cannot apply unary operator `-` to type `usize` --> $DIR/unsigned-literal-negation.rs:2:13 | LL | let x = -1 as usize; - | ^^ - | | - | cannot apply unary operator `-` - | help: you may have meant the maximum value of `usize`: `usize::MAX` + | ^^ cannot apply unary operator `-` | = note: unsigned values cannot be negated +help: you may have meant the maximum value of `usize` + | +LL | let x = usize::MAX as usize; + | ~~~~~~~~~~ error[E0600]: cannot apply unary operator `-` to type `usize` --> $DIR/unsigned-literal-negation.rs:3:13 | LL | let x = (-1) as usize; - | ^^^^ - | | - | cannot apply unary operator `-` - | help: you may have meant the maximum value of `usize`: `usize::MAX` + | ^^^^ cannot apply unary operator `-` | = note: unsigned values cannot be negated +help: you may have meant the maximum value of `usize` + | +LL | let x = usize::MAX as usize; + | ~~~~~~~~~~ error[E0600]: cannot apply unary operator `-` to type `u32` --> $DIR/unsigned-literal-negation.rs:4:18 | LL | let x: u32 = -1; - | ^^ - | | - | cannot apply unary operator `-` - | help: you may have meant the maximum value of `u32`: `u32::MAX` + | ^^ cannot apply unary operator `-` | = note: unsigned values cannot be negated +help: you may have meant the maximum value of `u32` + | +LL | let x: u32 = u32::MAX; + | ~~~~~~~~ error: aborting due to 3 previous errors diff --git a/tests/ui/variance/leaking-unnameables.stderr b/tests/ui/variance/leaking-unnameables.stderr index 92afe952801d0..70cf6afbfc57e 100644 --- a/tests/ui/variance/leaking-unnameables.stderr +++ b/tests/ui/variance/leaking-unnameables.stderr @@ -2,10 +2,12 @@ error[E0121]: the placeholder `_` is not allowed within types on item signatures --> $DIR/leaking-unnameables.rs:8:18 | LL | pub fn f() -> _ { - | ^ - | | - | not allowed in type signatures - | help: replace with the correct return type: `fn()` + | ^ not allowed in type signatures + | +help: replace with the correct return type + | +LL | pub fn f() -> fn() { + | ~~~~ error: aborting due to 1 previous error