Skip to content

Commit

Permalink
Explicitly suggest 'type_ascription' feature
Browse files Browse the repository at this point in the history
  • Loading branch information
VirrageS committed May 30, 2019
1 parent aee7012 commit 4c5eb8e
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/libsyntax/parse/diagnostics.rs
Expand Up @@ -858,8 +858,8 @@ impl<'a> Parser<'a> {
Applicability::MaybeIncorrect,
);
} else {
err.note("type ascription is a nightly-only feature that lets \
you annotate an expression with a type: `<expr>: <type>`")
err.note("#![feature(type_ascription)] lets you annotate an \
expression with a type: `<expr>: <type>`")
.span_note(
lhs_span,
"this expression expects an ascribed type after the colon",
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-22644.stderr
Expand Up @@ -89,7 +89,7 @@ error: expected type, found `4`
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: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
note: this expression expects an ascribed type after the colon
--> $DIR/issue-22644.rs:34:20
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-34255-1.stderr
Expand Up @@ -4,7 +4,7 @@ error: expected type, found `42`
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: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
note: this expression expects an ascribed type after the colon
--> $DIR/issue-34255-1.rs:8:17
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/lifetime_starts_expressions.stderr
Expand Up @@ -14,7 +14,7 @@ error: expected type, found keyword `loop`
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: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
note: this expression expects an ascribed type after the colon
--> $DIR/lifetime_starts_expressions.rs:6:12
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/parser/recover-from-bad-variant.stderr
Expand Up @@ -4,7 +4,7 @@ error: expected type, found `3`
LL | let x = Enum::Foo(a: 3, b: 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: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
note: this expression expects an ascribed type after the colon
--> $DIR/recover-from-bad-variant.rs:7:23
|
Expand Down
Expand Up @@ -12,7 +12,7 @@ error: expected type, found `0`
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: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
note: this expression expects an ascribed type after the colon
--> $DIR/type-ascription-instead-of-statement-end.rs:9:5
|
Expand Down

0 comments on commit 4c5eb8e

Please sign in to comment.