Skip to content

Commit e0cef5c

Browse files
committed
fix typo
1 parent 617ce2b commit e0cef5c

11 files changed

+23
-23
lines changed

src/librustc_typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4182,7 +4182,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
41824182
{
41834183
err.span_suggestion(
41844184
*sp,
4185-
"parenthesis are required to parse this \
4185+
"parentheses are required to parse this \
41864186
as an expression",
41874187
format!("({})", snippet),
41884188
Applicability::MachineApplicable,

src/libsyntax/parse/parser.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -2934,7 +2934,7 @@ impl<'a> Parser<'a> {
29342934
if let Ok(snippet) = self.sess.source_map().span_to_snippet(*sp) {
29352935
err.span_suggestion(
29362936
*sp,
2937-
"parenthesis are required to parse this as an expression",
2937+
"parentheses are required to parse this as an expression",
29382938
format!("({})", snippet),
29392939
Applicability::MachineApplicable,
29402940
);
@@ -2979,7 +2979,7 @@ impl<'a> Parser<'a> {
29792979
"struct literals are not allowed here",
29802980
);
29812981
err.multipart_suggestion(
2982-
"surround the struct literal with parenthesis",
2982+
"surround the struct literal with parentheses",
29832983
vec![
29842984
(lo.shrink_to_lo(), "(".to_string()),
29852985
(expr.span.shrink_to_hi(), ")".to_string()),
@@ -3661,7 +3661,7 @@ impl<'a> Parser<'a> {
36613661
.unwrap_or_else(|_| pprust::expr_to_string(&lhs));
36623662
err.span_suggestion(
36633663
lhs.span,
3664-
"parenthesis are required to parse this as an expression",
3664+
"parentheses are required to parse this as an expression",
36653665
format!("({})", snippet),
36663666
Applicability::MachineApplicable,
36673667
);
@@ -4982,7 +4982,7 @@ impl<'a> Parser<'a> {
49824982
if let Ok(snippet) = self.sess.source_map().span_to_snippet(*sp) {
49834983
err.span_suggestion(
49844984
*sp,
4985-
"parenthesis are required to parse this as an expression",
4985+
"parentheses are required to parse this as an expression",
49864986
format!("({})", snippet),
49874987
Applicability::MachineApplicable,
49884988
);

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error: struct literals are not allowed here
33
|
44
LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
55
| ^^^^^^^^^^^^^^^^
6-
help: surround the struct literal with parenthesis
6+
help: surround the struct literal with parentheses
77
|
88
LL | if let S { x: _x, y: 2 } = (S { x: 1, y: 2 }) { println!("Ok"); }
99
| ^ ^
@@ -19,7 +19,7 @@ error: struct literals are not allowed here
1919
|
2020
LL | for _ in std::ops::Range { start: 0, end: 10 } {}
2121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22-
help: surround the struct literal with parenthesis
22+
help: surround the struct literal with parentheses
2323
|
2424
LL | for _ in (std::ops::Range { start: 0, end: 10 }) {}
2525
| ^ ^

src/test/ui/parser/expr-as-stmt.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,29 @@ error: expected expression, found `+`
44
LL | {2} + {2}
55
| --- ^ expected expression
66
| |
7-
| help: parenthesis are required to parse this as an expression: `({2})`
7+
| help: parentheses are required to parse this as an expression: `({2})`
88

99
error: expected expression, found `+`
1010
--> $DIR/expr-as-stmt.rs:12:9
1111
|
1212
LL | {2} + 2
1313
| --- ^ expected expression
1414
| |
15-
| help: parenthesis are required to parse this as an expression: `({2})`
15+
| help: parentheses are required to parse this as an expression: `({2})`
1616

1717
error: expected expression, found `+`
1818
--> $DIR/expr-as-stmt.rs:18:12
1919
|
2020
LL | { 42 } + foo;
2121
| ------ ^ expected expression
2222
| |
23-
| help: parenthesis are required to parse this as an expression: `({ 42 })`
23+
| help: parentheses are required to parse this as an expression: `({ 42 })`
2424

2525
error: expected expression, found `&&`
2626
--> $DIR/expr-as-stmt.rs:30:5
2727
|
2828
LL | if let Some(x) = a { true } else { false }
29-
| ------------------------------------------ help: parenthesis are required to parse this as an expression: `(if let Some(x) = a { true } else { false })`
29+
| ------------------------------------------ help: parentheses are required to parse this as an expression: `(if let Some(x) = a { true } else { false })`
3030
LL | &&
3131
| ^^ expected expression
3232

@@ -35,7 +35,7 @@ error: expected expression, found `>`
3535
|
3636
LL | } > 0
3737
| ^ expected expression
38-
help: parenthesis are required to parse this as an expression
38+
help: parentheses are required to parse this as an expression
3939
|
4040
LL | (match x {
4141
LL | _ => 1,
@@ -84,7 +84,7 @@ error[E0614]: type `{integer}` cannot be dereferenced
8484
LL | { 3 } * 3
8585
| ----- ^^^
8686
| |
87-
| help: parenthesis are required to parse this as an expression: `({ 3 })`
87+
| help: parentheses are required to parse this as an expression: `({ 3 })`
8888

8989
error: aborting due to 10 previous errors
9090

src/test/ui/parser/match-arrows-block-then-binop.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error: expected pattern, found `+`
33
|
44
LL | } + 5
55
| ^ expected pattern
6-
help: parenthesis are required to parse this as an expression
6+
help: parentheses are required to parse this as an expression
77
|
88
LL | 0 => ({
99
LL | 0

src/test/ui/parser/struct-literal-in-for.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | for x in Foo {
66
LL | | x: 3
77
LL | | }.hi() {
88
| |_____^
9-
help: surround the struct literal with parenthesis
9+
help: surround the struct literal with parentheses
1010
|
1111
LL | for x in (Foo {
1212
LL | x: 3

src/test/ui/parser/struct-literal-in-if.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | if Foo {
66
LL | | x: 3
77
LL | | }.hi() {
88
| |_____^
9-
help: surround the struct literal with parenthesis
9+
help: surround the struct literal with parentheses
1010
|
1111
LL | if (Foo {
1212
LL | x: 3

src/test/ui/parser/struct-literal-in-match-discriminant.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | match Foo {
66
LL | | x: 3
77
LL | | } {
88
| |_____^
9-
help: surround the struct literal with parenthesis
9+
help: surround the struct literal with parentheses
1010
|
1111
LL | match (Foo {
1212
LL | x: 3

src/test/ui/parser/struct-literal-in-while.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | while Foo {
66
LL | | x: 3
77
LL | | }.hi() {
88
| |_____^
9-
help: surround the struct literal with parenthesis
9+
help: surround the struct literal with parentheses
1010
|
1111
LL | while (Foo {
1212
LL | x: 3

src/test/ui/parser/struct-literal-restrictions-in-lamda.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | while || Foo {
66
LL | | x: 3
77
LL | | }.hi() {
88
| |_____^
9-
help: surround the struct literal with parenthesis
9+
help: surround the struct literal with parentheses
1010
|
1111
LL | while || (Foo {
1212
LL | x: 3

src/test/ui/struct-literal-variant-in-if.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ error: struct literals are not allowed here
33
|
44
LL | if x == E::I { field1: true, field2: 42 } {}
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
help: surround the struct literal with parenthesis
6+
help: surround the struct literal with parentheses
77
|
88
LL | if x == (E::I { field1: true, field2: 42 }) {}
99
| ^ ^
@@ -13,7 +13,7 @@ error: struct literals are not allowed here
1313
|
1414
LL | if x == E::V { field: false } {}
1515
| ^^^^^^^^^^^^^^^^^^^^^
16-
help: surround the struct literal with parenthesis
16+
help: surround the struct literal with parentheses
1717
|
1818
LL | if x == (E::V { field: false }) {}
1919
| ^ ^
@@ -23,7 +23,7 @@ error: struct literals are not allowed here
2323
|
2424
LL | if x == E::J { field: -42 } {}
2525
| ^^^^^^^^^^^^^^^^^^^
26-
help: surround the struct literal with parenthesis
26+
help: surround the struct literal with parentheses
2727
|
2828
LL | if x == (E::J { field: -42 }) {}
2929
| ^ ^
@@ -33,7 +33,7 @@ error: struct literals are not allowed here
3333
|
3434
LL | if x == E::K { field: "" } {}
3535
| ^^^^^^^^^^^^^^^^^^
36-
help: surround the struct literal with parenthesis
36+
help: surround the struct literal with parentheses
3737
|
3838
LL | if x == (E::K { field: "" }) {}
3939
| ^ ^

0 commit comments

Comments
 (0)