Skip to content

Commit 0f3a149

Browse files
authored
Rollup merge of rust-lang#114014 - davidtwco:issue-114010-env-rawstr, r=cjgillot
builtin_macros: expect raw strings too Fixes rust-lang#114010. `expr_to_string` allows raw strings through so this code should be expected to handle those.
2 parents 2b16c37 + a147372 commit 0f3a149

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/strings.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl<'tcx> LateLintPass<'tcx> for StringLitAsBytes {
328328
{
329329
// Don't lint. Byte strings produce `&[u8; N]` whereas `as_bytes()` produces
330330
// `&[u8]`. This change would prevent matching with different sized slices.
331-
} else {
331+
} else if !callsite.starts_with("env!") {
332332
span_lint_and_sugg(
333333
cx,
334334
STRING_LIT_AS_BYTES,

0 commit comments

Comments
 (0)