Skip to content

Commit 516a565

Browse files
committed
clippy: env! invocations can't be b"" literals
Signed-off-by: David Wood <[email protected]>
1 parent 75df62d commit 516a565

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tools/clippy/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)