False positive redundant_slicing report when slicing as immutable slice to invoke Read trait methods taking (&mut self) #7972
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
Lint name: redundant_slicing
I tried this code:
I expected no lint warnings, due to the fact that the slicing in the last line is needed to call read_to_end on the immutable slice src.
Instead clippy reports redundant slicing of the whole range
Consequently,
cargo clippy --fix
fails with:Meta
Rust version (
rustc -Vv
):@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: