cmp_owned correct error message if rhs is deref
This commit is contained in:
@@ -579,6 +579,10 @@ fn check_to_owned(cx: &LateContext<'_, '_>, expr: &Expr, other: &Expr) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if other_gets_derefed {
|
||||
db.span_label(lint_span, "try implementing the comparison without allocating");
|
||||
return;
|
||||
}
|
||||
db.span_suggestion_with_applicability(
|
||||
lint_span,
|
||||
"try",
|
||||
|
||||
Reference in New Issue
Block a user