diff options
| author | bors <bors@rust-lang.org> | 2024-03-24 02:30:17 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-24 02:30:17 +0000 |
| commit | 548e14b43963882fb758deb89e8258d9b8c2fc2a (patch) | |
| tree | ff8336cc01e7d2939240a37acba7096caeb19377 /compiler/rustc_parse/src/errors.rs | |
| parent | 9b8d12cf4c2311203aea83315552b15993bd4f81 (diff) | |
| parent | 6f16b41a4b299bfa31355e2d05110f54df93f9d8 (diff) | |
| download | rust-548e14b43963882fb758deb89e8258d9b8c2fc2a.tar.gz rust-548e14b43963882fb758deb89e8258d9b8c2fc2a.zip | |
Auto merge of #122966 - matthiaskrgr:rollup-20k8nsm, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #121281 (regression test for #103626) - #122168 (Fix validation on substituted callee bodies in MIR inliner) - #122217 (Handle str literals written with `'` lexed as lifetime) - #122379 (transmute: caution against int2ptr transmutation) - #122840 (`rustdoc --test`: Prevent reaching the maximum size of command-line by using files for arguments if there are too many) - #122907 (Uniquify `ReError` on input mode in canonicalizer) - #122942 (Add test in higher ranked subtype) - #122943 (add a couple more ice tests) - #122963 (core/panicking: fix outdated comment) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
| -rw-r--r-- | compiler/rustc_parse/src/errors.rs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index 5cad3a568ee..20ebfc6691b 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -1987,6 +1987,17 @@ pub enum UnknownPrefixSugg { style = "verbose" )] Whitespace(#[primary_span] Span), + #[multipart_suggestion( + parse_suggestion_str, + applicability = "maybe-incorrect", + style = "verbose" + )] + MeantStr { + #[suggestion_part(code = "\"")] + start: Span, + #[suggestion_part(code = "\"")] + end: Span, + }, } #[derive(Diagnostic)] @@ -2198,12 +2209,21 @@ pub enum MoreThanOneCharSugg { ch: String, }, #[suggestion(parse_use_double_quotes, code = "{sugg}", applicability = "machine-applicable")] - Quotes { + QuotesFull { #[primary_span] span: Span, is_byte: bool, sugg: String, }, + #[multipart_suggestion(parse_use_double_quotes, applicability = "machine-applicable")] + Quotes { + #[suggestion_part(code = "{prefix}\"")] + start: Span, + #[suggestion_part(code = "\"")] + end: Span, + is_byte: bool, + prefix: &'static str, + }, } #[derive(Subdiagnostic)] |
