]> git.lizzy.rs Git - rust.git/commitdiff
Document use of Symbol::to_string()
authorXiretza <xiretza@xiretza.xyz>
Wed, 14 Sep 2022 16:35:22 +0000 (18:35 +0200)
committerXiretza <xiretza@xiretza.xyz>
Tue, 27 Sep 2022 18:29:19 +0000 (20:29 +0200)
compiler/rustc_parse/src/parser/diagnostics.rs

index ccba01630be16baf0ab54009966959a039f752b1..5df94331d7bb927482a3cb572aab14ea44692580 100644 (file)
@@ -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(),
                 })
             }