mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 22:48:48 +00:00
Remove unused is_local from borrowed_box
This commit is contained in:
parent
53d3ffe539
commit
2afa7df564
2 changed files with 3 additions and 10 deletions
|
@ -9,13 +9,7 @@ use if_chain::if_chain;
|
|||
|
||||
use crate::utils::{match_path, paths, snippet, span_lint_and_sugg};
|
||||
|
||||
pub(super) fn check(
|
||||
cx: &LateContext<'_>,
|
||||
hir_ty: &hir::Ty<'_>,
|
||||
is_local: bool,
|
||||
lt: &Lifetime,
|
||||
mut_ty: &MutTy<'_>,
|
||||
) -> bool {
|
||||
pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, lt: &Lifetime, mut_ty: &MutTy<'_>) -> bool {
|
||||
match mut_ty.ty.kind {
|
||||
TyKind::Path(ref qpath) => {
|
||||
let hir_id = mut_ty.ty.hir_id;
|
||||
|
|
|
@ -312,8 +312,7 @@ impl Types {
|
|||
/// Recursively check for `TypePass` lints in the given type. Stop at the first
|
||||
/// lint found.
|
||||
///
|
||||
/// The parameter `is_local` distinguishes the context of the type; types from
|
||||
/// local bindings should only be checked for the `BORROWED_BOX` lint.
|
||||
/// The parameter `is_local` distinguishes the context of the type.
|
||||
fn check_ty(&mut self, cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, is_local: bool) {
|
||||
if hir_ty.span.from_expansion() {
|
||||
return;
|
||||
|
@ -378,7 +377,7 @@ impl Types {
|
|||
}
|
||||
},
|
||||
TyKind::Rptr(ref lt, ref mut_ty) => {
|
||||
if !borrowed_box::check(cx, hir_ty, is_local, lt, mut_ty) {
|
||||
if !borrowed_box::check(cx, hir_ty, lt, mut_ty) {
|
||||
self.check_ty(cx, &mut_ty.ty, is_local);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue