Skip to content

Commit a5e8e6e

Browse files
committed
Pluralize 'parenthesis' correctly
It's 'parentheses', not 'parenthesis', when you have more than one.
1 parent f3d9df5 commit a5e8e6e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

compiler/rustc_typeck/src/check/pat.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10021002
// More generally, the expected type wants a tuple variant with one field of an
10031003
// N-arity-tuple, e.g., `V_i((p_0, .., p_N))`. Meanwhile, the user supplied a pattern
10041004
// with the subpatterns directly in the tuple variant pattern, e.g., `V_i(p_0, .., p_N)`.
1005-
let missing_parenthesis = match (&expected.kind(), fields, had_err) {
1005+
let missing_parentheses = match (&expected.kind(), fields, had_err) {
10061006
// #67037: only do this if we could successfully type-check the expected type against
10071007
// the tuple struct pattern. Otherwise the substs could get out of range on e.g.,
10081008
// `let P() = U;` where `P != U` with `struct P<T>(T);`.
@@ -1015,13 +1015,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10151015
}
10161016
_ => false,
10171017
};
1018-
if missing_parenthesis {
1018+
if missing_parentheses {
10191019
let (left, right) = match subpats {
10201020
// This is the zero case; we aim to get the "hi" part of the `QPath`'s
10211021
// span as the "lo" and then the "hi" part of the pattern's span as the "hi".
10221022
// This looks like:
10231023
//
1024-
// help: missing parenthesis
1024+
// help: missing parentheses
10251025
// |
10261026
// L | let A(()) = A(());
10271027
// | ^ ^
@@ -1030,14 +1030,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10301030
// last sub-pattern. In the case of `A(x)` the first and last may coincide.
10311031
// This looks like:
10321032
//
1033-
// help: missing parenthesis
1033+
// help: missing parentheses
10341034
// |
10351035
// L | let A((x, y)) = A((1, 2));
10361036
// | ^ ^
10371037
[first, ..] => (first.span.shrink_to_lo(), subpats.last().unwrap().span),
10381038
};
10391039
err.multipart_suggestion(
1040-
"missing parenthesis",
1040+
"missing parentheses",
10411041
vec![(left, "(".to_string()), (right.shrink_to_hi(), ")".to_string())],
10421042
Applicability::MachineApplicable,
10431043
);

src/test/ui/error-codes/E0023.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ LL | Orange((String, String)),
4343
LL | Fruit::Orange(a, b) => {},
4444
| ^^^^^^^^^^^^^^^^^^^ expected 1 field, found 2
4545
|
46-
help: missing parenthesis
46+
help: missing parentheses
4747
|
4848
LL | Fruit::Orange((a, b)) => {},
4949
| ^ ^
@@ -57,7 +57,7 @@ LL | Banana(()),
5757
LL | Fruit::Banana() => {},
5858
| ^^^^^^^^^^^^^^^ expected 1 field, found 0
5959
|
60-
help: missing parenthesis
60+
help: missing parentheses
6161
|
6262
LL | Fruit::Banana(()) => {},
6363
| ^ ^

0 commit comments

Comments
 (0)