From 921de9d8eae16947c375febe0ab8709797b37119 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Mon, 22 Jul 2024 22:51:53 +0000 Subject: [PATCH] Revert suggestion verbosity change --- .../errors/wrong_number_of_generic_args.rs | 6 +- .../invalid_const_in_lifetime_position.stderr | 27 +- tests/rustdoc-ui/mismatched_arg_count.stderr | 9 +- .../argument-suggestions/issue-100154.stderr | 9 +- ...ssue-82126-mismatched-subst-and-hir.stderr | 18 +- .../transmutable-ice-110969.stderr | 10 +- .../generic_arg_infer/infer-arg-test.stderr | 9 +- .../const_kind_expr/issue_114151.stderr | 9 +- .../generic_const_exprs/issue-102768.stderr | 27 +- .../incorrect-number-of-const-args.stderr | 9 +- .../invalid-const-arg-for-type-param.stderr | 9 +- .../invalid-constant-in-args.stderr | 10 +- tests/ui/constructor-lifetime-args.stderr | 18 +- tests/ui/consts/effect_param.stderr | 40 +-- tests/ui/error-codes/E0107.stderr | 72 ++--- .../gat-trait-path-parenthesised-args.stderr | 27 +- .../parameter_number_and_kind.stderr | 18 +- ...it-path-type-error-once-implemented.stderr | 27 +- .../generics/bad-mid-path-type-params.stderr | 45 +-- .../generics/foreign-generic-mismatch.stderr | 9 +- .../generic-arg-mismatch-recover.stderr | 27 +- ...eric-impl-more-params-with-defaults.stderr | 9 +- ...eric-type-more-params-with-defaults.stderr | 9 +- tests/ui/generics/wrong-number-of-args.stderr | 256 ++++++------------ .../explicit-generic-args-for-impl.stderr | 9 +- .../opaque-and-lifetime-mismatch.stderr | 27 +- tests/ui/issues/issue-18423.stderr | 10 +- tests/ui/issues/issue-53251.stderr | 18 +- tests/ui/issues/issue-60622.stderr | 9 +- .../mismatched_arg_count.stderr | 9 +- .../ui/lifetimes/noisy-follow-up-erro.stderr | 9 +- .../method-call-lifetime-args-fail.stderr | 18 +- tests/ui/resolve/issue-3214.stderr | 9 +- ...o-explicit-const-params-cross-crate.stderr | 18 +- .../effects/no-explicit-const-params.stderr | 18 +- tests/ui/seq-args.stderr | 18 +- .../struct-path-associated-type.stderr | 18 +- ...structure-constructor-type-mismatch.stderr | 18 +- tests/ui/suggestions/issue-101421.stderr | 9 +- tests/ui/suggestions/issue-104287.stderr | 9 +- tests/ui/suggestions/issue-89064.stderr | 9 +- ...assoc-type-suggestion-in-trait-impl.stderr | 9 +- tests/ui/traits/object/vs-lifetime.stderr | 9 +- tests/ui/traits/test-2.stderr | 18 +- .../ui/transmutability/issue-101739-2.stderr | 20 +- .../enum-variant-generic-args.stderr | 54 ++-- ...ypeck-builtin-bound-type-parameters.stderr | 78 ++---- .../typeck_type_placeholder_lifetime_1.stderr | 9 +- .../typeck_type_placeholder_lifetime_2.stderr | 9 +- .../ui/ufcs/ufcs-qpath-missing-params.stderr | 9 +- ...wrong-number-number-type-parameters.stderr | 45 +-- .../unboxed-closure-sugar-wrong-trait.stderr | 9 +- 52 files changed, 402 insertions(+), 811 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs b/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs index 7443070b9de..db91a6ab2f4 100644 --- a/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs +++ b/compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs @@ -954,7 +954,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> { let msg_lifetimes = format!("remove the lifetime argument{s}", s = pluralize!(num_redundant_lt_args)); - err.span_suggestion_verbose( + err.span_suggestion( span_redundant_lt_args, msg_lifetimes, "", @@ -1000,7 +1000,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> { s = pluralize!(num_redundant_gen_args), ); - err.span_suggestion_verbose( + err.span_suggestion( span_redundant_type_or_const_args, msg_types_or_consts, "", @@ -1050,7 +1050,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> { }, ); - err.span_suggestion_verbose(span, msg, "", Applicability::MaybeIncorrect); + err.span_suggestion(span, msg, "", Applicability::MaybeIncorrect); } else if redundant_lifetime_args && redundant_type_or_const_args { remove_lifetime_args(err); remove_type_or_const_args(err); diff --git a/tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr b/tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr index 755a0bba508..ef551cbea3e 100644 --- a/tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr +++ b/tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr @@ -18,18 +18,15 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/invalid_const_in_lifetime_position.rs:4:26 | LL | fn f<'a>(arg : Box = &'a ()>>) {} - | ^ expected 0 generic arguments + | ^--- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/invalid_const_in_lifetime_position.rs:2:10 | LL | type Y<'a>; | ^ -help: remove the unnecessary generics - | -LL - fn f<'a>(arg : Box = &'a ()>>) {} -LL + fn f<'a>(arg : Box>) {} - | error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied --> $DIR/invalid_const_in_lifetime_position.rs:4:26 @@ -52,7 +49,9 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/invalid_const_in_lifetime_position.rs:4:26 | LL | fn f<'a>(arg : Box = &'a ()>>) {} - | ^ expected 0 generic arguments + | ^--- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/invalid_const_in_lifetime_position.rs:2:10 @@ -60,11 +59,6 @@ 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 the unnecessary generics - | -LL - fn f<'a>(arg : Box = &'a ()>>) {} -LL + fn f<'a>(arg : Box>) {} - | error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied --> $DIR/invalid_const_in_lifetime_position.rs:4:26 @@ -87,7 +81,9 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/invalid_const_in_lifetime_position.rs:4:26 | LL | fn f<'a>(arg : Box = &'a ()>>) {} - | ^ expected 0 generic arguments + | ^--- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/invalid_const_in_lifetime_position.rs:2:10 @@ -95,11 +91,6 @@ 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 the unnecessary generics - | -LL - fn f<'a>(arg : Box = &'a ()>>) {} -LL + fn f<'a>(arg : Box>) {} - | error[E0038]: the trait `X` cannot be made into an object --> $DIR/invalid_const_in_lifetime_position.rs:4:20 diff --git a/tests/rustdoc-ui/mismatched_arg_count.stderr b/tests/rustdoc-ui/mismatched_arg_count.stderr index 9a698d8f5ad..5daeef2eb18 100644 --- a/tests/rustdoc-ui/mismatched_arg_count.stderr +++ b/tests/rustdoc-ui/mismatched_arg_count.stderr @@ -2,18 +2,15 @@ error[E0107]: type alias takes 1 lifetime argument but 2 lifetime arguments were --> $DIR/mismatched_arg_count.rs:7:29 | LL | fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {} - | ^^^^^ expected 1 lifetime argument + | ^^^^^ ---- help: remove the lifetime argument + | | + | expected 1 lifetime argument | note: type alias defined here, with 1 lifetime parameter: `'a` --> $DIR/mismatched_arg_count.rs:5:6 | LL | type Alias<'a, T> = >::Assoc; | ^^^^^ -- -help: remove the 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/argument-suggestions/issue-100154.stderr b/tests/ui/argument-suggestions/issue-100154.stderr index 8a650099b81..7eaebcafb59 100644 --- a/tests/ui/argument-suggestions/issue-100154.stderr +++ b/tests/ui/argument-suggestions/issue-100154.stderr @@ -2,7 +2,9 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/issue-100154.rs:4:5 | LL | foo::<()>(()); - | ^^^ expected 0 generic arguments + | ^^^------ help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: function defined here, with 0 generic parameters --> $DIR/issue-100154.rs:1:4 @@ -10,11 +12,6 @@ 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 the unnecessary generics - | -LL - foo::<()>(()); -LL + foo(()); - | error[E0277]: `()` doesn't implement `std::fmt::Display` --> $DIR/issue-100154.rs:4:11 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 aaca4dc91c9..e9efc932ea8 100644 --- a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr +++ b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr @@ -2,18 +2,15 @@ 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<'_> { - | ^^^^^^^^^^^^ expected 0 lifetime arguments + | ^^^^^^^^^^^^---- help: remove the unnecessary generics + | | + | 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 the unnecessary 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 @@ -35,7 +32,9 @@ 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<'_> { - | ^^^^^^^^^^^^ expected 0 lifetime arguments + | ^^^^^^^^^^^^---- help: remove the unnecessary generics + | | + | expected 0 lifetime arguments | note: struct defined here, with 0 lifetime parameters --> $DIR/issue-82126-mismatched-subst-and-hir.rs:24:8 @@ -43,11 +42,6 @@ note: struct defined here, with 0 lifetime parameters LL | struct LockedMarket(T); | ^^^^^^^^^^^^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -help: remove the unnecessary 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/const-generics/adt_const_params/transmutable-ice-110969.stderr b/tests/ui/const-generics/adt_const_params/transmutable-ice-110969.stderr index ceac2c95bfa..5c04c4c9d5b 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,13 +2,9 @@ error[E0107]: trait takes at most 2 generic arguments but 3 generic arguments we --> $DIR/transmutable-ice-110969.rs:11:14 | LL | Dst: BikeshedIntrinsicFrom, - | ^^^^^^^^^^^^^^^^^^^^^ expected at most 2 generic arguments - | -help: remove the unnecessary generic argument - | -LL - Dst: BikeshedIntrinsicFrom, -LL + Dst: BikeshedIntrinsicFrom, - | + | ^^^^^^^^^^^^^^^^^^^^^ -------- help: remove the unnecessary generic argument + | | + | expected at most 2 generic arguments error[E0308]: mismatched types --> $DIR/transmutable-ice-110969.rs:25:74 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 61688f3acab..a9c57dbf26a 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,18 +23,15 @@ error[E0107]: struct takes 2 generic arguments but 3 generic arguments were supp --> $DIR/infer-arg-test.rs:18:10 | LL | let a: All<_, _, _>; - | ^^^ expected 2 generic arguments + | ^^^ --- help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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 c66f351ea7f..4d1fb02b59e 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,18 +2,15 @@ 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]); - | ^^^ expected 1 generic argument + | ^^^ --- help: remove the unnecessary 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 the unnecessary 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/issue-102768.stderr b/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr index 41621911752..37e09a075fe 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr @@ -18,18 +18,15 @@ 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 ()>>) {} - | ^ expected 0 generic arguments + | ^--- help: remove the unnecessary generics + | | + | 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 the unnecessary 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 @@ -52,7 +49,9 @@ 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 ()>>) {} - | ^ expected 0 generic arguments + | ^--- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/issue-102768.rs:5:10 @@ -60,11 +59,6 @@ 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 the unnecessary 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 @@ -87,7 +81,9 @@ 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 ()>>) {} - | ^ expected 0 generic arguments + | ^--- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/issue-102768.rs:5:10 @@ -95,11 +91,6 @@ 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 the unnecessary 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/incorrect-number-of-const-args.stderr b/tests/ui/const-generics/incorrect-number-of-const-args.stderr index f670ebc8ab0..09c963c350e 100644 --- a/tests/ui/const-generics/incorrect-number-of-const-args.stderr +++ b/tests/ui/const-generics/incorrect-number-of-const-args.stderr @@ -20,18 +20,15 @@ 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>(); - | ^^^ expected 2 generic arguments + | ^^^ --- help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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 dadb6734331..4004ad19032 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,18 +27,15 @@ 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>; - | ^ expected 0 generic arguments + | ^----- help: remove the unnecessary generics + | | + | 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 the unnecessary 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 c3a3f251d46..3e1263e8e8c 100644 --- a/tests/ui/const-generics/invalid-constant-in-args.stderr +++ b/tests/ui/const-generics/invalid-constant-in-args.stderr @@ -2,13 +2,9 @@ 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(""); - | ^^^^ expected 1 generic argument - | -help: remove the unnecessary generic argument - | -LL - let _: Cell<&str, "a"> = Cell::new(""); -LL + let _: Cell<&str> = Cell::new(""); - | + | ^^^^ ----- help: remove the unnecessary generic argument + | | + | expected 1 generic argument error: aborting due to 1 previous error diff --git a/tests/ui/constructor-lifetime-args.stderr b/tests/ui/constructor-lifetime-args.stderr index 980a812e3b4..d3759f4b365 100644 --- a/tests/ui/constructor-lifetime-args.stderr +++ b/tests/ui/constructor-lifetime-args.stderr @@ -20,18 +20,15 @@ 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); - | ^ expected 2 lifetime arguments + | ^ --------- help: remove the lifetime argument + | | + | 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 the 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 @@ -55,18 +52,15 @@ 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); - | ^ expected 2 lifetime arguments + | ^ --------- help: remove the lifetime argument + | | + | 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 the 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/effect_param.stderr b/tests/ui/consts/effect_param.stderr index fafc20b4192..c63be8035f3 100644 --- a/tests/ui/consts/effect_param.stderr +++ b/tests/ui/consts/effect_param.stderr @@ -2,49 +2,33 @@ 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); - | ^^^^^^^^^^^ expected 0 generic arguments - | -help: remove the unnecessary generics - | -LL - i8::checked_sub::(42, 43); -LL + i8::checked_sub(42, 43); - | + | ^^^^^^^^^^^--------- help: remove the unnecessary generics + | | + | expected 0 generic arguments 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); - | ^^^^^^^^^^^ expected 0 generic arguments - | -help: remove the unnecessary generics - | -LL - i8::checked_sub::(42, 43); -LL + i8::checked_sub(42, 43); - | + | ^^^^^^^^^^^-------- help: remove the unnecessary generics + | | + | expected 0 generic arguments 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); - | ^^^^^^^^^^^ expected 0 generic arguments - | -help: remove the unnecessary generics - | -LL - i8::checked_sub::(42, 43); -LL + i8::checked_sub(42, 43); - | + | ^^^^^^^^^^^-------- help: remove the unnecessary generics + | | + | expected 0 generic arguments 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); - | ^^^^^^^^^^^ expected 0 generic arguments - | -help: remove the unnecessary generics - | -LL - i8::checked_sub::(42, 43); -LL + i8::checked_sub(42, 43); - | + | ^^^^^^^^^^^--------- help: remove the unnecessary generics + | | + | expected 0 generic arguments error: aborting due to 4 previous errors diff --git a/tests/ui/error-codes/E0107.stderr b/tests/ui/error-codes/E0107.stderr index 3271abd8a79..4aa83cf7f5f 100644 --- a/tests/ui/error-codes/E0107.stderr +++ b/tests/ui/error-codes/E0107.stderr @@ -20,137 +20,113 @@ error[E0107]: enum takes 0 lifetime arguments but 1 lifetime argument was suppli --> $DIR/E0107.rs:17:10 | LL | bar: Bar<'a>, - | ^^^ expected 0 lifetime arguments + | ^^^---- help: remove the unnecessary generics + | | + | expected 0 lifetime arguments | note: enum defined here, with 0 lifetime parameters --> $DIR/E0107.rs:6:6 | LL | enum Bar { | ^^^ -help: remove the unnecessary 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>, - | ^^^ expected 1 lifetime argument + | ^^^ -------- help: remove the lifetime arguments + | | + | 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 the 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>, - | ^^^ expected 1 lifetime argument + | ^^^ ---- help: remove the 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 the 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>, - | ^^^ expected 1 lifetime argument + | ^^^ --------- help: remove the 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 the lifetime argument - | -LL - qux2: Qux<'a, i32, 'b>, -LL + qux2: Qux<'a>, - | 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>, - | ^^^ expected 1 lifetime argument + | ^^^ -------- help: remove the lifetime arguments + | | + | 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 the 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>, - | ^^^ expected 1 lifetime argument + | ^^^ ------------- help: remove the lifetime arguments + | | + | 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 the lifetime arguments - | -LL - qux4: Qux<'a, i32, 'b, 'c>, -LL + qux4: Qux<'a>, - | 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>, - | ^^^ expected 1 lifetime argument + | ^^^ ---- help: remove the 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 the 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>, - | ^^^^ expected 0 lifetime arguments + | ^^^^ -- help: remove the lifetime argument + | | + | expected 0 lifetime arguments | note: struct defined here, with 0 lifetime parameters --> $DIR/E0107.rs:4:8 | LL | struct Quux(T); | ^^^^ -help: remove the 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/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr index 252d81fa6f3..9d8e91c02ca 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,18 +43,15 @@ 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>) {} - | ^ expected 0 generic arguments + | ^---- help: remove the unnecessary generics + | | + | 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 the unnecessary 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 @@ -77,7 +74,9 @@ 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>) {} - | ^ expected 0 generic arguments + | ^---- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 @@ -85,11 +84,6 @@ 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 the unnecessary 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 @@ -112,7 +106,9 @@ 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>) {} - | ^ expected 0 generic arguments + | ^---- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/gat-trait-path-parenthesised-args.rs:2:8 @@ -120,11 +116,6 @@ 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 the unnecessary 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/parameter_number_and_kind.stderr b/tests/ui/generic-associated-types/parameter_number_and_kind.stderr index 1c9351cb351..4a20cf55cae 100644 --- a/tests/ui/generic-associated-types/parameter_number_and_kind.stderr +++ b/tests/ui/generic-associated-types/parameter_number_and_kind.stderr @@ -2,18 +2,15 @@ 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>; - | ^ expected 1 lifetime argument + | ^ --------- help: remove the 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 the 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 @@ -35,18 +32,15 @@ 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>; - | ^ expected 1 generic argument + | ^ ----- help: remove the unnecessary 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 the unnecessary 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 6ea96b6228e..539b6695e9e 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,18 +18,15 @@ 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 ()>>) {} - | ^ expected 0 generic arguments + | ^--- help: remove the unnecessary generics + | | + | 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 the unnecessary 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 @@ -52,7 +49,9 @@ 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 ()>>) {} - | ^ expected 0 generic arguments + | ^--- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/trait-path-type-error-once-implemented.rs:2:10 @@ -60,11 +59,6 @@ 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 the unnecessary 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 @@ -87,7 +81,9 @@ 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 ()>>) {} - | ^ expected 0 generic arguments + | ^--- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: associated type defined here, with 0 generic parameters --> $DIR/trait-path-type-error-once-implemented.rs:2:10 @@ -95,11 +91,6 @@ 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 the unnecessary 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/generics/bad-mid-path-type-params.stderr b/tests/ui/generics/bad-mid-path-type-params.stderr index cff5464dce4..de3c0289fc6 100644 --- a/tests/ui/generics/bad-mid-path-type-params.stderr +++ b/tests/ui/generics/bad-mid-path-type-params.stderr @@ -2,86 +2,71 @@ 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); - | ^^^ expected 1 generic argument + | ^^^ ---- help: remove the unnecessary 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 the unnecessary 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); - | ^ expected 0 lifetime arguments + | ^ -- help: remove the lifetime argument + | | + | 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 the 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); - | ^^^ expected 1 generic argument + | ^^^ ---- help: remove the unnecessary 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 the unnecessary 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); - | ^^^^^ expected 0 lifetime arguments + | ^^^^^ -- help: remove the lifetime argument + | | + | 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 the 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); - | ^^^ expected 1 generic argument + | ^^^ ---- help: remove the unnecessary 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 the unnecessary 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 4cf76cde920..32beac41b21 100644 --- a/tests/ui/generics/foreign-generic-mismatch.stderr +++ b/tests/ui/generics/foreign-generic-mismatch.stderr @@ -20,18 +20,15 @@ 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>(); - | ^^^^^^ expected 1 lifetime argument + | ^^^^^^ --------- help: remove the 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 the 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 d2953e37c8c..172683a8f9b 100644 --- a/tests/ui/generics/generic-arg-mismatch-recover.stderr +++ b/tests/ui/generics/generic-arg-mismatch-recover.stderr @@ -2,52 +2,43 @@ 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); - | ^^^ expected 1 lifetime argument + | ^^^ --------- help: remove the 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 the 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, ()>(&()); - | ^^^ expected 1 lifetime argument + | ^^^ --------- help: remove the 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 the 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, ()>(&()); - | ^^^ expected 0 generic arguments + | ^^^ -- help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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 a180e348a68..16bdc2de252 100644 --- a/tests/ui/generics/generic-impl-more-params-with-defaults.stderr +++ b/tests/ui/generics/generic-impl-more-params-with-defaults.stderr @@ -2,18 +2,15 @@ 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(); - | ^^^ expected at most 2 generic arguments + | ^^^ ------ help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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 9b73b7375d7..1eb76e043e0 100644 --- a/tests/ui/generics/generic-type-more-params-with-defaults.stderr +++ b/tests/ui/generics/generic-type-more-params-with-defaults.stderr @@ -2,18 +2,15 @@ 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; - | ^^^ expected at most 2 generic arguments + | ^^^ ------ help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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 17503b86e19..bac0d26b622 100644 --- a/tests/ui/generics/wrong-number-of-args.stderr +++ b/tests/ui/generics/wrong-number-of-args.stderr @@ -171,86 +171,71 @@ 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>; - | ^^ expected 0 lifetime arguments + | ^^--------- help: remove the unnecessary generics + | | + | 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 the unnecessary 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>; - | ^^ expected 0 lifetime arguments + | ^^ ------- help: remove the lifetime argument + | | + | 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 the 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>; - | ^^ expected 0 generic arguments + | ^^ ----- help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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 }>; - | ^^ expected 0 lifetime arguments + | ^^ ------- help: remove the lifetime argument + | | + | 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 the 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 }>; - | ^^ expected 0 generic arguments + | ^^ ------- help: remove the unnecessary 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 the unnecessary generic arguments - | -LL - type D = Ty<'static, usize, { 0 }>; -LL + type D = Ty<'static, usize>; - | error[E0107]: missing generics for struct `type_and_type::Ty` --> $DIR/wrong-number-of-args.rs:26:14 @@ -290,18 +275,15 @@ 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; - | ^^ expected 2 generic arguments + | ^^ ------ help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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 @@ -371,35 +353,29 @@ 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>; - | ^^ expected 1 lifetime argument + | ^^ ---------------- help: remove the 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 the lifetime argument - | -LL - type F = Ty<'static, usize, 'static, usize>; -LL + type F = Ty<'static, 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>; - | ^^ expected 1 generic argument + | ^^ ---------------- help: remove the unnecessary 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 the unnecessary generic argument - | -LL - type F = Ty<'static, usize, 'static, usize>; -LL + type F = Ty<'static, usize>; - | error[E0107]: missing generics for struct `type_and_type_and_type::Ty` --> $DIR/wrong-number-of-args.rs:80:14 @@ -439,18 +415,15 @@ 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; - | ^^ expected at most 3 generic arguments + | ^^ ----- help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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 @@ -472,35 +445,29 @@ 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>; - | ^^^^^^^^^^ expected 0 generic arguments + | ^^^^^^^^^^------- help: remove the unnecessary generics + | | + | 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 the unnecessary 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>; - | ^^^^^^^^^^^^^^^ expected 1 lifetime argument + | ^^^^^^^^^^^^^^^ --------- help: remove the 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 the 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 @@ -522,18 +489,15 @@ 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>; - | ^^^^^^^^^^^ expected 1 generic argument + | ^^^^^^^^^^^ ------- help: remove the unnecessary 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 the unnecessary 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 @@ -555,52 +519,43 @@ 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>; - | ^^^^^^^^^^^^ expected 0 generic arguments + | ^^^^^^^^^^^^------------------- help: remove the unnecessary generics + | | + | 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 the unnecessary 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>; - | ^^^^^^^^^^^^^^^^^ expected 1 lifetime argument + | ^^^^^^^^^^^^^^^^^ --------- help: remove the 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 the 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>; - | ^^^^^^^^^^^^^^^^^ expected 0 generic arguments + | ^^^^^^^^^^^^^^^^^ -- help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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 @@ -622,35 +577,29 @@ 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>; - | ^^^^^^^^^^^^^ expected 1 generic argument + | ^^^^^^^^^^^^^ ---- help: remove the unnecessary 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 the unnecessary 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>; - | ^^^^^^^^^^^^^ expected 0 lifetime arguments + | ^^^^^^^^^^^^^--------------------- help: remove the unnecessary generics + | | + | 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 the unnecessary 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 @@ -704,18 +653,15 @@ 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>; - | ^^^^^^^^^^^^^^^^^^^^^ expected 1 lifetime argument + | ^^^^^^^^^^^^^^^^^^^^^ --------- help: remove the 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 the 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 @@ -737,86 +683,71 @@ 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>; - | ^^^^^^^^^^^^^^^^^^^^^ expected 1 generic argument + | ^^^^^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary 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 the unnecessary 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>; - | ^^^^^^^^^^^^^^^^^^^^^ expected 1 lifetime argument + | ^^^^^^^^^^^^^^^^^^^^^ --------- help: remove the 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 the 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>; - | ^^^^^^^^^^^^^^^^^^^^^ expected 1 generic argument + | ^^^^^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary 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 the unnecessary 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>; - | ^^^^^^^^^^^^^^^^^^^^^ expected 1 lifetime argument + | ^^^^^^^^^^^^^^^^^^^^^ --------- help: remove the 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 the 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>; - | ^^^^^^^^^^^^^^^^^^^^^ expected 1 generic argument + | ^^^^^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary 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 the unnecessary 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 @@ -856,18 +787,15 @@ 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>; - | ^^^^^^^^^^^^^^^^^ expected 2 generic arguments + | ^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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 @@ -983,13 +911,9 @@ 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>; - | ^^^^^^^ expected 0 lifetime arguments - | -help: remove the unnecessary generics - | -LL - type C = HashMap<'static>; -LL + type C = HashMap; - | + | ^^^^^^^--------- help: remove the unnecessary generics + | | + | expected 0 lifetime arguments error[E0107]: struct takes at least 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:318:18 @@ -1006,13 +930,9 @@ 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; - | ^^^^^^^ expected at most 3 generic arguments - | -help: remove the unnecessary generic argument - | -LL - type D = HashMap; -LL + type D = HashMap; - | + | ^^^^^^^ ----- help: remove the unnecessary generic argument + | | + | expected at most 3 generic arguments error[E0107]: struct takes at least 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:328:18 @@ -1053,13 +973,9 @@ 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>; - | ^^^^^^ expected 0 lifetime arguments - | -help: remove the unnecessary generics - | -LL - type C = Result<'static>; -LL + type C = Result; - | + | ^^^^^^--------- help: remove the unnecessary generics + | | + | expected 0 lifetime arguments error[E0107]: enum takes 2 generic arguments but 0 generic arguments were supplied --> $DIR/wrong-number-of-args.rs:342:18 @@ -1076,13 +992,9 @@ 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; - | ^^^^^^ expected 2 generic arguments - | -help: remove the unnecessary generic argument - | -LL - type D = Result; -LL + type D = Result; - | + | ^^^^^^ ------ help: remove the unnecessary generic argument + | | + | expected 2 generic arguments 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/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 e225d7076b8..9b0d0c554f0 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,7 +2,9 @@ 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()); - | ^^^ expected 1 generic argument + | ^^^ -------- help: remove the unnecessary generic argument + | | + | expected 1 generic argument | note: function defined here, with 1 generic parameter: `T` --> $DIR/explicit-generic-args-for-impl.rs:1:4 @@ -10,11 +12,6 @@ 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 the unnecessary generic argument - | -LL - foo::("".to_string()); -LL + foo::("".to_string()); - | 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 1802a22d6cf..81570781b27 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,35 +38,29 @@ 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; - | ^^^^^^^ expected 0 generic arguments + | ^^^^^^^ ---------- help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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; - | ^^^^^^^ expected 0 generic arguments + | ^^^^^^^ ---------- help: remove the unnecessary generic argument + | | + | 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 the unnecessary 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 @@ -99,18 +93,15 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli --> $DIR/opaque-and-lifetime-mismatch.rs:24:17 | LL | fn foo() -> Wrapper { - | ^^^^^^^ expected 0 generic arguments + | ^^^^^^^ ---------- help: remove the unnecessary generic argument + | | + | 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 the unnecessary generic argument - | -LL - fn foo() -> Wrapper { -LL + fn foo() -> Wrapper<> { - | error: aborting due to 8 previous errors diff --git a/tests/ui/issues/issue-18423.stderr b/tests/ui/issues/issue-18423.stderr index c1a4aacd2a5..b5f19b5c9b2 100644 --- a/tests/ui/issues/issue-18423.stderr +++ b/tests/ui/issues/issue-18423.stderr @@ -2,13 +2,9 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/issue-18423.rs:4:8 | LL | x: Box<'a, isize> - | ^^^ expected 0 lifetime arguments - | -help: remove the lifetime argument - | -LL - x: Box<'a, isize> -LL + x: Box<, isize> - | + | ^^^ -- help: remove the lifetime argument + | | + | expected 0 lifetime arguments error: aborting due to 1 previous error diff --git a/tests/ui/issues/issue-53251.stderr b/tests/ui/issues/issue-53251.stderr index 854e9bc0c9b..981966354b9 100644 --- a/tests/ui/issues/issue-53251.stderr +++ b/tests/ui/issues/issue-53251.stderr @@ -2,7 +2,9 @@ error[E0107]: associated function takes 0 generic arguments but 1 generic argume --> $DIR/issue-53251.rs:11:20 | LL | S::f::(); - | ^ expected 0 generic arguments + | ^------- help: remove the unnecessary generics + | | + | expected 0 generic arguments ... LL | impl_add!(a b); | -------------- in this macro invocation @@ -13,17 +15,14 @@ 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 the unnecessary 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::(); - | ^ expected 0 generic arguments + | ^------- help: remove the unnecessary generics + | | + | expected 0 generic arguments ... LL | impl_add!(a b); | -------------- in this macro invocation @@ -35,11 +34,6 @@ 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 the unnecessary generics - | -LL - S::f::(); -LL + S::f(); - | error: aborting due to 2 previous errors diff --git a/tests/ui/issues/issue-60622.stderr b/tests/ui/issues/issue-60622.stderr index 66e96131f5e..298ef3799f2 100644 --- a/tests/ui/issues/issue-60622.stderr +++ b/tests/ui/issues/issue-60622.stderr @@ -20,18 +20,15 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-60622.rs:10:7 | LL | b.a::<'_, T>(); - | ^ expected 0 generic arguments + | ^ - help: remove the unnecessary generic argument + | | + | expected 0 generic arguments | note: method defined here, with 0 generic parameters --> $DIR/issue-60622.rs:6:8 | LL | fn a(&self) {} | ^ -help: remove the unnecessary generic argument - | -LL - b.a::<'_, T>(); -LL + b.a::<'_, >(); - | error: aborting due to 2 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 c0a5b62a56a..1717b6aa124 100644 --- a/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr +++ b/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr @@ -2,18 +2,15 @@ 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>) {} - | ^^^^^ expected 1 lifetime argument + | ^^^^^ ---- help: remove the 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 the 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/lifetimes/noisy-follow-up-erro.stderr b/tests/ui/lifetimes/noisy-follow-up-erro.stderr index 3c2d0df683a..04863badbd1 100644 --- a/tests/ui/lifetimes/noisy-follow-up-erro.stderr +++ b/tests/ui/lifetimes/noisy-follow-up-erro.stderr @@ -2,18 +2,15 @@ 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 ()> { - | ^^^ expected 2 lifetime arguments + | ^^^ ---- help: remove the lifetime argument + | | + | 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 the 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/methods/method-call-lifetime-args-fail.stderr b/tests/ui/methods/method-call-lifetime-args-fail.stderr index 2eda01fa20c..b251dd4d342 100644 --- a/tests/ui/methods/method-call-lifetime-args-fail.stderr +++ b/tests/ui/methods/method-call-lifetime-args-fail.stderr @@ -20,18 +20,15 @@ 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>(); - | ^^^^^ expected 2 lifetime arguments + | ^^^^^ --------- help: remove the lifetime argument + | | + | 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 the 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 @@ -223,18 +220,15 @@ 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); - | ^^^^^ expected 2 lifetime arguments + | ^^^^^ --------- help: remove the lifetime argument + | | + | 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 the 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/resolve/issue-3214.stderr b/tests/ui/resolve/issue-3214.stderr index f6f8c3b7746..1c64fdc1711 100644 --- a/tests/ui/resolve/issue-3214.stderr +++ b/tests/ui/resolve/issue-3214.stderr @@ -12,18 +12,15 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-3214.rs:6:22 | LL | impl Drop for Foo { - | ^^^ expected 0 generic arguments + | ^^^--- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: struct defined here, with 0 generic parameters --> $DIR/issue-3214.rs:2:12 | LL | struct Foo { | ^^^ -help: remove the unnecessary generics - | -LL - impl Drop for Foo { -LL + impl Drop for Foo { - | error: aborting due to 2 previous errors 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 6945e8465da..8c591edac54 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,18 +2,15 @@ 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::(); - | ^^^ expected 0 generic arguments + | ^^^--------- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: function defined here, with 0 generic parameters --> $DIR/auxiliary/cross-crate.rs:5:14 | LL | pub const fn foo() {} | ^^^ -help: remove the unnecessary 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 @@ -35,18 +32,15 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/no-explicit-const-params-cross-crate.rs:7:5 | LL | foo::(); - | ^^^ expected 0 generic arguments + | ^^^-------- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: function defined here, with 0 generic parameters --> $DIR/auxiliary/cross-crate.rs:5:14 | LL | pub const fn foo() {} | ^^^ -help: remove the unnecessary 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 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 0f9380de286..cc08114ddb5 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 @@ -16,18 +16,15 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/no-explicit-const-params.rs:22:5 | LL | foo::(); - | ^^^ expected 0 generic arguments + | ^^^--------- help: remove the unnecessary generics + | | + | 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 the unnecessary 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 @@ -58,18 +55,15 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/no-explicit-const-params.rs:15:5 | LL | foo::(); - | ^^^ expected 0 generic arguments + | ^^^-------- help: remove the unnecessary generics + | | + | 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 the unnecessary 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 diff --git a/tests/ui/seq-args.stderr b/tests/ui/seq-args.stderr index 47c5119b917..6e0d484d013 100644 --- a/tests/ui/seq-args.stderr +++ b/tests/ui/seq-args.stderr @@ -2,35 +2,29 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/seq-args.rs:4:13 | LL | impl Seq for Vec { - | ^^^ expected 0 generic arguments + | ^^^--- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/seq-args.rs:2:11 | LL | trait Seq { } | ^^^ -help: remove the unnecessary 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 { - | ^^^ expected 0 generic arguments + | ^^^------ help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: trait defined here, with 0 generic parameters --> $DIR/seq-args.rs:2:11 | LL | trait Seq { } | ^^^ -help: remove the unnecessary generics - | -LL - impl Seq for u32 { -LL + impl Seq for u32 { - | error: aborting due to 2 previous errors diff --git a/tests/ui/structs/struct-path-associated-type.stderr b/tests/ui/structs/struct-path-associated-type.stderr index 1a2a346b0e3..de396e875b0 100644 --- a/tests/ui/structs/struct-path-associated-type.stderr +++ b/tests/ui/structs/struct-path-associated-type.stderr @@ -8,18 +8,15 @@ 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:: {}; - | ^ expected 0 generic arguments + | ^------ help: remove the unnecessary generics + | | + | 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 the unnecessary 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 @@ -37,18 +34,15 @@ 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:: {}; - | ^ expected 0 generic arguments + | ^------ help: remove the unnecessary generics + | | + | 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 the unnecessary 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 60638125115..819b65ffb71 100644 --- a/tests/ui/structs/structure-constructor-type-mismatch.stderr +++ b/tests/ui/structs/structure-constructor-type-mismatch.stderr @@ -68,18 +68,15 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/structure-constructor-type-mismatch.rs:48:15 | LL | let pt3 = PointF:: { - | ^^^^^^ expected 0 generic arguments + | ^^^^^^------- help: remove the unnecessary generics + | | + | 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 the unnecessary generics - | -LL - let pt3 = PointF:: { -LL + let pt3 = PointF { - | error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:49:12 @@ -107,18 +104,15 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/structure-constructor-type-mismatch.rs:54:9 | LL | PointF:: { .. } => {} - | ^^^^^^ expected 0 generic arguments + | ^^^^^^------- help: remove the unnecessary generics + | | + | 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 the unnecessary generics - | -LL - PointF:: { .. } => {} -LL + PointF { .. } => {} - | error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:54:9 diff --git a/tests/ui/suggestions/issue-101421.stderr b/tests/ui/suggestions/issue-101421.stderr index 7adf07aa531..12b4c04c2a3 100644 --- a/tests/ui/suggestions/issue-101421.stderr +++ b/tests/ui/suggestions/issue-101421.stderr @@ -2,18 +2,15 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-101421.rs:10:8 | LL | ().f::<()>(()); - | ^ expected 0 generic arguments + | ^------ help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: method defined here, with 0 generic parameters --> $DIR/issue-101421.rs:2:8 | LL | fn f(&self, _: ()); | ^ -help: remove the unnecessary generics - | -LL - ().f::<()>(()); -LL + ().f(()); - | error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/issue-104287.stderr b/tests/ui/suggestions/issue-104287.stderr index 808f9562805..d728e6c3d8c 100644 --- a/tests/ui/suggestions/issue-104287.stderr +++ b/tests/ui/suggestions/issue-104287.stderr @@ -2,18 +2,15 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-104287.rs:10:5 | LL | foo::<()>(x); - | ^^^ expected 0 generic arguments + | ^^^------ help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: method defined here, with 0 generic parameters --> $DIR/issue-104287.rs:6:8 | LL | fn foo(&self) {} | ^^^ -help: remove the unnecessary 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-89064.stderr b/tests/ui/suggestions/issue-89064.stderr index a64a1986af8..837fef60d1e 100644 --- a/tests/ui/suggestions/issue-89064.stderr +++ b/tests/ui/suggestions/issue-89064.stderr @@ -46,18 +46,15 @@ error[E0107]: associated function takes 0 generic arguments but 1 generic argume --> $DIR/issue-89064.rs:27:21 | LL | let _ = A::::foo::(); - | ^^^ expected 0 generic arguments + | ^^^----- help: remove the unnecessary generics + | | + | expected 0 generic arguments | note: associated function defined here, with 0 generic parameters --> $DIR/issue-89064.rs:4:8 | LL | fn foo() {} | ^^^ -help: remove the unnecessary 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/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 d25192b3d6d..a22d88b7c59 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,18 +117,15 @@ 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 {} - | ^^^^^^ expected 1 generic argument + | ^^^^^^ --- help: remove the unnecessary 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 the unnecessary 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/object/vs-lifetime.stderr b/tests/ui/traits/object/vs-lifetime.stderr index 889e1e82876..916197ff096 100644 --- a/tests/ui/traits/object/vs-lifetime.stderr +++ b/tests/ui/traits/object/vs-lifetime.stderr @@ -8,18 +8,15 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup --> $DIR/vs-lifetime.rs:11:12 | LL | let _: S<'static, 'static>; - | ^ expected 1 lifetime argument + | ^ --------- help: remove the 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 the 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 d64497309ef..0ee64cc0952 100644 --- a/tests/ui/traits/test-2.stderr +++ b/tests/ui/traits/test-2.stderr @@ -2,35 +2,29 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/test-2.rs:9:8 | LL | 10.dup::(); - | ^^^ expected 0 generic arguments + | ^^^------- help: remove the unnecessary generics + | | + | 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 the unnecessary 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::(); - | ^^^^ expected 1 generic argument + | ^^^^ ----- help: remove the unnecessary 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 the unnecessary 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/transmutability/issue-101739-2.stderr b/tests/ui/transmutability/issue-101739-2.stderr index dabb51ee7ae..6b0a36a414b 100644 --- a/tests/ui/transmutability/issue-101739-2.stderr +++ b/tests/ui/transmutability/issue-101739-2.stderr @@ -1,17 +1,15 @@ 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 - | -help: remove the unnecessary generic arguments - | -LL - ASSUME_ALIGNMENT, -LL - ASSUME_LIFETIMES, -LL - ASSUME_VALIDITY, -LL - ASSUME_VISIBILITY, -LL + ASSUME_ALIGNMENT, - | +LL | Dst: BikeshedIntrinsicFrom< + | ^^^^^^^^^^^^^^^^^^^^^ expected at most 2 generic arguments +LL | Src, +LL | ASSUME_ALIGNMENT, + | _____________________________- +LL | | ASSUME_LIFETIMES, +LL | | ASSUME_VALIDITY, +LL | | ASSUME_VISIBILITY, + | |_____________________________- help: remove the unnecessary generic arguments 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 aaed6a9b544..482a314db60 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,35 +308,29 @@ 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(()); - | ^^^^^^^^^^ expected 0 generic arguments + | ^^^^^^^^^^------ help: remove the unnecessary generics + | | + | 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 the unnecessary 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::<()>(()); - | ^^^^^^^^^^ expected 0 generic arguments + | ^^^^^^^^^^------ help: remove the unnecessary generics + | | + | 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 the unnecessary 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 @@ -405,35 +399,29 @@ 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: () }; - | ^^^^^^^^^^ expected 0 generic arguments + | ^^^^^^^^^^------ help: remove the unnecessary generics + | | + | 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 the unnecessary 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: () }; - | ^^^^^^^^^^ expected 0 generic arguments + | ^^^^^^^^^^------ help: remove the unnecessary generics + | | + | 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 the unnecessary 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 @@ -486,35 +474,29 @@ 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; - | ^^^^^^^^^^ expected 0 generic arguments + | ^^^^^^^^^^------ help: remove the unnecessary generics + | | + | 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 the unnecessary 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::<()>; - | ^^^^^^^^^^ expected 0 generic arguments + | ^^^^^^^^^^------ help: remove the unnecessary generics + | | + | 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 the unnecessary 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/typeck/typeck-builtin-bound-type-parameters.stderr b/tests/ui/typeck/typeck-builtin-bound-type-parameters.stderr index dbcc03ee955..4235a14cdc0 100644 --- a/tests/ui/typeck/typeck-builtin-bound-type-parameters.stderr +++ b/tests/ui/typeck/typeck-builtin-bound-type-parameters.stderr @@ -2,99 +2,69 @@ 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) {} - | ^^^^ expected 0 generic arguments - | -help: remove the unnecessary generics - | -LL - fn foo1, U>(x: T) {} -LL + fn foo1(x: T) {} - | + | ^^^^--- help: remove the unnecessary generics + | | + | expected 0 generic arguments 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 {} - | ^^^^ expected 0 generic arguments - | -help: remove the unnecessary generics - | -LL - trait Trait: Copy {} -LL + trait Trait: Copy {} - | + | ^^^^---------- help: remove the unnecessary generics + | | + | expected 0 generic arguments 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 {} - | ^^^^ expected 0 generic arguments + | ^^^^---------- help: remove the unnecessary generics + | | + | expected 0 generic arguments | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -help: remove the unnecessary 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 {} - | ^^^^ expected 0 generic arguments + | ^^^^---------- help: remove the unnecessary generics + | | + | expected 0 generic arguments | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -help: remove the unnecessary 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); - | ^^^^ expected 0 generic arguments - | -help: remove the unnecessary generics - | -LL - struct MyStruct1>(T); -LL + struct MyStruct1(T); - | + | ^^^^--- help: remove the unnecessary generics + | | + | expected 0 generic arguments 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); - | ^^^^ expected 0 lifetime arguments - | -help: remove the unnecessary generics - | -LL - struct MyStruct2<'a, T: Copy<'a>>(&'a T); -LL + struct MyStruct2<'a, T: Copy>(&'a T); - | + | ^^^^---- help: remove the unnecessary generics + | | + | expected 0 lifetime arguments 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) {} - | ^^^^ expected 0 lifetime arguments - | -help: remove the lifetime argument - | -LL - fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} -LL + fn foo2<'a, T:Copy<, U>, U>(x: T) {} - | + | ^^^^ -- help: remove the lifetime argument + | | + | expected 0 lifetime arguments 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) {} - | ^^^^ expected 0 generic arguments - | -help: remove the unnecessary generic argument - | -LL - fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} -LL + fn foo2<'a, T:Copy<'a, >, U>(x: T) {} - | + | ^^^^ - help: remove the unnecessary generic argument + | | + | expected 0 generic arguments error: aborting due to 8 previous errors diff --git a/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr b/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr index 116dd186645..bb1b6e4fc73 100644 --- a/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr @@ -2,18 +2,15 @@ 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 }; - | ^^^ expected 1 generic argument + | ^^^ --- help: remove the unnecessary 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 the unnecessary 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 d2734f4acc8..6b8f1e98d2c 100644 --- a/tests/ui/typeck/typeck_type_placeholder_lifetime_2.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_lifetime_2.stderr @@ -2,18 +2,15 @@ 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 }; - | ^^^ expected 1 generic argument + | ^^^ ------- help: remove the unnecessary 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 the unnecessary 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-qpath-missing-params.stderr b/tests/ui/ufcs/ufcs-qpath-missing-params.stderr index e7e576d7c66..048cf96bcc8 100644 --- a/tests/ui/ufcs/ufcs-qpath-missing-params.stderr +++ b/tests/ui/ufcs/ufcs-qpath-missing-params.stderr @@ -34,18 +34,15 @@ 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()); - | ^^^^^^^^ expected 0 generic arguments + | ^^^^^^^^------- help: remove the unnecessary generics + | | + | 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 the unnecessary 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-sugar-wrong-number-number-type-parameters.stderr b/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr index 50900973282..a4e7232c8b3 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,18 +2,15 @@ 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()) { - | ^^^^ expected 0 generic arguments + | ^^^^-- help: remove the unnecessary parenthetical generics + | | + | 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 the unnecessary 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 @@ -25,52 +22,43 @@ 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) { - | ^^^^ expected 0 generic arguments + | ^^^^------- help: remove the unnecessary generics + | | + | 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 the unnecessary 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 >) { - | ^^^^ expected 0 generic arguments + | ^^^^-------------- help: remove the unnecessary generics + | | + | 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 the unnecessary 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)) { - | ^^^^ expected 0 generic arguments + | ^^^^------- help: remove the unnecessary parenthetical generics + | | + | 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 the unnecessary 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 @@ -82,18 +70,15 @@ 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 )) { - | ^^^^ expected 0 generic arguments + | ^^^^-------------- help: remove the unnecessary parenthetical generics + | | + | 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 the unnecessary 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 aecfe502cf9..f5ef58fc91e 100644 --- a/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr +++ b/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr @@ -2,18 +2,15 @@ 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) {} - | ^^^^^ expected 0 generic arguments + | ^^^^^------- help: remove the unnecessary parenthetical generics + | | + | 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 the unnecessary 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