Remove old diagnostic notes for type ascription syntax

Type ascription syntax was removed in 2023.
This commit is contained in:
Zalathar 2025-04-16 20:03:18 +10:00
parent efb1e3d676
commit 4d6ae78fa2
26 changed files with 1 additions and 62 deletions

View file

@ -806,9 +806,6 @@ parse_trait_alias_cannot_be_unsafe = trait aliases cannot be `unsafe`
parse_transpose_dyn_or_impl = `for<...>` expected after `{$kw}`, not before
.suggestion = move `{$kw}` before the `for<...>`
parse_type_ascription_removed =
if you meant to annotate an expression with a type, the type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
parse_unclosed_unicode_escape = unterminated unicode escape
.label = missing a closing `{"}"}`
.terminate = terminate the unicode escape

View file

@ -1598,9 +1598,6 @@ pub(crate) struct PathSingleColon {
#[suggestion(applicability = "machine-applicable", code = ":", style = "verbose")]
pub suggestion: Span,
#[note(parse_type_ascription_removed)]
pub type_ascription: bool,
}
#[derive(Diagnostic)]
@ -1617,9 +1614,6 @@ pub(crate) struct ColonAsSemi {
#[primary_span]
#[suggestion(applicability = "machine-applicable", code = ";", style = "verbose")]
pub span: Span,
#[note(parse_type_ascription_removed)]
pub type_ascription: bool,
}
#[derive(Diagnostic)]

View file

@ -1943,10 +1943,7 @@ impl<'a> Parser<'a> {
&& self.token == token::Colon
&& self.look_ahead(1, |next| line_idx(self.token.span) < line_idx(next.span))
{
self.dcx().emit_err(ColonAsSemi {
span: self.token.span,
type_ascription: self.psess.unstable_features.is_nightly_build(),
});
self.dcx().emit_err(ColonAsSemi { span: self.token.span });
self.bump();
return true;
}

View file

@ -273,7 +273,6 @@ impl<'a> Parser<'a> {
self.dcx().emit_err(PathSingleColon {
span: self.prev_token.span,
suggestion: self.prev_token.span.shrink_to_hi(),
type_ascription: self.psess.unstable_features.is_nightly_build(),
});
}
continue;
@ -348,7 +347,6 @@ impl<'a> Parser<'a> {
err = self.dcx().create_err(PathSingleColon {
span: self.token.span,
suggestion: self.prev_token.span.shrink_to_hi(),
type_ascription: self.psess.unstable_features.is_nightly_build(),
});
}
// Attempt to find places where a missing `>` might belong.

View file

@ -771,10 +771,6 @@ impl<'a> Parser<'a> {
Applicability::MaybeIncorrect,
);
}
if self.psess.unstable_features.is_nightly_build() {
// FIXME(Nilstrieb): Remove this again after a few months.
err.note("type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>");
}
}
}