you annotate an expression with a type: `<expr>: <type>`");
err.span_note(
lhs_span,
- "this expression is annotated with type ascription...",
- );
- err.span_note(
- cur_op_span,
- "...due to this, which is why a type is expected after",
+ "this expression expects an ascribed type after the colon",
);
err.help("this might be indicative of a syntax error elsewhere");
}
| ^ expecting a type here because of type ascription
|
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
--> $DIR/E0423.rs:12:36
|
LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
| ^
-note: ...due to this, which is why a type is expected after
- --> $DIR/E0423.rs:12:37
- |
-LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
- | ^
= help: this might be indicative of a syntax error elsewhere
error: expected expression, found `==`
| ^ expecting a type here because of type ascription
|
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
--> $DIR/E0423.rs:21:32
|
LL | for _ in std::ops::Range { start: 0, end: 10 } {}
| ^^^^^
-note: ...due to this, which is why a type is expected after
- --> $DIR/E0423.rs:21:37
- |
-LL | for _ in std::ops::Range { start: 0, end: 10 } {}
- | ^
= help: this might be indicative of a syntax error elsewhere
error[E0423]: expected function, found struct `Foo`
| ^ expecting a type here because of type ascription
|
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
--> $DIR/issue-22644.rs:34:20
|
LL | println!("{}", a: &mut 4);
| ^
-note: ...due to this, which is why a type is expected after
- --> $DIR/issue-22644.rs:34:21
- |
-LL | println!("{}", a: &mut 4);
- | ^
= help: this might be indicative of a syntax error elsewhere
error: aborting due to 9 previous errors
| ^^ expecting a type here because of type ascription
|
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
--> $DIR/issue-34255-1.rs:8:17
|
LL | Test::Drill(field: 42);
| ^^^^^
-note: ...due to this, which is why a type is expected after
- --> $DIR/issue-34255-1.rs:8:22
- |
-LL | Test::Drill(field: 42);
- | ^
= help: this might be indicative of a syntax error elsewhere
error: aborting due to previous error
| ^^^^ expecting a type here because of type ascription
|
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
--> $DIR/lifetime_starts_expressions.rs:6:12
|
LL | loop { break 'label: loop { break 'label 42; }; }
| ^^^^^^^^^^^^
-note: ...due to this, which is why a type is expected after
- --> $DIR/lifetime_starts_expressions.rs:6:24
- |
-LL | loop { break 'label: loop { break 'label 42; }; }
- | ^
= help: this might be indicative of a syntax error elsewhere
error: aborting due to 2 previous errors
| ^ expecting a type here because of type ascription
|
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
--> $DIR/struct-literal-in-for.rs:13:9
|
LL | x: 3
| ^
-note: ...due to this, which is why a type is expected after
- --> $DIR/struct-literal-in-for.rs:13:10
- |
-LL | x: 3
- | ^
= help: this might be indicative of a syntax error elsewhere
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
| ^ expecting a type here because of type ascription
|
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
--> $DIR/struct-literal-in-if.rs:13:9
|
LL | x: 3
| ^
-note: ...due to this, which is why a type is expected after
- --> $DIR/struct-literal-in-if.rs:13:10
- |
-LL | x: 3
- | ^
= help: this might be indicative of a syntax error elsewhere
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
| ^ expecting a type here because of type ascription
|
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
--> $DIR/struct-literal-in-while.rs:13:9
|
LL | x: 3
| ^
-note: ...due to this, which is why a type is expected after
- --> $DIR/struct-literal-in-while.rs:13:10
- |
-LL | x: 3
- | ^
= help: this might be indicative of a syntax error elsewhere
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
| ^ expecting a type here because of type ascription
|
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
--> $DIR/struct-literal-restrictions-in-lamda.rs:13:9
|
LL | x: 3
| ^
-note: ...due to this, which is why a type is expected after
- --> $DIR/struct-literal-restrictions-in-lamda.rs:13:10
- |
-LL | x: 3
- | ^
= help: this might be indicative of a syntax error elsewhere
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
| ^ expecting a type here because of type ascription
|
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
-note: this expression is annotated with type ascription...
+note: this expression expects an ascribed type after the colon
--> $DIR/type-ascription-instead-of-statement-end.rs:9:5
|
LL | println!("test"): 0;
| ^^^^^^^^^^^^^^^^
-note: ...due to this, which is why a type is expected after
- --> $DIR/type-ascription-instead-of-statement-end.rs:9:21
- |
-LL | println!("test"): 0;
- | ^
= help: this might be indicative of a syntax error elsewhere
error: aborting due to 2 previous errors