-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in ptr_arg on &mut Vec in trait #8366
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
Comments
dtolnay
added
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
labels
Jan 29, 2022
rustbot
added
the
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
label
Jan 29, 2022
dtolnay
added a commit
to serde-rs/json
that referenced
this issue
Jan 29, 2022
rust-lang/rust-clippy#8366 error: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do --> src/read.rs:65:45 | 65 | fn parse_str<'s>(&'s mut self, scratch: &'s mut Vec<u8>) -> Result<Reference<'de, 's, str>>; | ^^^^^^^^^^^^^^^ help: change this to: `&'s mut [u8]` | = note: `-D clippy::ptr-arg` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg error: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do --> src/read.rs:76:18 | 76 | scratch: &'s mut Vec<u8>, | ^^^^^^^^^^^^^^^ help: change this to: `&'s mut [u8]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
This was referenced Feb 6, 2022
ronaldslc
pushed a commit
to ronaldslc/serde-json
that referenced
this issue
Dec 3, 2022
rust-lang/rust-clippy#8366 error: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do --> src/read.rs:65:45 | 65 | fn parse_str<'s>(&'s mut self, scratch: &'s mut Vec<u8>) -> Result<Reference<'de, 's, str>>; | ^^^^^^^^^^^^^^^ help: change this to: `&'s mut [u8]` | = note: `-D clippy::ptr-arg` implied by `-D clippy::all` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg error: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do --> src/read.rs:76:18 | 76 | scratch: &'s mut Vec<u8>, | ^^^^^^^^^^^^^^^ help: change this to: `&'s mut [u8]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Summary
&mut Vec<T>
in a trait method signature used to correctly not triggerptr_arg
. As of the most recent nightly, it's started falsely positiving. The same type in a non-trait function does not seem to be affected.Lint Name
ptr_arg
Reproducer
Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: