about summary refs log tree commit diff
path: root/compiler/rustc_builtin_macros/src/util.rs
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-12-31 05:03:22 +0000
committerMichael Goulet <michael@errs.io>2024-12-31 05:03:22 +0000
commitea291e5b5f5c2562fec89a11444e0dc4388565cf (patch)
tree4005485bc538e6c7d4d9d0623fbd5190e567a941 /compiler/rustc_builtin_macros/src/util.rs
parentc6afe82b8a3255145ba0eeeb49f8c590e38f38e2 (diff)
downloadrust-ea291e5b5f5c2562fec89a11444e0dc4388565cf.tar.gz
rust-ea291e5b5f5c2562fec89a11444e0dc4388565cf.zip
Account for format_args in HiddenUnicodeCodepoints lint
Diffstat (limited to 'compiler/rustc_builtin_macros/src/util.rs')
-rw-r--r--compiler/rustc_builtin_macros/src/util.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_builtin_macros/src/util.rs b/compiler/rustc_builtin_macros/src/util.rs
index 9162e94eddb..38fec2bff14 100644
--- a/compiler/rustc_builtin_macros/src/util.rs
+++ b/compiler/rustc_builtin_macros/src/util.rs
@@ -63,6 +63,10 @@ pub(crate) struct ExprToSpannedString {
     pub symbol: Symbol,
     pub style: ast::StrStyle,
     pub span: Span,
+    /// The raw string literal, with no escaping or processing.
+    ///
+    /// Generally only useful for lints that care about the raw bytes the user wrote.
+    pub uncooked_symbol: (ast::token::LitKind, Symbol),
 }
 
 /// - `Ok` is returned when the conversion to a string literal is unsuccessful,
@@ -100,6 +104,7 @@ pub(crate) fn expr_to_spanned_string<'a>(
                     symbol: s,
                     style,
                     span: expr.span,
+                    uncooked_symbol: (token_lit.kind, token_lit.symbol),
                 }));
             }
             Ok(ast::LitKind::ByteStr(..)) => {