diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-04-17 00:14:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-17 00:14:27 +0200 |
| commit | 082073f8ffe93266079b6240f5d1571c7e6d72d5 (patch) | |
| tree | ca65108a72d495976de55893424c50079d3376f4 /compiler/rustc_parse/src/parser | |
| parent | 1ced3260f63fbf8e8eaa2b0b5b49a19916aa28b0 (diff) | |
| parent | 4d6ae78fa22d04b2c255cb43faabc1ada36cd2c1 (diff) | |
| download | rust-082073f8ffe93266079b6240f5d1571c7e6d72d5.tar.gz rust-082073f8ffe93266079b6240f5d1571c7e6d72d5.zip | |
Rollup merge of #139908 - Zalathar:no-ascription, r=jieyouxu
parser: Remove old diagnostic notes for type ascription syntax Type ascription syntax was removed by #109128 in 2023, so “remove this again in a few months” is long overdue. Happily, this also reduces the amount of parser diagnostic code that cares whether the compiler is unstable. --- See also the recent #138898, which removed some other related dead code but declined to touch the diagnostics. It's possible that some of these parser tests are no longer useful at all, but I haven't investigated them for this PR.
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/diagnostics.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/path.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/stmt.rs | 4 |
3 files changed, 1 insertions, 10 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index a4978b5a0fe..b6945c6f7db 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -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; } diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs index 30fb96c6ea9..02883655662 100644 --- a/compiler/rustc_parse/src/parser/path.rs +++ b/compiler/rustc_parse/src/parser/path.rs @@ -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. diff --git a/compiler/rustc_parse/src/parser/stmt.rs b/compiler/rustc_parse/src/parser/stmt.rs index 551b9e2f137..0cc8b605018 100644 --- a/compiler/rustc_parse/src/parser/stmt.rs +++ b/compiler/rustc_parse/src/parser/stmt.rs @@ -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>"); - } } } |
