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 10be69a9fbb85..db91a6ab2f491 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 @@ -888,7 +888,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> { let comma = if args.len() > 0 { ", " } else { "" }; let trait_path = self.tcx.def_path_str(trait_def_id); let method_name = self.tcx.item_name(self.def_id); - err.span_suggestion( + err.span_suggestion_verbose( expr.span, msg, format!("{trait_path}::{generics}::{method_name}({rcvr}{comma}{rest})"), @@ -939,18 +939,20 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> { } } - let span_lo_redundant_lt_args = lt_arg_spans[self.num_expected_lifetime_args()]; + let span_lo_redundant_lt_args = if self.num_expected_lifetime_args() == 0 { + lt_arg_spans[0] + } else { + lt_arg_spans[self.num_expected_lifetime_args() - 1] + }; let span_hi_redundant_lt_args = lt_arg_spans[lt_arg_spans.len() - 1]; - let span_redundant_lt_args = span_lo_redundant_lt_args.to(span_hi_redundant_lt_args); + let span_redundant_lt_args = + span_lo_redundant_lt_args.shrink_to_hi().to(span_hi_redundant_lt_args); debug!("span_redundant_lt_args: {:?}", span_redundant_lt_args); let num_redundant_lt_args = lt_arg_spans.len() - self.num_expected_lifetime_args(); - let msg_lifetimes = format!( - "remove {these} lifetime argument{s}", - these = pluralize!("this", num_redundant_lt_args), - s = pluralize!(num_redundant_lt_args), - ); + let msg_lifetimes = + format!("remove the lifetime argument{s}", s = pluralize!(num_redundant_lt_args)); err.span_suggestion( span_redundant_lt_args, @@ -979,18 +981,22 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> { } let span_lo_redundant_type_or_const_args = - gen_arg_spans[self.num_expected_type_or_const_args()]; + if self.num_expected_type_or_const_args() == 0 { + gen_arg_spans[0] + } else { + gen_arg_spans[self.num_expected_type_or_const_args() - 1] + }; let span_hi_redundant_type_or_const_args = gen_arg_spans[gen_arg_spans.len() - 1]; + let span_redundant_type_or_const_args = span_lo_redundant_type_or_const_args + .shrink_to_hi() + .to(span_hi_redundant_type_or_const_args); - let span_redundant_type_or_const_args = - span_lo_redundant_type_or_const_args.to(span_hi_redundant_type_or_const_args); debug!("span_redundant_type_or_const_args: {:?}", span_redundant_type_or_const_args); let num_redundant_gen_args = gen_arg_spans.len() - self.num_expected_type_or_const_args(); let msg_types_or_consts = format!( - "remove {these} generic argument{s}", - these = pluralize!("this", num_redundant_gen_args), + "remove the unnecessary generic argument{s}", s = pluralize!(num_redundant_gen_args), ); @@ -1036,7 +1042,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> { .with_lo(self.path_segment.ident.span.hi()); let msg = format!( - "remove these {}generics", + "remove the unnecessary {}generics", if self.gen_args.parenthesized == hir::GenericArgsParentheses::ParenSugar { "parenthetical " } else { diff --git a/tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr b/tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr index 50d55284754e5..ef551cbea3e6a 100644 --- a/tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr +++ b/tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr @@ -18,7 +18,7 @@ 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 ()>>) {} - | ^--- help: remove these generics + | ^--- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -49,7 +49,7 @@ 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 ()>>) {} - | ^--- help: remove these generics + | ^--- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -81,7 +81,7 @@ 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 ()>>) {} - | ^--- help: remove these generics + | ^--- help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/rustdoc-ui/mismatched_arg_count.stderr b/tests/rustdoc-ui/mismatched_arg_count.stderr index 857bbda2ef471..5daeef2eb18fe 100644 --- a/tests/rustdoc-ui/mismatched_arg_count.stderr +++ b/tests/rustdoc-ui/mismatched_arg_count.stderr @@ -2,7 +2,7 @@ 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>) {} - | ^^^^^ -- help: remove this lifetime argument + | ^^^^^ ---- help: remove the lifetime argument | | | expected 1 lifetime argument | diff --git a/tests/ui/argument-suggestions/issue-100154.stderr b/tests/ui/argument-suggestions/issue-100154.stderr index 966f56e2a1562..7eaebcafb5957 100644 --- a/tests/ui/argument-suggestions/issue-100154.stderr +++ b/tests/ui/argument-suggestions/issue-100154.stderr @@ -2,7 +2,7 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/issue-100154.rs:4:5 | LL | foo::<()>(()); - | ^^^------ help: remove these generics + | ^^^------ help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr index c0b6dcd1512f7..e9efc932ea8a5 100644 --- a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr +++ b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr @@ -2,7 +2,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59 | LL | async fn buy_lock(coroutine: &Mutex) -> LockedMarket<'_> { - | ^^^^^^^^^^^^---- help: remove these generics + | ^^^^^^^^^^^^---- help: remove the unnecessary generics | | | expected 0 lifetime arguments | @@ -32,7 +32,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59 | LL | async fn buy_lock(coroutine: &Mutex) -> LockedMarket<'_> { - | ^^^^^^^^^^^^---- help: remove these generics + | ^^^^^^^^^^^^---- help: remove the unnecessary generics | | | expected 0 lifetime arguments | diff --git a/tests/ui/const-generics/adt_const_params/transmutable-ice-110969.stderr b/tests/ui/const-generics/adt_const_params/transmutable-ice-110969.stderr index a8fc742e89f54..5c04c4c9d5b52 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,7 +2,7 @@ error[E0107]: trait takes at most 2 generic arguments but 3 generic arguments we --> $DIR/transmutable-ice-110969.rs:11:14 | LL | Dst: BikeshedIntrinsicFrom, - | ^^^^^^^^^^^^^^^^^^^^^ ------ help: remove this generic argument + | ^^^^^^^^^^^^^^^^^^^^^ -------- help: remove the unnecessary generic argument | | | expected at most 2 generic arguments diff --git a/tests/ui/const-generics/generic_arg_infer/infer-arg-test.stderr b/tests/ui/const-generics/generic_arg_infer/infer-arg-test.stderr index 6d8dd017734c0..a9c57dbf26a0e 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,7 +23,7 @@ error[E0107]: struct takes 2 generic arguments but 3 generic arguments were supp --> $DIR/infer-arg-test.rs:18:10 | LL | let a: All<_, _, _>; - | ^^^ - help: remove this generic argument + | ^^^ --- help: remove the unnecessary generic argument | | | expected 2 generic arguments | diff --git a/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr b/tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr index 0c29d94ed5b4a..4d1fb02b59e91 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,7 +2,7 @@ error[E0107]: function takes 1 generic argument but 2 generic arguments were sup --> $DIR/issue_114151.rs:17:5 | LL | foo::<_, L>([(); L + 1 + L]); - | ^^^ - help: remove this generic argument + | ^^^ --- help: remove the unnecessary generic argument | | | expected 1 generic argument | diff --git a/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr b/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr index a470c36134cf4..37e09a075fe34 100644 --- a/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr +++ b/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr @@ -18,7 +18,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/issue-102768.rs:9:30 | LL | fn f2<'a>(arg: Box = &'a ()>>) {} - | ^--- help: remove these generics + | ^--- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -49,7 +49,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/issue-102768.rs:9:30 | LL | fn f2<'a>(arg: Box = &'a ()>>) {} - | ^--- help: remove these generics + | ^--- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -81,7 +81,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/issue-102768.rs:9:30 | LL | fn f2<'a>(arg: Box = &'a ()>>) {} - | ^--- help: remove these generics + | ^--- help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/const-generics/incorrect-number-of-const-args.stderr b/tests/ui/const-generics/incorrect-number-of-const-args.stderr index 01ac4e69a057e..09c963c350efa 100644 --- a/tests/ui/const-generics/incorrect-number-of-const-args.stderr +++ b/tests/ui/const-generics/incorrect-number-of-const-args.stderr @@ -20,7 +20,7 @@ error[E0107]: function takes 2 generic arguments but 3 generic arguments were su --> $DIR/incorrect-number-of-const-args.rs:9:5 | LL | foo::<0, 0, 0>(); - | ^^^ - help: remove this generic argument + | ^^^ --- help: remove the unnecessary generic argument | | | expected 2 generic arguments | diff --git a/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr b/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr index 4a649d8a7e881..4004ad1903258 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 @@ -8,7 +8,7 @@ help: consider moving this generic argument to the `TryInto` trait, which takes | LL | let _: u32 = TryInto::<32>::try_into(5i32).unwrap(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -help: remove these generics +help: remove the unnecessary generics | LL - let _: u32 = 5i32.try_into::<32>().unwrap(); LL + let _: u32 = 5i32.try_into().unwrap(); @@ -27,7 +27,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli --> $DIR/invalid-const-arg-for-type-param.rs:12:5 | LL | S::<0>; - | ^----- help: remove these generics + | ^----- help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/const-generics/invalid-constant-in-args.stderr b/tests/ui/const-generics/invalid-constant-in-args.stderr index 158b9722ee61b..3e1263e8e8c08 100644 --- a/tests/ui/const-generics/invalid-constant-in-args.stderr +++ b/tests/ui/const-generics/invalid-constant-in-args.stderr @@ -2,7 +2,7 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl --> $DIR/invalid-constant-in-args.rs:4:12 | LL | let _: Cell<&str, "a"> = Cell::new(""); - | ^^^^ --- help: remove this generic argument + | ^^^^ ----- help: remove the unnecessary generic argument | | | expected 1 generic argument diff --git a/tests/ui/constructor-lifetime-args.stderr b/tests/ui/constructor-lifetime-args.stderr index a18123fe19cba..d3759f4b3658e 100644 --- a/tests/ui/constructor-lifetime-args.stderr +++ b/tests/ui/constructor-lifetime-args.stderr @@ -20,7 +20,7 @@ error[E0107]: struct takes 2 lifetime arguments but 3 lifetime arguments were su --> $DIR/constructor-lifetime-args.rs:19:5 | LL | S::<'static, 'static, 'static>(&0, &0); - | ^ ------- help: remove this lifetime argument + | ^ --------- help: remove the lifetime argument | | | expected 2 lifetime arguments | @@ -52,7 +52,7 @@ error[E0107]: enum takes 2 lifetime arguments but 3 lifetime arguments were supp --> $DIR/constructor-lifetime-args.rs:24:8 | LL | E::V::<'static, 'static, 'static>(&0); - | ^ ------- help: remove this lifetime argument + | ^ --------- help: remove the lifetime argument | | | expected 2 lifetime arguments | diff --git a/tests/ui/consts/effect_param.stderr b/tests/ui/consts/effect_param.stderr index dba5d49b7921e..c63be8035f30f 100644 --- a/tests/ui/consts/effect_param.stderr +++ b/tests/ui/consts/effect_param.stderr @@ -2,7 +2,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/effect_param.rs:11:9 | LL | i8::checked_sub::(42, 43); - | ^^^^^^^^^^^--------- help: remove these generics + | ^^^^^^^^^^^--------- help: remove the unnecessary generics | | | expected 0 generic arguments @@ -10,7 +10,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/effect_param.rs:13:9 | LL | i8::checked_sub::(42, 43); - | ^^^^^^^^^^^-------- help: remove these generics + | ^^^^^^^^^^^-------- help: remove the unnecessary generics | | | expected 0 generic arguments @@ -18,7 +18,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/effect_param.rs:4:9 | LL | i8::checked_sub::(42, 43); - | ^^^^^^^^^^^-------- help: remove these generics + | ^^^^^^^^^^^-------- help: remove the unnecessary generics | | | expected 0 generic arguments @@ -26,7 +26,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/effect_param.rs:6:9 | LL | i8::checked_sub::(42, 43); - | ^^^^^^^^^^^--------- help: remove these generics + | ^^^^^^^^^^^--------- help: remove the unnecessary generics | | | expected 0 generic arguments diff --git a/tests/ui/error-codes/E0107.rs b/tests/ui/error-codes/E0107.rs index fd23e7c00f2bf..161360a501285 100644 --- a/tests/ui/error-codes/E0107.rs +++ b/tests/ui/error-codes/E0107.rs @@ -16,35 +16,35 @@ struct Baz<'a, 'b, 'c> { bar: Bar<'a>, //~^ ERROR enum takes 0 lifetime arguments - //~| HELP remove these generics + //~| HELP remove the unnecessary generics foo2: Foo<'a, 'b, 'c>, //~^ ERROR struct takes 1 lifetime argument - //~| HELP remove these lifetime arguments + //~| HELP remove the lifetime arguments qux1: Qux<'a, 'b, i32>, //~^ ERROR struct takes 1 lifetime argument - //~| HELP remove this lifetime argument + //~| HELP remove the lifetime argument qux2: Qux<'a, i32, 'b>, //~^ ERROR struct takes 1 lifetime argument - //~| HELP remove this lifetime argument + //~| HELP remove the lifetime argument qux3: Qux<'a, 'b, 'c, i32>, //~^ ERROR struct takes 1 lifetime argument - //~| HELP remove these lifetime arguments + //~| HELP remove the lifetime arguments qux4: Qux<'a, i32, 'b, 'c>, //~^ ERROR struct takes 1 lifetime argument - //~| HELP remove these lifetime arguments + //~| HELP remove the lifetime arguments qux5: Qux<'a, 'b, i32, 'c>, //~^ ERROR struct takes 1 lifetime argument - //~| HELP remove this lifetime argument + //~| HELP remove the lifetime argument quux: Quux<'a, i32, 'b>, //~^ ERROR struct takes 0 lifetime arguments - //~| HELP remove this lifetime argument + //~| HELP remove the lifetime argument } pub trait T { diff --git a/tests/ui/error-codes/E0107.stderr b/tests/ui/error-codes/E0107.stderr index 3f540eb08bc7c..4aa83cf7f5ff4 100644 --- a/tests/ui/error-codes/E0107.stderr +++ b/tests/ui/error-codes/E0107.stderr @@ -20,7 +20,7 @@ error[E0107]: enum takes 0 lifetime arguments but 1 lifetime argument was suppli --> $DIR/E0107.rs:17:10 | LL | bar: Bar<'a>, - | ^^^---- help: remove these generics + | ^^^---- help: remove the unnecessary generics | | | expected 0 lifetime arguments | @@ -34,7 +34,7 @@ error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were sup --> $DIR/E0107.rs:21:11 | LL | foo2: Foo<'a, 'b, 'c>, - | ^^^ ------ help: remove these lifetime arguments + | ^^^ -------- help: remove the lifetime arguments | | | expected 1 lifetime argument | @@ -48,7 +48,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup --> $DIR/E0107.rs:25:11 | LL | qux1: Qux<'a, 'b, i32>, - | ^^^ -- help: remove this lifetime argument + | ^^^ ---- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -62,7 +62,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup --> $DIR/E0107.rs:29:11 | LL | qux2: Qux<'a, i32, 'b>, - | ^^^ -- help: remove this lifetime argument + | ^^^ --------- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -76,7 +76,7 @@ error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were sup --> $DIR/E0107.rs:33:11 | LL | qux3: Qux<'a, 'b, 'c, i32>, - | ^^^ ------ help: remove these lifetime arguments + | ^^^ -------- help: remove the lifetime arguments | | | expected 1 lifetime argument | @@ -90,7 +90,7 @@ error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were sup --> $DIR/E0107.rs:37:11 | LL | qux4: Qux<'a, i32, 'b, 'c>, - | ^^^ ------ help: remove these lifetime arguments + | ^^^ ------------- help: remove the lifetime arguments | | | expected 1 lifetime argument | @@ -104,7 +104,7 @@ error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were sup --> $DIR/E0107.rs:41:11 | LL | qux5: Qux<'a, 'b, i32, 'c>, - | ^^^ -- help: remove this lifetime argument + | ^^^ ---- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -118,7 +118,7 @@ error[E0107]: struct takes 0 lifetime arguments but 2 lifetime arguments were su --> $DIR/E0107.rs:45:11 | LL | quux: Quux<'a, i32, 'b>, - | ^^^^ -- help: remove this lifetime argument + | ^^^^ -- help: remove the lifetime argument | | | expected 0 lifetime arguments | diff --git a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr index fcd3e7d9aace8..9d8e91c02ca37 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,7 +43,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 | LL | fn foo<'a>(arg: Box>) {} - | ^---- help: remove these generics + | ^---- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -74,7 +74,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 | LL | fn foo<'a>(arg: Box>) {} - | ^---- help: remove these generics + | ^---- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -106,7 +106,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/gat-trait-path-parenthesised-args.rs:5:27 | LL | fn foo<'a>(arg: Box>) {} - | ^---- help: remove these generics + | ^---- help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/generic-associated-types/parameter_number_and_kind.stderr b/tests/ui/generic-associated-types/parameter_number_and_kind.stderr index 4523044b5886b..4a20cf55cae73 100644 --- a/tests/ui/generic-associated-types/parameter_number_and_kind.stderr +++ b/tests/ui/generic-associated-types/parameter_number_and_kind.stderr @@ -2,7 +2,7 @@ error[E0107]: associated type takes 1 lifetime argument but 2 lifetime arguments --> $DIR/parameter_number_and_kind.rs:11:24 | LL | type FErr1 = Self::E<'static, 'static>; - | ^ ------- help: remove this lifetime argument + | ^ --------- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -32,7 +32,7 @@ error[E0107]: associated type takes 1 generic argument but 2 generic arguments w --> $DIR/parameter_number_and_kind.rs:14:27 | LL | type FErr2 = Self::E<'static, T, u32>; - | ^ --- help: remove this generic argument + | ^ ----- help: remove the unnecessary generic argument | | | expected 1 generic argument | diff --git a/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr b/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr index 2090f75aed328..539b6695e9e81 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,7 +18,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/trait-path-type-error-once-implemented.rs:6:29 | LL | fn f2<'a>(arg : Box = &'a ()>>) {} - | ^--- help: remove these generics + | ^--- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -49,7 +49,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/trait-path-type-error-once-implemented.rs:6:29 | LL | fn f2<'a>(arg : Box = &'a ()>>) {} - | ^--- help: remove these generics + | ^--- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -81,7 +81,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/trait-path-type-error-once-implemented.rs:6:29 | LL | fn f2<'a>(arg : Box = &'a ()>>) {} - | ^--- help: remove these generics + | ^--- help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/generics/bad-mid-path-type-params.stderr b/tests/ui/generics/bad-mid-path-type-params.stderr index 71e15dd4c9264..de3c0289fc6e8 100644 --- a/tests/ui/generics/bad-mid-path-type-params.stderr +++ b/tests/ui/generics/bad-mid-path-type-params.stderr @@ -2,7 +2,7 @@ error[E0107]: associated function takes 1 generic argument but 2 generic argumen --> $DIR/bad-mid-path-type-params.rs:30:16 | LL | let _ = S::new::(1, 1.0); - | ^^^ --- help: remove this generic argument + | ^^^ ---- help: remove the unnecessary generic argument | | | expected 1 generic argument | @@ -16,7 +16,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/bad-mid-path-type-params.rs:33:13 | LL | let _ = S::<'a,isize>::new::(1, 1.0); - | ^ -- help: remove this lifetime argument + | ^ -- help: remove the lifetime argument | | | expected 0 lifetime arguments | @@ -30,7 +30,7 @@ error[E0107]: associated function takes 1 generic argument but 2 generic argumen --> $DIR/bad-mid-path-type-params.rs:36:24 | LL | let _: S2 = Trait::new::(1, 1.0); - | ^^^ --- help: remove this generic argument + | ^^^ ---- help: remove the unnecessary generic argument | | | expected 1 generic argument | @@ -44,7 +44,7 @@ error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was suppl --> $DIR/bad-mid-path-type-params.rs:39:17 | LL | let _: S2 = Trait::<'a,isize>::new::(1, 1.0); - | ^^^^^ -- help: remove this lifetime argument + | ^^^^^ -- help: remove the lifetime argument | | | expected 0 lifetime arguments | @@ -58,7 +58,7 @@ error[E0107]: associated function takes 1 generic argument but 2 generic argumen --> $DIR/bad-mid-path-type-params.rs:39:36 | LL | let _: S2 = Trait::<'a,isize>::new::(1, 1.0); - | ^^^ --- help: remove this generic argument + | ^^^ ---- help: remove the unnecessary generic argument | | | expected 1 generic argument | diff --git a/tests/ui/generics/foreign-generic-mismatch.stderr b/tests/ui/generics/foreign-generic-mismatch.stderr index 5322b3f919d2d..32beac41b21b6 100644 --- a/tests/ui/generics/foreign-generic-mismatch.stderr +++ b/tests/ui/generics/foreign-generic-mismatch.stderr @@ -20,7 +20,7 @@ error[E0107]: function takes 1 lifetime argument but 2 lifetime arguments were s --> $DIR/foreign-generic-mismatch.rs:8:31 | LL | foreign_generic_mismatch::lt_arg::<'static, 'static>(); - | ^^^^^^ ------- help: remove this lifetime argument + | ^^^^^^ --------- help: remove the lifetime argument | | | expected 1 lifetime argument | diff --git a/tests/ui/generics/generic-arg-mismatch-recover.stderr b/tests/ui/generics/generic-arg-mismatch-recover.stderr index f549a7180fc66..172683a8f9b30 100644 --- a/tests/ui/generics/generic-arg-mismatch-recover.stderr +++ b/tests/ui/generics/generic-arg-mismatch-recover.stderr @@ -2,7 +2,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup --> $DIR/generic-arg-mismatch-recover.rs:6:5 | LL | Foo::<'static, 'static, ()>(&0); - | ^^^ ------- help: remove this lifetime argument + | ^^^ --------- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -16,7 +16,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup --> $DIR/generic-arg-mismatch-recover.rs:9:5 | LL | Bar::<'static, 'static, ()>(&()); - | ^^^ ------- help: remove this lifetime argument + | ^^^ --------- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -30,7 +30,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli --> $DIR/generic-arg-mismatch-recover.rs:9:5 | LL | Bar::<'static, 'static, ()>(&()); - | ^^^ -- help: remove this generic argument + | ^^^ -- help: remove the unnecessary generic argument | | | expected 0 generic arguments | diff --git a/tests/ui/generics/generic-impl-more-params-with-defaults.stderr b/tests/ui/generics/generic-impl-more-params-with-defaults.stderr index c5812abfd3dfa..16bdc2de2520d 100644 --- a/tests/ui/generics/generic-impl-more-params-with-defaults.stderr +++ b/tests/ui/generics/generic-impl-more-params-with-defaults.stderr @@ -2,7 +2,7 @@ error[E0107]: struct takes at most 2 generic arguments but 3 generic arguments w --> $DIR/generic-impl-more-params-with-defaults.rs:13:5 | LL | Vec::::new(); - | ^^^ ---- help: remove this generic argument + | ^^^ ------ help: remove the unnecessary generic argument | | | expected at most 2 generic arguments | diff --git a/tests/ui/generics/generic-type-more-params-with-defaults.stderr b/tests/ui/generics/generic-type-more-params-with-defaults.stderr index c44f6b7ddc02d..1eb76e043e047 100644 --- a/tests/ui/generics/generic-type-more-params-with-defaults.stderr +++ b/tests/ui/generics/generic-type-more-params-with-defaults.stderr @@ -2,7 +2,7 @@ error[E0107]: struct takes at most 2 generic arguments but 3 generic arguments w --> $DIR/generic-type-more-params-with-defaults.rs:9:12 | LL | let _: Vec; - | ^^^ ---- help: remove this generic argument + | ^^^ ------ help: remove the unnecessary generic argument | | | expected at most 2 generic arguments | diff --git a/tests/ui/generics/wrong-number-of-args.rs b/tests/ui/generics/wrong-number-of-args.rs index 95463d1c32c30..6524bd538b6bf 100644 --- a/tests/ui/generics/wrong-number-of-args.rs +++ b/tests/ui/generics/wrong-number-of-args.rs @@ -5,19 +5,19 @@ mod no_generics { type B = Ty<'static>; //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument - //~| HELP remove these generics + //~| HELP remove the unnecessary generics type C = Ty<'static, usize>; //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument //~| ERROR struct takes 0 generic arguments but 1 generic argument - //~| HELP remove this lifetime argument - //~| HELP remove this generic argument + //~| HELP remove the lifetime argument + //~| HELP remove the unnecessary generic argument type D = Ty<'static, usize, { 0 }>; //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument //~| ERROR struct takes 0 generic arguments but 2 generic arguments - //~| HELP remove this lifetime argument - //~| HELP remove these generic arguments + //~| HELP remove the lifetime argument + //~| HELP remove the unnecessary generic arguments } mod type_and_type { @@ -35,7 +35,7 @@ mod type_and_type { type D = Ty; //~^ ERROR struct takes 2 generic arguments but 3 generic arguments - //~| HELP remove this + //~| HELP remove the type E = Ty<>; //~^ ERROR struct takes 2 generic arguments but 0 generic arguments were supplied @@ -70,8 +70,8 @@ mod lifetime_and_type { type F = Ty<'static, usize, 'static, usize>; //~^ ERROR struct takes 1 lifetime argument but 2 lifetime arguments //~| ERROR struct takes 1 generic argument but 2 generic arguments - //~| HELP remove this lifetime argument - //~| HELP remove this generic argument + //~| HELP remove the lifetime argument + //~| HELP remove the unnecessary generic argument } mod type_and_type_and_type { @@ -317,13 +317,13 @@ mod stdlib { type C = HashMap<'static>; //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument - //~| HELP remove these generics + //~| HELP remove the //~| ERROR struct takes at least 2 //~| HELP add missing type D = HashMap; //~^ ERROR struct takes at most 3 - //~| HELP remove this + //~| HELP remove the type E = HashMap<>; //~^ ERROR struct takes at least 2 generic arguments but 0 generic arguments @@ -341,7 +341,7 @@ mod stdlib { type C = Result<'static>; //~^ ERROR enum takes 0 lifetime arguments but 1 lifetime argument - //~| HELP remove these generics + //~| HELP remove the unnecessary generics //~| ERROR enum takes 2 generic arguments but 0 generic arguments //~| HELP add missing diff --git a/tests/ui/generics/wrong-number-of-args.stderr b/tests/ui/generics/wrong-number-of-args.stderr index e04408a0fdf36..bac0d26b622dc 100644 --- a/tests/ui/generics/wrong-number-of-args.stderr +++ b/tests/ui/generics/wrong-number-of-args.stderr @@ -171,7 +171,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/wrong-number-of-args.rs:6:14 | LL | type B = Ty<'static>; - | ^^--------- help: remove these generics + | ^^--------- help: remove the unnecessary generics | | | expected 0 lifetime arguments | @@ -185,7 +185,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/wrong-number-of-args.rs:10:14 | LL | type C = Ty<'static, usize>; - | ^^ ------- help: remove this lifetime argument + | ^^ ------- help: remove the lifetime argument | | | expected 0 lifetime arguments | @@ -199,7 +199,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli --> $DIR/wrong-number-of-args.rs:10:14 | LL | type C = Ty<'static, usize>; - | ^^ ----- help: remove this generic argument + | ^^ ----- help: remove the unnecessary generic argument | | | expected 0 generic arguments | @@ -213,7 +213,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/wrong-number-of-args.rs:16:14 | LL | type D = Ty<'static, usize, { 0 }>; - | ^^ ------- help: remove this lifetime argument + | ^^ ------- help: remove the lifetime argument | | | expected 0 lifetime arguments | @@ -227,7 +227,7 @@ error[E0107]: struct takes 0 generic arguments but 2 generic arguments were supp --> $DIR/wrong-number-of-args.rs:16:14 | LL | type D = Ty<'static, usize, { 0 }>; - | ^^ ------------ help: remove these generic arguments + | ^^ ------- help: remove the unnecessary generic arguments | | | expected 0 generic arguments | @@ -275,7 +275,7 @@ error[E0107]: struct takes 2 generic arguments but 3 generic arguments were supp --> $DIR/wrong-number-of-args.rs:36:14 | LL | type D = Ty; - | ^^ ---- help: remove this generic argument + | ^^ ------ help: remove the unnecessary generic argument | | | expected 2 generic arguments | @@ -353,7 +353,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup --> $DIR/wrong-number-of-args.rs:70:14 | LL | type F = Ty<'static, usize, 'static, usize>; - | ^^ ------- help: remove this lifetime argument + | ^^ ---------------- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -367,7 +367,7 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl --> $DIR/wrong-number-of-args.rs:70:14 | LL | type F = Ty<'static, usize, 'static, usize>; - | ^^ ----- help: remove this generic argument + | ^^ ---------------- help: remove the unnecessary generic argument | | | expected 1 generic argument | @@ -415,7 +415,7 @@ error[E0107]: struct takes at most 3 generic arguments but 4 generic arguments w --> $DIR/wrong-number-of-args.rs:92:14 | LL | type E = Ty; - | ^^ --- help: remove this generic argument + | ^^ ----- help: remove the unnecessary generic argument | | | expected at most 3 generic arguments | @@ -445,7 +445,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/wrong-number-of-args.rs:116:22 | LL | type A = Box>; - | ^^^^^^^^^^------- help: remove these generics + | ^^^^^^^^^^------- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -459,7 +459,7 @@ error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supp --> $DIR/wrong-number-of-args.rs:125:22 | LL | type C = Box>; - | ^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument + | ^^^^^^^^^^^^^^^ --------- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -489,7 +489,7 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli --> $DIR/wrong-number-of-args.rs:133:22 | LL | type E = Box>; - | ^^^^^^^^^^^ ----- help: remove this generic argument + | ^^^^^^^^^^^ ------- help: remove the unnecessary generic argument | | | expected 1 generic argument | @@ -519,7 +519,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/wrong-number-of-args.rs:153:26 | LL | type A = Box>; - | ^^^^^^^^^^^^------------------- help: remove these generics + | ^^^^^^^^^^^^------------------- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -533,7 +533,7 @@ error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supp --> $DIR/wrong-number-of-args.rs:168:26 | LL | type B = Box>; - | ^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument + | ^^^^^^^^^^^^^^^^^ --------- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -547,7 +547,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/wrong-number-of-args.rs:172:26 | LL | type C = Box>; - | ^^^^^^^^^^^^^^^^^ -- help: remove this generic argument + | ^^^^^^^^^^^^^^^^^ -- help: remove the unnecessary generic argument | | | expected 0 generic arguments | @@ -577,7 +577,7 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli --> $DIR/wrong-number-of-args.rs:189:26 | LL | type B = Box>; - | ^^^^^^^^^^^^^ -- help: remove this generic argument + | ^^^^^^^^^^^^^ ---- help: remove the unnecessary generic argument | | | expected 1 generic argument | @@ -591,7 +591,7 @@ error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was suppl --> $DIR/wrong-number-of-args.rs:193:26 | LL | type C = Box>; - | ^^^^^^^^^^^^^--------------------- help: remove these generics + | ^^^^^^^^^^^^^--------------------- help: remove the unnecessary generics | | | expected 0 lifetime arguments | @@ -653,7 +653,7 @@ error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supp --> $DIR/wrong-number-of-args.rs:216:26 | LL | type C = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument + | ^^^^^^^^^^^^^^^^^^^^^ --------- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -683,7 +683,7 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli --> $DIR/wrong-number-of-args.rs:227:26 | LL | type E = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ -- help: remove this generic argument + | ^^^^^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary generic argument | | | expected 1 generic argument | @@ -697,7 +697,7 @@ error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supp --> $DIR/wrong-number-of-args.rs:234:26 | LL | type F = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument + | ^^^^^^^^^^^^^^^^^^^^^ --------- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -711,7 +711,7 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli --> $DIR/wrong-number-of-args.rs:238:26 | LL | type G = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ -- help: remove this generic argument + | ^^^^^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary generic argument | | | expected 1 generic argument | @@ -725,7 +725,7 @@ error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supp --> $DIR/wrong-number-of-args.rs:242:26 | LL | type H = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ ------- help: remove this lifetime argument + | ^^^^^^^^^^^^^^^^^^^^^ --------- help: remove the lifetime argument | | | expected 1 lifetime argument | @@ -739,7 +739,7 @@ error[E0107]: trait takes 1 generic argument but 2 generic arguments were suppli --> $DIR/wrong-number-of-args.rs:242:26 | LL | type H = Box>; - | ^^^^^^^^^^^^^^^^^^^^^ -- help: remove this generic argument + | ^^^^^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary generic argument | | | expected 1 generic argument | @@ -787,7 +787,7 @@ error[E0107]: trait takes 2 generic arguments but 3 generic arguments were suppl --> $DIR/wrong-number-of-args.rs:262:26 | LL | type C = Box>; - | ^^^^^^^^^^^^^^^^^ -- help: remove this generic argument + | ^^^^^^^^^^^^^^^^^ ---- help: remove the unnecessary generic argument | | | expected 2 generic arguments | @@ -911,7 +911,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/wrong-number-of-args.rs:318:18 | LL | type C = HashMap<'static>; - | ^^^^^^^--------- help: remove these generics + | ^^^^^^^--------- help: remove the unnecessary generics | | | expected 0 lifetime arguments @@ -930,7 +930,7 @@ error[E0107]: struct takes at most 3 generic arguments but 4 generic arguments w --> $DIR/wrong-number-of-args.rs:324:18 | LL | type D = HashMap; - | ^^^^^^^ --- help: remove this generic argument + | ^^^^^^^ ----- help: remove the unnecessary generic argument | | | expected at most 3 generic arguments @@ -973,7 +973,7 @@ error[E0107]: enum takes 0 lifetime arguments but 1 lifetime argument was suppli --> $DIR/wrong-number-of-args.rs:342:18 | LL | type C = Result<'static>; - | ^^^^^^--------- help: remove these generics + | ^^^^^^--------- help: remove the unnecessary generics | | | expected 0 lifetime arguments @@ -992,7 +992,7 @@ error[E0107]: enum takes 2 generic arguments but 3 generic arguments were suppli --> $DIR/wrong-number-of-args.rs:348:18 | LL | type D = Result; - | ^^^^^^ ---- help: remove this generic argument + | ^^^^^^ ------ help: remove the unnecessary generic argument | | | expected 2 generic arguments diff --git a/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr b/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr index e8cd16bc30168..9b0d0c554f014 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,7 @@ error[E0107]: function takes 1 generic argument but 2 generic arguments were sup --> $DIR/explicit-generic-args-for-impl.rs:4:5 | LL | foo::("".to_string()); - | ^^^ ------ help: remove this generic argument + | ^^^ -------- help: remove the unnecessary generic argument | | | expected 1 generic argument | 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 1f8a0d5edd781..81570781b27da 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,7 +38,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli --> $DIR/opaque-and-lifetime-mismatch.rs:4:17 | LL | fn bar() -> Wrapper; - | ^^^^^^^ ---------- help: remove this generic argument + | ^^^^^^^ ---------- help: remove the unnecessary generic argument | | | expected 0 generic arguments | @@ -52,7 +52,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli --> $DIR/opaque-and-lifetime-mismatch.rs:18:17 | LL | fn foo() -> Wrapper; - | ^^^^^^^ ---------- help: remove this generic argument + | ^^^^^^^ ---------- help: remove the unnecessary generic argument | | | expected 0 generic arguments | @@ -93,7 +93,7 @@ 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 { - | ^^^^^^^ ---------- help: remove this generic argument + | ^^^^^^^ ---------- help: remove the unnecessary generic argument | | | expected 0 generic arguments | diff --git a/tests/ui/issues/issue-18423.stderr b/tests/ui/issues/issue-18423.stderr index 2c6015eaa9d4b..b5f19b5c9b23c 100644 --- a/tests/ui/issues/issue-18423.stderr +++ b/tests/ui/issues/issue-18423.stderr @@ -2,7 +2,7 @@ error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supp --> $DIR/issue-18423.rs:4:8 | LL | x: Box<'a, isize> - | ^^^ -- help: remove this lifetime argument + | ^^^ -- help: remove the lifetime argument | | | expected 0 lifetime arguments diff --git a/tests/ui/issues/issue-53251.stderr b/tests/ui/issues/issue-53251.stderr index 05ea631158964..981966354b972 100644 --- a/tests/ui/issues/issue-53251.stderr +++ b/tests/ui/issues/issue-53251.stderr @@ -2,7 +2,7 @@ error[E0107]: associated function takes 0 generic arguments but 1 generic argume --> $DIR/issue-53251.rs:11:20 | LL | S::f::(); - | ^------- help: remove these generics + | ^------- help: remove the unnecessary generics | | | expected 0 generic arguments ... @@ -20,7 +20,7 @@ error[E0107]: associated function takes 0 generic arguments but 1 generic argume --> $DIR/issue-53251.rs:11:20 | LL | S::f::(); - | ^------- help: remove these generics + | ^------- help: remove the unnecessary generics | | | expected 0 generic arguments ... diff --git a/tests/ui/issues/issue-60622.stderr b/tests/ui/issues/issue-60622.stderr index 43da2773940e5..298ef3799f242 100644 --- a/tests/ui/issues/issue-60622.stderr +++ b/tests/ui/issues/issue-60622.stderr @@ -20,7 +20,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-60622.rs:10:7 | LL | b.a::<'_, T>(); - | ^ - help: remove this generic argument + | ^ - help: remove the unnecessary generic argument | | | expected 0 generic arguments | diff --git a/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr b/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr index 1b8f1c3fd6fae..1717b6aa1242b 100644 --- a/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr +++ b/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr @@ -2,7 +2,7 @@ error[E0107]: type alias takes 1 lifetime argument but 2 lifetime arguments were --> $DIR/mismatched_arg_count.rs:9:29 | LL | fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {} - | ^^^^^ -- help: remove this lifetime argument + | ^^^^^ ---- help: remove the lifetime argument | | | expected 1 lifetime argument | diff --git a/tests/ui/lifetimes/noisy-follow-up-erro.stderr b/tests/ui/lifetimes/noisy-follow-up-erro.stderr index f549009a87c12..04863badbd1ef 100644 --- a/tests/ui/lifetimes/noisy-follow-up-erro.stderr +++ b/tests/ui/lifetimes/noisy-follow-up-erro.stderr @@ -2,7 +2,7 @@ error[E0107]: struct takes 2 lifetime arguments but 3 lifetime arguments were su --> $DIR/noisy-follow-up-erro.rs:12:30 | LL | fn boom(&self, foo: &mut Foo<'_, '_, 'a>) -> Result<(), &'a ()> { - | ^^^ -- help: remove this lifetime argument + | ^^^ ---- help: remove the lifetime argument | | | expected 2 lifetime arguments | diff --git a/tests/ui/methods/method-call-lifetime-args-fail.stderr b/tests/ui/methods/method-call-lifetime-args-fail.stderr index 645d8b8d14ad2..b251dd4d342f4 100644 --- a/tests/ui/methods/method-call-lifetime-args-fail.stderr +++ b/tests/ui/methods/method-call-lifetime-args-fail.stderr @@ -20,7 +20,7 @@ error[E0107]: method takes 2 lifetime arguments but 3 lifetime arguments were su --> $DIR/method-call-lifetime-args-fail.rs:18:7 | LL | S.early::<'static, 'static, 'static>(); - | ^^^^^ ------- help: remove this lifetime argument + | ^^^^^ --------- help: remove the lifetime argument | | | expected 2 lifetime arguments | @@ -220,7 +220,7 @@ error[E0107]: method takes 2 lifetime arguments but 3 lifetime arguments were su --> $DIR/method-call-lifetime-args-fail.rs:65:8 | LL | S::early::<'static, 'static, 'static>(S); - | ^^^^^ ------- help: remove this lifetime argument + | ^^^^^ --------- help: remove the lifetime argument | | | expected 2 lifetime arguments | diff --git a/tests/ui/resolve/issue-3214.stderr b/tests/ui/resolve/issue-3214.stderr index 5b57c1baf90ba..1c64fdc1711fd 100644 --- a/tests/ui/resolve/issue-3214.stderr +++ b/tests/ui/resolve/issue-3214.stderr @@ -12,7 +12,7 @@ error[E0107]: struct takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-3214.rs:6:22 | LL | impl Drop for Foo { - | ^^^--- help: remove these generics + | ^^^--- help: remove the unnecessary generics | | | expected 0 generic arguments | 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 fa2e3da368bd8..8c591edac5404 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,7 +2,7 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/no-explicit-const-params-cross-crate.rs:14:5 | LL | foo::(); - | ^^^--------- help: remove these generics + | ^^^--------- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -32,7 +32,7 @@ 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::(); - | ^^^-------- help: remove these generics + | ^^^-------- help: remove the unnecessary generics | | | expected 0 generic arguments | 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 fbb96dfd85e1b..cc08114ddb565 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,7 +16,7 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/no-explicit-const-params.rs:22:5 | LL | foo::(); - | ^^^--------- help: remove these generics + | ^^^--------- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -55,7 +55,7 @@ error[E0107]: function takes 0 generic arguments but 1 generic argument was supp --> $DIR/no-explicit-const-params.rs:15:5 | LL | foo::(); - | ^^^-------- help: remove these generics + | ^^^-------- help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/seq-args.stderr b/tests/ui/seq-args.stderr index a5b0f8e98dca0..6e0d484d013d3 100644 --- a/tests/ui/seq-args.stderr +++ b/tests/ui/seq-args.stderr @@ -2,7 +2,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/seq-args.rs:4:13 | LL | impl Seq for Vec { - | ^^^--- help: remove these generics + | ^^^--- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -16,7 +16,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/seq-args.rs:9:10 | LL | impl Seq for u32 { - | ^^^------ help: remove these generics + | ^^^------ help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/structs/struct-path-associated-type.stderr b/tests/ui/structs/struct-path-associated-type.stderr index 0c9d2aad5d827..de396e875b0cf 100644 --- a/tests/ui/structs/struct-path-associated-type.stderr +++ b/tests/ui/structs/struct-path-associated-type.stderr @@ -8,7 +8,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/struct-path-associated-type.rs:14:16 | LL | let z = T::A:: {}; - | ^------ help: remove these generics + | ^------ help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -34,7 +34,7 @@ error[E0107]: associated type takes 0 generic arguments but 1 generic argument w --> $DIR/struct-path-associated-type.rs:25:16 | LL | let z = T::A:: {}; - | ^------ help: remove these generics + | ^------ help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/structs/structure-constructor-type-mismatch.stderr b/tests/ui/structs/structure-constructor-type-mismatch.stderr index cb9574873473f..819b65ffb716e 100644 --- a/tests/ui/structs/structure-constructor-type-mismatch.stderr +++ b/tests/ui/structs/structure-constructor-type-mismatch.stderr @@ -68,7 +68,7 @@ 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:: { - | ^^^^^^------- help: remove these generics + | ^^^^^^------- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -104,7 +104,7 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/structure-constructor-type-mismatch.rs:54:9 | LL | PointF:: { .. } => {} - | ^^^^^^------- help: remove these generics + | ^^^^^^------- help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/suggestions/issue-101421.stderr b/tests/ui/suggestions/issue-101421.stderr index ececba5fb1baa..12b4c04c2a335 100644 --- a/tests/ui/suggestions/issue-101421.stderr +++ b/tests/ui/suggestions/issue-101421.stderr @@ -2,7 +2,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-101421.rs:10:8 | LL | ().f::<()>(()); - | ^------ help: remove these generics + | ^------ help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/suggestions/issue-104287.stderr b/tests/ui/suggestions/issue-104287.stderr index ed59b2e7a2d3b..d728e6c3d8c19 100644 --- a/tests/ui/suggestions/issue-104287.stderr +++ b/tests/ui/suggestions/issue-104287.stderr @@ -2,7 +2,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/issue-104287.rs:10:5 | LL | foo::<()>(x); - | ^^^------ help: remove these generics + | ^^^------ help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/suggestions/issue-89064.rs b/tests/ui/suggestions/issue-89064.rs index fa5fc899dc083..014d15a87f17c 100644 --- a/tests/ui/suggestions/issue-89064.rs +++ b/tests/ui/suggestions/issue-89064.rs @@ -16,20 +16,20 @@ impl B for S {} fn main() { let _ = A::foo::(); //~^ ERROR - //~| HELP remove these generics + //~| HELP remove the unnecessary generics //~| HELP consider moving this generic argument let _ = B::bar::(); //~^ ERROR - //~| HELP remove these generics + //~| HELP remove the unnecessary generics //~| HELP consider moving these generic arguments let _ = A::::foo::(); //~^ ERROR - //~| HELP remove these generics + //~| HELP remove the unnecessary generics let _ = 42.into::>(); //~^ ERROR - //~| HELP remove these generics + //~| HELP remove the unnecessary generics //~| HELP consider moving this generic argument } diff --git a/tests/ui/suggestions/issue-89064.stderr b/tests/ui/suggestions/issue-89064.stderr index be09dd8951208..837fef60d1e62 100644 --- a/tests/ui/suggestions/issue-89064.stderr +++ b/tests/ui/suggestions/issue-89064.stderr @@ -14,7 +14,7 @@ help: consider moving this generic argument to the `A` trait, which takes up to LL - let _ = A::foo::(); LL + let _ = A::::foo(); | -help: remove these generics +help: remove the unnecessary generics | LL - let _ = A::foo::(); LL + let _ = A::foo(); @@ -36,7 +36,7 @@ help: consider moving these generic arguments to the `B` trait, which takes up t LL - let _ = B::bar::(); LL + let _ = B::::bar(); | -help: remove these generics +help: remove the unnecessary generics | LL - let _ = B::bar::(); LL + let _ = B::bar(); @@ -46,7 +46,7 @@ error[E0107]: associated function takes 0 generic arguments but 1 generic argume --> $DIR/issue-89064.rs:27:21 | LL | let _ = A::::foo::(); - | ^^^----- help: remove these generics + | ^^^----- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -66,7 +66,7 @@ help: consider moving this generic argument to the `Into` trait, which takes up | LL | let _ = Into::>::into(42); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -help: remove these generics +help: remove the unnecessary generics | LL - let _ = 42.into::>(); LL + let _ = 42.into(); diff --git a/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.rs b/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.rs index 4066cd3b11a38..a719ddc4b16aa 100644 --- a/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.rs +++ b/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.rs @@ -14,5 +14,5 @@ fn main() { 1.bar::(0); //~^ ERROR method takes 0 generic arguments but 1 generic argument was supplied //~| HELP consider moving this generic argument to the `Foo` trait, which takes up to 1 argument - //~| HELP remove these generics + //~| HELP remove the unnecessary generics } diff --git a/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr b/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr index aa11bc7cf1d9c..cc735ef4c5ea5 100644 --- a/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr +++ b/tests/ui/suggestions/move-generic-to-trait-in-method-with-params.stderr @@ -13,7 +13,7 @@ help: consider moving this generic argument to the `Foo` trait, which takes up t | LL | Foo::::bar(1, 0); | ~~~~~~~~~~~~~~~~~~~~~ -help: remove these generics +help: remove the unnecessary generics | LL - 1.bar::(0); LL + 1.bar(0); diff --git a/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr b/tests/ui/traits/associated_type_bound/116464-invalid-assoc-type-suggestion-in-trait-impl.stderr index 06e2fa5d4d1fd..a22d88b7c59fa 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,7 +117,7 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl --> $DIR/116464-invalid-assoc-type-suggestion-in-trait-impl.rs:40:58 | LL | impl, U> YetAnotherTrait for Struct {} - | ^^^^^^ - help: remove this generic argument + | ^^^^^^ --- help: remove the unnecessary generic argument | | | expected 1 generic argument | diff --git a/tests/ui/traits/object/vs-lifetime.stderr b/tests/ui/traits/object/vs-lifetime.stderr index a69cd140807ff..916197ff09653 100644 --- a/tests/ui/traits/object/vs-lifetime.stderr +++ b/tests/ui/traits/object/vs-lifetime.stderr @@ -8,7 +8,7 @@ error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were sup --> $DIR/vs-lifetime.rs:11:12 | LL | let _: S<'static, 'static>; - | ^ ------- help: remove this lifetime argument + | ^ --------- help: remove the lifetime argument | | | expected 1 lifetime argument | diff --git a/tests/ui/traits/test-2.stderr b/tests/ui/traits/test-2.stderr index 3972e539776c4..0ee64cc095223 100644 --- a/tests/ui/traits/test-2.stderr +++ b/tests/ui/traits/test-2.stderr @@ -2,7 +2,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/test-2.rs:9:8 | LL | 10.dup::(); - | ^^^------- help: remove these generics + | ^^^------- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -16,7 +16,7 @@ error[E0107]: method takes 1 generic argument but 2 generic arguments were suppl --> $DIR/test-2.rs:11:8 | LL | 10.blah::(); - | ^^^^ --- help: remove this generic argument + | ^^^^ ----- help: remove the unnecessary generic argument | | | expected 1 generic argument | diff --git a/tests/ui/transmutability/issue-101739-2.stderr b/tests/ui/transmutability/issue-101739-2.stderr index 519a374dc2294..6b0a36a414bfd 100644 --- a/tests/ui/transmutability/issue-101739-2.stderr +++ b/tests/ui/transmutability/issue-101739-2.stderr @@ -3,11 +3,13 @@ error[E0107]: trait takes at most 2 generic arguments but 5 generic arguments we | LL | Dst: BikeshedIntrinsicFrom< | ^^^^^^^^^^^^^^^^^^^^^ expected at most 2 generic arguments -... -LL | / ASSUME_LIFETIMES, +LL | Src, +LL | ASSUME_ALIGNMENT, + | _____________________________- +LL | | ASSUME_LIFETIMES, LL | | ASSUME_VALIDITY, LL | | ASSUME_VISIBILITY, - | |_____________________________- help: remove these generic arguments + | |_____________________________- 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 96a5c13276331..482a314db602e 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,7 +308,7 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/enum-variant-generic-args.rs:64:5 | LL | AliasFixed::<()>::TSVariant(()); - | ^^^^^^^^^^------ help: remove these generics + | ^^^^^^^^^^------ help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -322,7 +322,7 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/enum-variant-generic-args.rs:66:5 | LL | AliasFixed::<()>::TSVariant::<()>(()); - | ^^^^^^^^^^------ help: remove these generics + | ^^^^^^^^^^------ help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -399,7 +399,7 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/enum-variant-generic-args.rs:82:5 | LL | AliasFixed::<()>::SVariant { v: () }; - | ^^^^^^^^^^------ help: remove these generics + | ^^^^^^^^^^------ help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -413,7 +413,7 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/enum-variant-generic-args.rs:84:5 | LL | AliasFixed::<()>::SVariant::<()> { v: () }; - | ^^^^^^^^^^------ help: remove these generics + | ^^^^^^^^^^------ help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -474,7 +474,7 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/enum-variant-generic-args.rs:100:5 | LL | AliasFixed::<()>::UVariant; - | ^^^^^^^^^^------ help: remove these generics + | ^^^^^^^^^^------ help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -488,7 +488,7 @@ error[E0107]: type alias takes 0 generic arguments but 1 generic argument was su --> $DIR/enum-variant-generic-args.rs:102:5 | LL | AliasFixed::<()>::UVariant::<()>; - | ^^^^^^^^^^------ help: remove these generics + | ^^^^^^^^^^------ help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/typeck/typeck-builtin-bound-type-parameters.stderr b/tests/ui/typeck/typeck-builtin-bound-type-parameters.stderr index 9a9b2a68dbed9..4235a14cdc00a 100644 --- a/tests/ui/typeck/typeck-builtin-bound-type-parameters.stderr +++ b/tests/ui/typeck/typeck-builtin-bound-type-parameters.stderr @@ -2,7 +2,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/typeck-builtin-bound-type-parameters.rs:1:11 | LL | fn foo1, U>(x: T) {} - | ^^^^--- help: remove these generics + | ^^^^--- help: remove the unnecessary generics | | | expected 0 generic arguments @@ -10,7 +10,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/typeck-builtin-bound-type-parameters.rs:4:14 | LL | trait Trait: Copy {} - | ^^^^---------- help: remove these generics + | ^^^^---------- help: remove the unnecessary generics | | | expected 0 generic arguments @@ -18,7 +18,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/typeck-builtin-bound-type-parameters.rs:4:14 | LL | trait Trait: Copy {} - | ^^^^---------- help: remove these generics + | ^^^^---------- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -28,7 +28,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/typeck-builtin-bound-type-parameters.rs:4:14 | LL | trait Trait: Copy {} - | ^^^^---------- help: remove these generics + | ^^^^---------- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -38,7 +38,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/typeck-builtin-bound-type-parameters.rs:9:21 | LL | struct MyStruct1>(T); - | ^^^^--- help: remove these generics + | ^^^^--- help: remove the unnecessary generics | | | expected 0 generic arguments @@ -46,7 +46,7 @@ error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was suppl --> $DIR/typeck-builtin-bound-type-parameters.rs:12:25 | LL | struct MyStruct2<'a, T: Copy<'a>>(&'a T); - | ^^^^---- help: remove these generics + | ^^^^---- help: remove the unnecessary generics | | | expected 0 lifetime arguments @@ -54,7 +54,7 @@ error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was suppl --> $DIR/typeck-builtin-bound-type-parameters.rs:15:15 | LL | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} - | ^^^^ -- help: remove this lifetime argument + | ^^^^ -- help: remove the lifetime argument | | | expected 0 lifetime arguments @@ -62,7 +62,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/typeck-builtin-bound-type-parameters.rs:15:15 | LL | fn foo2<'a, T:Copy<'a, U>, U>(x: T) {} - | ^^^^ - help: remove this generic argument + | ^^^^ - help: remove the unnecessary generic argument | | | expected 0 generic arguments diff --git a/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr b/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr index e4b1c02c20149..bb1b6e4fc730e 100644 --- a/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_lifetime_1.stderr @@ -2,7 +2,7 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl --> $DIR/typeck_type_placeholder_lifetime_1.rs:9:12 | LL | let c: Foo<_, _> = Foo { r: &5 }; - | ^^^ - help: remove this generic argument + | ^^^ --- help: remove the unnecessary generic argument | | | expected 1 generic argument | diff --git a/tests/ui/typeck/typeck_type_placeholder_lifetime_2.stderr b/tests/ui/typeck/typeck_type_placeholder_lifetime_2.stderr index fcb5ecc4042b0..6b8f1e98d2c49 100644 --- a/tests/ui/typeck/typeck_type_placeholder_lifetime_2.stderr +++ b/tests/ui/typeck/typeck_type_placeholder_lifetime_2.stderr @@ -2,7 +2,7 @@ error[E0107]: struct takes 1 generic argument but 2 generic arguments were suppl --> $DIR/typeck_type_placeholder_lifetime_2.rs:9:12 | LL | let c: Foo<_, usize> = Foo { r: &5 }; - | ^^^ ----- help: remove this generic argument + | ^^^ ------- help: remove the unnecessary generic argument | | | expected 1 generic argument | diff --git a/tests/ui/ufcs/ufcs-qpath-missing-params.stderr b/tests/ui/ufcs/ufcs-qpath-missing-params.stderr index 2338871218b1c..048cf96bcc8e8 100644 --- a/tests/ui/ufcs/ufcs-qpath-missing-params.stderr +++ b/tests/ui/ufcs/ufcs-qpath-missing-params.stderr @@ -34,7 +34,7 @@ error[E0107]: method takes 0 generic arguments but 1 generic argument was suppli --> $DIR/ufcs-qpath-missing-params.rs:17:26 | LL | ::into_cow::("foo".to_string()); - | ^^^^^^^^------- help: remove these generics + | ^^^^^^^^------- help: remove the unnecessary generics | | | expected 0 generic arguments | diff --git a/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr b/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-number-number-type-parameters.stderr index 5a2de132d70e7..a4e7232c8b35e 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,7 +2,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:5:17 | LL | fn foo1(_: &dyn Zero()) { - | ^^^^-- help: remove these parenthetical generics + | ^^^^-- help: remove the unnecessary parenthetical generics | | | expected 0 generic arguments | @@ -22,7 +22,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:10:17 | LL | fn foo2(_: &dyn Zero) { - | ^^^^------- help: remove these generics + | ^^^^------- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -36,7 +36,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:14:17 | LL | fn foo3(_: &dyn Zero < usize >) { - | ^^^^-------------- help: remove these generics + | ^^^^-------------- help: remove the unnecessary generics | | | expected 0 generic arguments | @@ -50,7 +50,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:18:17 | LL | fn foo4(_: &dyn Zero(usize)) { - | ^^^^------- help: remove these parenthetical generics + | ^^^^------- help: remove the unnecessary parenthetical generics | | | expected 0 generic arguments | @@ -70,7 +70,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/unboxed-closure-sugar-wrong-number-number-type-parameters.rs:23:17 | LL | fn foo5(_: &dyn Zero ( usize )) { - | ^^^^-------------- help: remove these parenthetical generics + | ^^^^-------------- help: remove the unnecessary parenthetical generics | | | expected 0 generic arguments | diff --git a/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr b/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr index 130b193d69c93..f5ef58fc91ee6 100644 --- a/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr +++ b/tests/ui/unboxed-closures/unboxed-closure-sugar-wrong-trait.stderr @@ -2,7 +2,7 @@ error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplie --> $DIR/unboxed-closure-sugar-wrong-trait.rs:5:8 | LL | fn f isize>(x: F) {} - | ^^^^^------- help: remove these parenthetical generics + | ^^^^^------- help: remove the unnecessary parenthetical generics | | | expected 0 generic arguments |