diff options
| author | royrustdev <royrustdev@gmail.com> | 2022-10-12 18:01:08 +0530 |
|---|---|---|
| committer | royrustdev <royrustdev@gmail.com> | 2022-10-19 12:39:44 +0530 |
| commit | 1da1ff6b3c01bef0fbdcfae278480717bb54582c (patch) | |
| tree | bb6bea3d0fb2e7efc89ce4a79be0b54fdcb30b8a | |
| parent | b8a9a507bf9e3149d287841454842116c72d66c4 (diff) | |
| download | rust-1da1ff6b3c01bef0fbdcfae278480717bb54582c.tar.gz rust-1da1ff6b3c01bef0fbdcfae278480717bb54582c.zip | |
Update Applicability of `redundant_allocation` lint from
`MachineApplicable` to `Unspecified`
| -rw-r--r-- | clippy_lints/src/types/redundant_allocation.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clippy_lints/src/types/redundant_allocation.rs b/clippy_lints/src/types/redundant_allocation.rs index 92d2c48a589..7883353e3fe 100644 --- a/clippy_lints/src/types/redundant_allocation.rs +++ b/clippy_lints/src/types/redundant_allocation.rs @@ -10,6 +10,7 @@ use rustc_span::symbol::sym; use super::{utils, REDUNDANT_ALLOCATION}; pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_>, def_id: DefId) -> bool { + let mut applicability = Applicability::MaybeIncorrect; let outer_sym = if Some(def_id) == cx.tcx.lang_items().owned_box() { "Box" } 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<'_ }; if let Some(span) = utils::match_borrows_parameter(cx, qpath) { - let mut applicability = Applicability::MaybeIncorrect; let generic_snippet = snippet_with_applicability(cx, span, "..", &mut applicability); span_lint_and_then( cx, @@ -63,7 +63,6 @@ pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_ None => return false, }; if inner_sym == outer_sym { - let mut applicability = Applicability::MaybeIncorrect; let generic_snippet = snippet_with_applicability(cx, inner_span, "..", &mut applicability); span_lint_and_then( cx, |
