fix typo
This commit is contained in:
parent
617ce2b7ee
commit
e0cef5cf40
11 changed files with 23 additions and 23 deletions
|
@ -4182,7 +4182,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
|
|||
{
|
||||
err.span_suggestion(
|
||||
*sp,
|
||||
"parenthesis are required to parse this \
|
||||
"parentheses are required to parse this \
|
||||
as an expression",
|
||||
format!("({})", snippet),
|
||||
Applicability::MachineApplicable,
|
||||
|
|
|
@ -2934,7 +2934,7 @@ impl<'a> Parser<'a> {
|
|||
if let Ok(snippet) = self.sess.source_map().span_to_snippet(*sp) {
|
||||
err.span_suggestion(
|
||||
*sp,
|
||||
"parenthesis are required to parse this as an expression",
|
||||
"parentheses are required to parse this as an expression",
|
||||
format!("({})", snippet),
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
|
@ -2979,7 +2979,7 @@ impl<'a> Parser<'a> {
|
|||
"struct literals are not allowed here",
|
||||
);
|
||||
err.multipart_suggestion(
|
||||
"surround the struct literal with parenthesis",
|
||||
"surround the struct literal with parentheses",
|
||||
vec![
|
||||
(lo.shrink_to_lo(), "(".to_string()),
|
||||
(expr.span.shrink_to_hi(), ")".to_string()),
|
||||
|
@ -3661,7 +3661,7 @@ impl<'a> Parser<'a> {
|
|||
.unwrap_or_else(|_| pprust::expr_to_string(&lhs));
|
||||
err.span_suggestion(
|
||||
lhs.span,
|
||||
"parenthesis are required to parse this as an expression",
|
||||
"parentheses are required to parse this as an expression",
|
||||
format!("({})", snippet),
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
|
@ -4982,7 +4982,7 @@ impl<'a> Parser<'a> {
|
|||
if let Ok(snippet) = self.sess.source_map().span_to_snippet(*sp) {
|
||||
err.span_suggestion(
|
||||
*sp,
|
||||
"parenthesis are required to parse this as an expression",
|
||||
"parentheses are required to parse this as an expression",
|
||||
format!("({})", snippet),
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
|
|
|
@ -3,7 +3,7 @@ error: struct literals are not allowed here
|
|||
|
|
||||
LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
help: surround the struct literal with parenthesis
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | if let S { x: _x, y: 2 } = (S { x: 1, y: 2 }) { println!("Ok"); }
|
||||
| ^ ^
|
||||
|
@ -19,7 +19,7 @@ error: struct literals are not allowed here
|
|||
|
|
||||
LL | for _ in std::ops::Range { start: 0, end: 10 } {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: surround the struct literal with parenthesis
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | for _ in (std::ops::Range { start: 0, end: 10 }) {}
|
||||
| ^ ^
|
||||
|
|
|
@ -4,7 +4,7 @@ error: expected expression, found `+`
|
|||
LL | {2} + {2}
|
||||
| --- ^ expected expression
|
||||
| |
|
||||
| help: parenthesis are required to parse this as an expression: `({2})`
|
||||
| help: parentheses are required to parse this as an expression: `({2})`
|
||||
|
||||
error: expected expression, found `+`
|
||||
--> $DIR/expr-as-stmt.rs:12:9
|
||||
|
@ -12,7 +12,7 @@ error: expected expression, found `+`
|
|||
LL | {2} + 2
|
||||
| --- ^ expected expression
|
||||
| |
|
||||
| help: parenthesis are required to parse this as an expression: `({2})`
|
||||
| help: parentheses are required to parse this as an expression: `({2})`
|
||||
|
||||
error: expected expression, found `+`
|
||||
--> $DIR/expr-as-stmt.rs:18:12
|
||||
|
@ -20,13 +20,13 @@ error: expected expression, found `+`
|
|||
LL | { 42 } + foo;
|
||||
| ------ ^ expected expression
|
||||
| |
|
||||
| help: parenthesis are required to parse this as an expression: `({ 42 })`
|
||||
| help: parentheses are required to parse this as an expression: `({ 42 })`
|
||||
|
||||
error: expected expression, found `&&`
|
||||
--> $DIR/expr-as-stmt.rs:30:5
|
||||
|
|
||||
LL | if let Some(x) = a { true } else { false }
|
||||
| ------------------------------------------ help: parenthesis are required to parse this as an expression: `(if let Some(x) = a { true } else { false })`
|
||||
| ------------------------------------------ help: parentheses are required to parse this as an expression: `(if let Some(x) = a { true } else { false })`
|
||||
LL | &&
|
||||
| ^^ expected expression
|
||||
|
||||
|
@ -35,7 +35,7 @@ error: expected expression, found `>`
|
|||
|
|
||||
LL | } > 0
|
||||
| ^ expected expression
|
||||
help: parenthesis are required to parse this as an expression
|
||||
help: parentheses are required to parse this as an expression
|
||||
|
|
||||
LL | (match x {
|
||||
LL | _ => 1,
|
||||
|
@ -84,7 +84,7 @@ error[E0614]: type `{integer}` cannot be dereferenced
|
|||
LL | { 3 } * 3
|
||||
| ----- ^^^
|
||||
| |
|
||||
| help: parenthesis are required to parse this as an expression: `({ 3 })`
|
||||
| help: parentheses are required to parse this as an expression: `({ 3 })`
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ error: expected pattern, found `+`
|
|||
|
|
||||
LL | } + 5
|
||||
| ^ expected pattern
|
||||
help: parenthesis are required to parse this as an expression
|
||||
help: parentheses are required to parse this as an expression
|
||||
|
|
||||
LL | 0 => ({
|
||||
LL | 0
|
||||
|
|
|
@ -6,7 +6,7 @@ LL | for x in Foo {
|
|||
LL | | x: 3
|
||||
LL | | }.hi() {
|
||||
| |_____^
|
||||
help: surround the struct literal with parenthesis
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | for x in (Foo {
|
||||
LL | x: 3
|
||||
|
|
|
@ -6,7 +6,7 @@ LL | if Foo {
|
|||
LL | | x: 3
|
||||
LL | | }.hi() {
|
||||
| |_____^
|
||||
help: surround the struct literal with parenthesis
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | if (Foo {
|
||||
LL | x: 3
|
||||
|
|
|
@ -6,7 +6,7 @@ LL | match Foo {
|
|||
LL | | x: 3
|
||||
LL | | } {
|
||||
| |_____^
|
||||
help: surround the struct literal with parenthesis
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | match (Foo {
|
||||
LL | x: 3
|
||||
|
|
|
@ -6,7 +6,7 @@ LL | while Foo {
|
|||
LL | | x: 3
|
||||
LL | | }.hi() {
|
||||
| |_____^
|
||||
help: surround the struct literal with parenthesis
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | while (Foo {
|
||||
LL | x: 3
|
||||
|
|
|
@ -6,7 +6,7 @@ LL | while || Foo {
|
|||
LL | | x: 3
|
||||
LL | | }.hi() {
|
||||
| |_____^
|
||||
help: surround the struct literal with parenthesis
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | while || (Foo {
|
||||
LL | x: 3
|
||||
|
|
|
@ -3,7 +3,7 @@ error: struct literals are not allowed here
|
|||
|
|
||||
LL | if x == E::I { field1: true, field2: 42 } {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
help: surround the struct literal with parenthesis
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | if x == (E::I { field1: true, field2: 42 }) {}
|
||||
| ^ ^
|
||||
|
@ -13,7 +13,7 @@ error: struct literals are not allowed here
|
|||
|
|
||||
LL | if x == E::V { field: false } {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
help: surround the struct literal with parenthesis
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | if x == (E::V { field: false }) {}
|
||||
| ^ ^
|
||||
|
@ -23,7 +23,7 @@ error: struct literals are not allowed here
|
|||
|
|
||||
LL | if x == E::J { field: -42 } {}
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
help: surround the struct literal with parenthesis
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | if x == (E::J { field: -42 }) {}
|
||||
| ^ ^
|
||||
|
@ -33,7 +33,7 @@ error: struct literals are not allowed here
|
|||
|
|
||||
LL | if x == E::K { field: "" } {}
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
help: surround the struct literal with parenthesis
|
||||
help: surround the struct literal with parentheses
|
||||
|
|
||||
LL | if x == (E::K { field: "" }) {}
|
||||
| ^ ^
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue