From caefac034e55b3cd0568a493c85308e1fc518cda Mon Sep 17 00:00:00 2001 From: Xiretza Date: Wed, 14 Sep 2022 18:35:22 +0200 Subject: [PATCH] Document use of Symbol::to_string() --- compiler/rustc_parse/src/parser/diagnostics.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index ccba01630be1..5df94331d7bb 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -309,6 +309,8 @@ impl<'a> Parser<'a> { { Some(SuggEscapeToUseAsIdentifier { span: ident.span.shrink_to_lo(), + // `Symbol::to_string()` is different from `Symbol::into_diagnostic_arg()`, + // which uses `Symbol::to_ident_string()` and "helpfully" adds an implicit `r#` ident_name: ident.name.to_string(), }) }