about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorDavid Wood <david.wood@huawei.com>2023-07-24 15:04:29 +0100
committerDavid Wood <david.wood@huawei.com>2023-07-24 15:06:50 +0100
commitc06a7eb2a6dcbc7649de76472f6845e30f2fb97f (patch)
treee1df0a56c968da0b43d4ec97a30eee30f1843d64 /compiler
parentced592a99bfc6ad2c9aa014350686188963764e9 (diff)
downloadrust-c06a7eb2a6dcbc7649de76472f6845e30f2fb97f.tar.gz
rust-c06a7eb2a6dcbc7649de76472f6845e30f2fb97f.zip
builtin_macros: expect raw strings too
`expr_to_string` allows raw strings through so this code should be
expected to handle those.

Signed-off-by: David Wood <david@davidtw.co>
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_builtin_macros/src/env.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_builtin_macros/src/env.rs b/compiler/rustc_builtin_macros/src/env.rs
index bcff475f626..30d74ba593c 100644
--- a/compiler/rustc_builtin_macros/src/env.rs
+++ b/compiler/rustc_builtin_macros/src/env.rs
@@ -84,7 +84,7 @@ pub fn expand_env<'cx>(
             // Use the string literal in the code in the diagnostic to avoid confusing diagnostics,
             // e.g. when the literal contains escape sequences.
             let ast::ExprKind::Lit(ast::token::Lit {
-                kind: ast::token::LitKind::Str,
+                kind: ast::token::LitKind::Str | ast::token::LitKind::StrRaw(..),
                 symbol: original_var,
                 ..
             }) = &var_expr.kind