about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-01-31 08:12:10 +0000
committerbors <bors@rust-lang.org>2022-01-31 08:12:10 +0000
commit415c9f95884caebd0be9b837ef0885d1ffde1b9b (patch)
treedee55224d2f23cc0bfd794554c76228daa36046e /compiler/rustc_parse/src/parser
parentbb549e5afe8f23258606649cc3a2d8b8a51ef63a (diff)
parent4757a931cd69f57ab3e1d823ffa44b18c37e1223 (diff)
downloadrust-415c9f95884caebd0be9b837ef0885d1ffde1b9b.tar.gz
rust-415c9f95884caebd0be9b837ef0885d1ffde1b9b.zip
Auto merge of #93499 - matthiaskrgr:rollup-icdex11, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #93395 (Improve suggestion for escaping reserved keywords)
 - #93403 (review the total_cmp documentation)
 - #93461 (Accommodate yield points in the format_args expansion)
 - #93462 (Document `SystemTime` platform precision)
 - #93471 (unix: Use metadata for `DirEntry::file_type` fallback)
 - #93480 (Remove deprecated and unstable slice_partition_at_index functions)
 - #93485 (core: Remove some redundant {}s from the sorting code)
 - #93494 (kmc-solid: Inherit the calling task's base priority in `Thread::new`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 17bac362ec8..7b74b137d21 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -192,10 +192,10 @@ impl<'a> Parser<'a> {
                 if ident.is_raw_guess()
                     && self.look_ahead(1, |t| valid_follow.contains(&t.kind)) =>
             {
-                err.span_suggestion(
-                    ident.span,
-                    "you can escape reserved keywords to use them as identifiers",
-                    format!("r#{}", ident.name),
+                err.span_suggestion_verbose(
+                    ident.span.shrink_to_lo(),
+                    &format!("escape `{}` to use it as an identifier", ident.name),
+                    "r#".to_owned(),
                     Applicability::MaybeIncorrect,
                 );
             }