add suggestion
This commit is contained in:
parent
626efab67f
commit
2a76c570d6
7 changed files with 127 additions and 73 deletions
|
@ -412,7 +412,7 @@ 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
|
||||
.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`
|
||||
|
|
|
@ -1233,7 +1233,7 @@ pub struct NoopMethodCallDiag<'a> {
|
|||
pub method: Symbol,
|
||||
pub orig_ty: Ty<'a>,
|
||||
pub trait_: Symbol,
|
||||
#[label]
|
||||
#[suggestion(code = "", applicability = "machine-applicable")]
|
||||
pub label: Span,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue