From a36707bffd41d5197cf7b081c7594b5663106586 Mon Sep 17 00:00:00 2001 From: Florian Hartwig Date: Thu, 19 Nov 2015 20:19:19 +0100 Subject: [PATCH] Appease clippy by not shadowing variables --- src/methods.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/methods.rs b/src/methods.rs index 858a5a3dc..b8c640254 100644 --- a/src/methods.rs +++ b/src/methods.rs @@ -154,14 +154,14 @@ fn get_error_type<'a>(cx: &LateContext, ty: ty::Ty<'a>) -> Option> { // conservative, i.e. it should not return false positives, but will return // false negatives. fn has_debug_impl<'a, 'b>(ty: ty::Ty<'a>, cx: &LateContext<'b, 'a>) -> bool { - let ty = walk_ptrs_ty(ty); + let no_ref_ty = walk_ptrs_ty(ty); let debug = match cx.tcx.lang_items.debug_trait() { Some(debug) => debug, None => return false }; let debug_def = cx.tcx.lookup_trait_def(debug); let mut debug_impl_exists = false; - debug_def.for_each_relevant_impl(cx.tcx, ty, |d| { + debug_def.for_each_relevant_impl(cx.tcx, no_ref_ty, |d| { let self_ty = &cx.tcx.impl_trait_ref(d).and_then(|im| im.substs.self_ty()); if let Some(self_ty) = *self_ty { if !self_ty.flags.get().contains(ty::TypeFlags::HAS_PARAMS) {