Incorrect suggestion of string_lit_as_bytes
lint
#4494
Labels
C-bug
Category: Clippy is not doing the correct thing
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Clippy version:
clippy 0.0.212 (e3cb40e 2019-06-25)
Clippy suggests using a byte string literal
b"string literal"
instead of"string literal".as_bytes()
.The suggestion does not compile in the following case because the type of byte string literal
&[u8; N]
does not implementstd::io::Read
.Playground
Clippy should allow the above case or suggest
&b"string literal"[..]
.The text was updated successfully, but these errors were encountered: