ptr_arg
false positive on ToOwned::clone_into()
#10612
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
ptr_arg
does not recognizeToOwned::clone_into()
as a call that requires&mut String
or&mut Vec<T>
, and incorrectly suggests changing to&mut str
or&mut [T]
.Lint Name
ptr_arg
Reproducer
I tried this code:
I saw this happen:
The suggestions do not compile.
I expected to see this happen: No warnings, since
clone_into
requires a mutable reference to the owned and resizable type.Version
Additional Labels
@rustbot label +I-suggestion-causes-error
The text was updated successfully, but these errors were encountered: