Skip to content

Commit 940533c

Browse files
committed
Change suggestion message wording
1 parent bf54690 commit 940533c

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/structured_errors/wrong_number_of_generic_args.rs

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

951951
let num_redundant_lt_args = lt_arg_spans.len() - self.num_expected_lifetime_args();
952952
let msg_lifetimes = format!(
953-
"remove {these} lifetime argument{s}",
954-
these = pluralize!("this", num_redundant_lt_args),
953+
"remove the lifetime argument{s}",
955954
s = pluralize!(num_redundant_lt_args),
956955
);
957956

@@ -992,8 +991,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
992991
let num_redundant_gen_args =
993992
gen_arg_spans.len() - self.num_expected_type_or_const_args();
994993
let msg_types_or_consts = format!(
995-
"remove {these} generic argument{s}",
996-
these = pluralize!("this", num_redundant_gen_args),
994+
"remove the unnecessary generic argument{s}",
997995
s = pluralize!(num_redundant_gen_args),
998996
);
999997

@@ -1039,7 +1037,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
10391037
.with_lo(self.path_segment.ident.span.hi());
10401038

10411039
let msg = format!(
1042-
"remove these {}generics",
1040+
"remove the unnecessary {}generics",
10431041
if self.gen_args.parenthesized == hir::GenericArgsParentheses::ParenSugar {
10441042
"parenthetical "
10451043
} 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)