Rollup merge of #114014 - davidtwco:issue-114010-env-rawstr, r=cjgillot

builtin_macros: expect raw strings too

Fixes #114010.

`expr_to_string` allows raw strings through so this code should be expected to handle those.
This commit is contained in:
Matthias Krüger 2023-07-25 19:21:37 +02:00 committed by GitHub
commit 0f3a149dc8

View File

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