Skip to content

Commit e84cb65

Browse files
committed
review comment: wording
1 parent c2e0e71 commit e84cb65

File tree

3 files changed

+22
-29
lines changed

3 files changed

+22
-29
lines changed

src/librustc_ast_passes/ast_validation.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -697,14 +697,7 @@ impl<'a> AstValidator<'a> {
697697
arg_spans.clone(),
698698
"generic arguments must come before the first constraint",
699699
)
700-
.span_labels(
701-
constraint_spans,
702-
&format!(
703-
"the constraint{} {} provided here",
704-
pluralize!(constraint_len),
705-
if constraint_len == 1 { "is" } else { "are" }
706-
),
707-
)
700+
.span_labels(constraint_spans, "constraint")
708701
.span_labels(arg_spans, "generic argument")
709702
.span_suggestion_verbose(
710703
data.span,

src/test/ui/parser/issue-32214.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: generic arguments must come before the first constraint
44
LL | pub fn test<W, I: Trait<Item=(), W> >() {}
55
| ------- ^ generic argument
66
| |
7-
| the constraint is provided here
7+
| constraint
88
|
99
help: move the constraint after the generic argument
1010
|

src/test/ui/suggestions/suggest-move-types.stderr

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: generic arguments must come before the first constraint
44
LL | struct A<T, M: One<A=(), T>> {
55
| ---- ^ generic argument
66
| |
7-
| the constraint is provided here
7+
| constraint
88
|
99
help: move the constraint after the generic argument
1010
|
@@ -18,7 +18,7 @@ LL | struct Al<'a, T, M: OneWithLifetime<A=(), T, 'a>> {
1818
| ---- ^ ^^ generic argument
1919
| | |
2020
| | generic argument
21-
| the constraint is provided here
21+
| constraint
2222
|
2323
help: move the constraint after the generic arguments
2424
|
@@ -33,9 +33,9 @@ LL | struct B<T, U, V, M: Three<A=(), B=(), C=(), T, U, V>> {
3333
| | | | | |
3434
| | | | | generic argument
3535
| | | | generic argument
36-
| | | the constraints are provided here
37-
| | the constraints are provided here
38-
| the constraints are provided here
36+
| | | constraint
37+
| | constraint
38+
| constraint
3939
|
4040
help: move the constraints after the generic arguments
4141
|
@@ -53,9 +53,9 @@ LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<A=(), B=(), C=(), T, U,
5353
| | | | | | generic argument
5454
| | | | | generic argument
5555
| | | | generic argument
56-
| | | the constraints are provided here
57-
| | the constraints are provided here
58-
| the constraints are provided here
56+
| | | constraint
57+
| | constraint
58+
| constraint
5959
|
6060
help: move the constraints after the generic arguments
6161
|
@@ -69,9 +69,9 @@ LL | struct C<T, U, V, M: Three<T, A=(), B=(), C=(), U, V>> {
6969
| ^ ---- ---- ---- ^ ^ generic argument
7070
| | | | | |
7171
| | | | | generic argument
72-
| | | | the constraints are provided here
73-
| | | the constraints are provided here
74-
| | the constraints are provided here
72+
| | | | constraint
73+
| | | constraint
74+
| | constraint
7575
| generic argument
7676
|
7777
help: move the constraints after the generic arguments
@@ -88,9 +88,9 @@ LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), C=()
8888
| | | | | | | | generic argument
8989
| | | | | | | generic argument
9090
| | | | | | generic argument
91-
| | | | | the constraints are provided here
92-
| | | | the constraints are provided here
93-
| | | the constraints are provided here
91+
| | | | | constraint
92+
| | | | constraint
93+
| | | constraint
9494
| | generic argument
9595
| generic argument
9696
|
@@ -105,10 +105,10 @@ error: generic arguments must come before the first constraint
105105
LL | struct D<T, U, V, M: Three<T, A=(), B=(), U, C=(), V>> {
106106
| ^ ---- ---- ^ ---- ^ generic argument
107107
| | | | | |
108-
| | | | | the constraints are provided here
108+
| | | | | constraint
109109
| | | | generic argument
110-
| | | the constraints are provided here
111-
| | the constraints are provided here
110+
| | | constraint
111+
| | constraint
112112
| generic argument
113113
|
114114
help: move the constraints after the generic arguments
@@ -123,11 +123,11 @@ LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<T, 'a, A=(), B=(), U, '
123123
| ^ ^^ ---- ---- ^ ^^ ---- ^ ^^ generic argument
124124
| | | | | | | | |
125125
| | | | | | | | generic argument
126-
| | | | | | | the constraints are provided here
126+
| | | | | | | constraint
127127
| | | | | | generic argument
128128
| | | | | generic argument
129-
| | | | the constraints are provided here
130-
| | | the constraints are provided here
129+
| | | | constraint
130+
| | | constraint
131131
| | generic argument
132132
| generic argument
133133
|

0 commit comments

Comments
 (0)