Auto merge of #111916 - fee1-dead-contrib:noop-method-call-warn, r=compiler-errors
make `noop_method_call` warn by default r? `@compiler-errors`
This commit is contained in:
commit
4734ac0943
17 changed files with 165 additions and 108 deletions
|
@ -410,8 +410,8 @@ lint_non_upper_case_global = {$sort} `{$name}` should have an upper case name
|
|||
.label = should have an UPPER_CASE name
|
||||
|
||||
lint_noop_method_call = call to `.{$method}()` on a reference in this situation does nothing
|
||||
.label = unnecessary method call
|
||||
.note = the type `{$receiver_ty}` which `{$method}` is being called on is the same as the type returned from `{$method}`, so the method call does not do anything and can be removed
|
||||
.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
|
||||
|
||||
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