Reword type ascription note to reduce verbosity
This commit is contained in:
parent
44a086ef39
commit
d72ef21ddd
10 changed files with 11 additions and 65 deletions
|
|
@ -5,16 +5,11 @@ LL | if let S { x: _x, y: 2 } = S { x: 1, y: 2 } { println!("Ok"); }
|
|||
| ^ 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 `==`
|
||||
|
|
@ -30,16 +25,11 @@ LL | for _ in std::ops::Range { start: 0, end: 10 } {}
|
|||
| ^ 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`
|
||||
|
|
|
|||
|
|
@ -90,16 +90,11 @@ LL | println!("{}", a: &mut 4);
|
|||
| ^ 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
|
||||
|
|
|
|||
|
|
@ -5,16 +5,11 @@ LL | Test::Drill(field: 42);
|
|||
| ^^ 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
|
||||
|
|
|
|||
|
|
@ -15,16 +15,11 @@ LL | loop { break 'label: loop { break 'label 42; }; }
|
|||
| ^^^^ 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
|
||||
|
|
|
|||
|
|
@ -5,16 +5,11 @@ LL | x: 3
|
|||
| ^ 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 `{`
|
||||
|
|
|
|||
|
|
@ -5,16 +5,11 @@ LL | x: 3
|
|||
| ^ 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 `{`
|
||||
|
|
|
|||
|
|
@ -5,16 +5,11 @@ LL | x: 3
|
|||
| ^ 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 `{`
|
||||
|
|
|
|||
|
|
@ -5,16 +5,11 @@ LL | x: 3
|
|||
| ^ 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 `{`
|
||||
|
|
|
|||
|
|
@ -13,16 +13,11 @@ LL | println!("test"): 0;
|
|||
| ^ 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue