X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_lint%2Fsrc%2Fpass_by_value.rs;h=392e13f2fa94165d802ac24c0913934dd5d43d1b;hb=e385ca25be4e6893228bcc7b9c6020e98a0742ad;hp=212b8aa1574df22b1347c8432301d1a2153ba3b1;hpb=be130b57d477069799158506d7e80145fdf71c73;p=rust.git diff --git a/compiler/rustc_lint/src/pass_by_value.rs b/compiler/rustc_lint/src/pass_by_value.rs index 212b8aa1574..392e13f2fa9 100644 --- a/compiler/rustc_lint/src/pass_by_value.rs +++ b/compiler/rustc_lint/src/pass_by_value.rs @@ -24,7 +24,7 @@ fn check_ty(&mut self, cx: &LateContext<'_>, ty: &'tcx hir::Ty<'tcx>) { match &ty.kind { TyKind::Ref(_, hir::MutTy { ty: inner_ty, mutbl: hir::Mutability::Not }) => { if let Some(impl_did) = cx.tcx.impl_of_method(ty.hir_id.owner.to_def_id()) { - if cx.tcx.bound_impl_trait_ref(impl_did).is_some() { + if cx.tcx.impl_trait_ref(impl_did).is_some() { return; } } @@ -32,7 +32,7 @@ fn check_ty(&mut self, cx: &LateContext<'_>, ty: &'tcx hir::Ty<'tcx>) { cx.emit_spanned_lint( PASS_BY_VALUE, ty.span, - PassByValueDiag { ty: t.clone(), suggestion: ty.span }, + PassByValueDiag { ty: t, suggestion: ty.span }, ); } }