Skip to content

Commit 4c5eb8e

Browse files
committed
Explicitly suggest 'type_ascription' feature
1 parent aee7012 commit 4c5eb8e

6 files changed

+7
-7
lines changed

src/libsyntax/parse/diagnostics.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,8 @@ impl<'a> Parser<'a> {
858858
Applicability::MaybeIncorrect,
859859
);
860860
} else {
861-
err.note("type ascription is a nightly-only feature that lets \
862-
you annotate an expression with a type: `<expr>: <type>`")
861+
err.note("#![feature(type_ascription)] lets you annotate an \
862+
expression with a type: `<expr>: <type>`")
863863
.span_note(
864864
lhs_span,
865865
"this expression expects an ascribed type after the colon",

src/test/ui/issues/issue-22644.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ error: expected type, found `4`
8989
LL | println!("{}", a: &mut 4);
9090
| ^ expecting a type here because of type ascription
9191
|
92-
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
92+
= note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
9393
note: this expression expects an ascribed type after the colon
9494
--> $DIR/issue-22644.rs:34:20
9595
|

src/test/ui/issues/issue-34255-1.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: expected type, found `42`
44
LL | Test::Drill(field: 42);
55
| ^^ expecting a type here because of type ascription
66
|
7-
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
7+
= note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
88
note: this expression expects an ascribed type after the colon
99
--> $DIR/issue-34255-1.rs:8:17
1010
|

src/test/ui/lifetime_starts_expressions.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ error: expected type, found keyword `loop`
1414
LL | loop { break 'label: loop { break 'label 42; }; }
1515
| ^^^^ expecting a type here because of type ascription
1616
|
17-
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
17+
= note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
1818
note: this expression expects an ascribed type after the colon
1919
--> $DIR/lifetime_starts_expressions.rs:6:12
2020
|

src/test/ui/parser/recover-from-bad-variant.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: expected type, found `3`
44
LL | let x = Enum::Foo(a: 3, b: 4);
55
| ^ expecting a type here because of type ascription
66
|
7-
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
7+
= note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
88
note: this expression expects an ascribed type after the colon
99
--> $DIR/recover-from-bad-variant.rs:7:23
1010
|

src/test/ui/type/type-ascription-instead-of-statement-end.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ error: expected type, found `0`
1212
LL | println!("test"): 0;
1313
| ^ expecting a type here because of type ascription
1414
|
15-
= note: type ascription is a nightly-only feature that lets you annotate an expression with a type: `<expr>: <type>`
15+
= note: #![feature(type_ascription)] lets you annotate an expression with a type: `<expr>: <type>`
1616
note: this expression expects an ascribed type after the colon
1717
--> $DIR/type-ascription-instead-of-statement-end.rs:9:5
1818
|

0 commit comments

Comments
 (0)