Skip to content

Commit 5c2b36a

Browse files
committed
Change suggestion message wording
1 parent c807ac0 commit 5c2b36a

File tree

57 files changed

+163
-165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+163
-165
lines changed

compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
947947

948948
let num_redundant_lt_args = lt_arg_spans.len() - self.num_expected_lifetime_args();
949949
let msg_lifetimes = format!(
950-
"remove {these} lifetime argument{s}",
951-
these = pluralize!("this", num_redundant_lt_args),
950+
"remove the lifetime argument{s}",
952951
s = pluralize!(num_redundant_lt_args),
953952
);
954953

@@ -989,8 +988,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
989988
let num_redundant_gen_args =
990989
gen_arg_spans.len() - self.num_expected_type_or_const_args();
991990
let msg_types_or_consts = format!(
992-
"remove {these} generic argument{s}",
993-
these = pluralize!("this", num_redundant_gen_args),
991+
"remove the unnecessary generic argument{s}",
994992
s = pluralize!(num_redundant_gen_args),
995993
);
996994

@@ -1036,7 +1034,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
10361034
.with_lo(self.path_segment.ident.span.hi());
10371035

10381036
let msg = format!(
1039-
"remove these {}generics",
1037+
"remove the unnecessary {}generics",
10401038
if self.gen_args.parenthesized == hir::GenericArgsParentheses::ParenSugar {
10411039
"parenthetical "
10421040
} else {

tests/rustdoc-ui/invalid_const_in_lifetime_position.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ note: associated type defined here, with 0 generic parameters
2525
|
2626
LL | type Y<'a>;
2727
| ^
28-
help: remove these generics
28+
help: remove the unnecessary generics
2929
|
3030
LL - fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
3131
LL + fn f<'a>(arg : Box<dyn X<Y = &'a ()>>) {}
@@ -60,7 +60,7 @@ note: associated type defined here, with 0 generic parameters
6060
LL | type Y<'a>;
6161
| ^
6262
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
63-
help: remove these generics
63+
help: remove the unnecessary generics
6464
|
6565
LL - fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
6666
LL + fn f<'a>(arg : Box<dyn X<Y = &'a ()>>) {}
@@ -95,7 +95,7 @@ note: associated type defined here, with 0 generic parameters
9595
LL | type Y<'a>;
9696
| ^
9797
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
98-
help: remove these generics
98+
help: remove the unnecessary generics
9999
|
100100
LL - fn f<'a>(arg : Box<dyn X<Y<1> = &'a ()>>) {}
101101
LL + fn f<'a>(arg : Box<dyn X<Y = &'a ()>>) {}

tests/rustdoc-ui/mismatched_arg_count.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: type alias defined here, with 1 lifetime parameter: `'a`
99
|
1010
LL | type Alias<'a, T> = <T as Trait<'a>>::Assoc;
1111
| ^^^^^ --
12-
help: remove this lifetime argument
12+
help: remove the lifetime argument
1313
|
1414
LL - fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {}
1515
LL + fn bar<'a, T: Trait<'a>>(_: Alias<'a, , T>) {}

tests/ui/argument-suggestions/issue-100154.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: function defined here, with 0 generic parameters
1010
LL | fn foo(i: impl std::fmt::Display) {}
1111
| ^^^
1212
= note: `impl Trait` cannot be explicitly specified as a generic argument
13-
help: remove these generics
13+
help: remove the unnecessary generics
1414
|
1515
LL - foo::<()>(());
1616
LL + foo(());

tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: struct defined here, with 0 lifetime parameters
99
|
1010
LL | struct LockedMarket<T>(T);
1111
| ^^^^^^^^^^^^
12-
help: remove these generics
12+
help: remove the unnecessary generics
1313
|
1414
LL - async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_> {
1515
LL + async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket {
@@ -43,7 +43,7 @@ note: struct defined here, with 0 lifetime parameters
4343
LL | struct LockedMarket<T>(T);
4444
| ^^^^^^^^^^^^
4545
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
46-
help: remove these generics
46+
help: remove the unnecessary generics
4747
|
4848
LL - async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket<'_> {
4949
LL + async fn buy_lock(coroutine: &Mutex<MarketMultiplier>) -> LockedMarket {

tests/ui/const-generics/adt_const_params/transmutable-ice-110969.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0107]: trait takes at most 2 generic arguments but 3 generic arguments we
44
LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME>,
55
| ^^^^^^^^^^^^^^^^^^^^^ expected at most 2 generic arguments
66
|
7-
help: remove this generic argument
7+
help: remove the unnecessary generic argument
88
|
99
LL - Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME>,
1010
LL + Dst: BikeshedIntrinsicFrom<Src, Context, >,

tests/ui/const-generics/generic_arg_infer/infer-arg-test.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ note: struct defined here, with 2 generic parameters: `T`, `N`
3030
|
3131
LL | struct All<'a, T, const N: usize> {
3232
| ^^^ - --------------
33-
help: remove this generic argument
33+
help: remove the unnecessary generic argument
3434
|
3535
LL - let a: All<_, _, _>;
3636
LL + let a: All<_, _, >;

tests/ui/const-generics/generic_const_exprs/const_kind_expr/issue_114151.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: function defined here, with 1 generic parameter: `N`
99
|
1010
LL | fn foo<const N: usize>(
1111
| ^^^ --------------
12-
help: remove this generic argument
12+
help: remove the unnecessary generic argument
1313
|
1414
LL - foo::<_, L>([(); L + 1 + L]);
1515
LL + foo::<_, >([(); L + 1 + L]);

tests/ui/const-generics/generic_const_exprs/issue-102768.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ note: associated type defined here, with 0 generic parameters
2525
|
2626
LL | type Y<'a>;
2727
| ^
28-
help: remove these generics
28+
help: remove the unnecessary generics
2929
|
3030
LL - fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
3131
LL + fn f2<'a>(arg: Box<dyn X<Y = &'a ()>>) {}
@@ -60,7 +60,7 @@ note: associated type defined here, with 0 generic parameters
6060
LL | type Y<'a>;
6161
| ^
6262
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
63-
help: remove these generics
63+
help: remove the unnecessary generics
6464
|
6565
LL - fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
6666
LL + fn f2<'a>(arg: Box<dyn X<Y = &'a ()>>) {}
@@ -95,7 +95,7 @@ note: associated type defined here, with 0 generic parameters
9595
LL | type Y<'a>;
9696
| ^
9797
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
98-
help: remove these generics
98+
help: remove the unnecessary generics
9999
|
100100
LL - fn f2<'a>(arg: Box<dyn X<Y<1> = &'a ()>>) {}
101101
LL + fn f2<'a>(arg: Box<dyn X<Y = &'a ()>>) {}

tests/ui/const-generics/incorrect-number-of-const-args.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ note: function defined here, with 2 generic parameters: `X`, `Y`
2727
|
2828
LL | fn foo<const X: usize, const Y: usize>() -> usize {
2929
| ^^^ -------------- --------------
30-
help: remove this generic argument
30+
help: remove the unnecessary generic argument
3131
|
3232
LL - foo::<0, 0, 0>();
3333
LL + foo::<0, 0, >();

0 commit comments

Comments
 (0)