Skip to content

Commit 1afc7e2

Browse files
committed
Auto merge of #9634 - royrustdev:fix_redundant_allocation, r=Manishearth
Update Applicability of `redundant_allocation` lint from `MachineApplicable` to `MaybeIncorrect` This changes `redundant_allocation` lint from MachineApplicable to MaybeIncorrect ``` changelog: [`redundant_allocation]: Change Applicability from MachineApplicable to MaybeIncorrect ``` fixes #6243 --- changelog: [`redundant_allocation`]: Change Applicability from MachineApplicable to MaybeIncorrect
2 parents 502e87c + 1da1ff6 commit 1afc7e2

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

clippy_lints/src/types/redundant_allocation.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use rustc_span::symbol::sym;
1010
use super::{utils, REDUNDANT_ALLOCATION};
1111

1212
pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_>, def_id: DefId) -> bool {
13+
let mut applicability = Applicability::MaybeIncorrect;
1314
let outer_sym = if Some(def_id) == cx.tcx.lang_items().owned_box() {
1415
"Box"
1516
} else if cx.tcx.is_diagnostic_item(sym::Rc, def_id) {
@@ -21,7 +22,6 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
2122
};
2223

2324
if let Some(span) = utils::match_borrows_parameter(cx, qpath) {
24-
let mut applicability = Applicability::MaybeIncorrect;
2525
let generic_snippet = snippet_with_applicability(cx, span, "..", &mut applicability);
2626
span_lint_and_then(
2727
cx,
@@ -63,7 +63,6 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_
6363
None => return false,
6464
};
6565
if inner_sym == outer_sym {
66-
let mut applicability = Applicability::MaybeIncorrect;
6766
let generic_snippet = snippet_with_applicability(cx, inner_span, "..", &mut applicability);
6867
span_lint_and_then(
6968
cx,

0 commit comments

Comments
 (0)