diff options
| author | 许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com> | 2025-08-19 19:45:33 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-19 19:45:33 +0800 |
| commit | b638266f232ff260d7693ef7bb0a0d3051351369 (patch) | |
| tree | 2e3c5898ff757fb7f7286481b8cd1912322a2878 /compiler/rustc_parse/src/errors.rs | |
| parent | 9a5c00a673e68c05fd520682dedecb81d9cbc89f (diff) | |
| parent | f8f7c27d4f723913a6929e591c612865a7b62f70 (diff) | |
| download | rust-b638266f232ff260d7693ef7bb0a0d3051351369.tar.gz rust-b638266f232ff260d7693ef7bb0a0d3051351369.zip | |
Rollup merge of #145474 - fmease:paren-use-bounds-fix, r=fee1-dead
Properly recover from parenthesized use-bounds (precise capturing lists) plus small cleanups Fixes https://github.com/rust-lang/rust/issues/145470. First commit fixes the issue, second one performs some desperately needed cleanups. The fix shouldn't be a breaking change because IINM the parser always ensures that all brackets are balanced (via a buffer of brackets). Meaning even though we used to accept `(use<>` as a valid precise capturing list, it was guaranteed that we would fail in the end.
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
| -rw-r--r-- | compiler/rustc_parse/src/errors.rs | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index a105dd1909e..2c046329e33 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -3163,27 +3163,6 @@ pub(crate) struct ModifierLifetime { pub modifier: &'static str, } -#[derive(Subdiagnostic)] -#[multipart_suggestion( - parse_parenthesized_lifetime_suggestion, - applicability = "machine-applicable" -)] -pub(crate) struct RemoveParens { - #[suggestion_part(code = "")] - pub lo: Span, - #[suggestion_part(code = "")] - pub hi: Span, -} - -#[derive(Diagnostic)] -#[diag(parse_parenthesized_lifetime)] -pub(crate) struct ParenthesizedLifetime { - #[primary_span] - pub span: Span, - #[subdiagnostic] - pub sugg: RemoveParens, -} - #[derive(Diagnostic)] #[diag(parse_underscore_literal_suffix)] pub(crate) struct UnderscoreLiteralSuffix { |
