When encountering <&T as Clone>::clone(x)
because T: Clone
, suggest #[derive(Clone)]
CC #40699.
This commit is contained in:
parent
2dc0170233
commit
6017de46f7
6 changed files with 80 additions and 78 deletions
|
@ -429,6 +429,7 @@ lint_non_upper_case_global = {$sort} `{$name}` should have an upper case name
|
|||
lint_noop_method_call = call to `.{$method}()` on a reference in this situation does nothing
|
||||
.suggestion = remove this redundant call
|
||||
.note = the type `{$orig_ty}` does not implement `{$trait_}`, so calling `{$method}` on `&{$orig_ty}` copies the reference, which does not do anything and can be removed
|
||||
.derive_suggestion = if you meant to clone `{$orig_ty}`, implement `Clone` for it
|
||||
|
||||
lint_only_cast_u8_to_char = only `u8` can be cast into `char`
|
||||
.suggestion = use a `char` literal instead
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue