From: Xiretza Date: Wed, 14 Sep 2022 16:35:22 +0000 (+0200) Subject: Document use of Symbol::to_string() X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=caefac034e55b3cd0568a493c85308e1fc518cda;hp=00f95468c4abd82cf71dc17004e1fd2e6cc72213;p=rust.git Document use of Symbol::to_string() --- diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs index ccba01630be..5df94331d7b 100644 --- a/compiler/rustc_parse/src/parser/diagnostics.rs +++ b/compiler/rustc_parse/src/parser/diagnostics.rs @@ -309,6 +309,8 @@ pub(super) fn expected_ident_found(&self) -> DiagnosticBuilder<'a, ErrorGuarante { 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(), }) }