From 4352c8555b536c72948b0228e09dab22ea83c547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 11 Apr 2020 10:01:23 +0200 Subject: [PATCH] rustup https://github.com/rust-lang/rust/pull/70986 --- clippy_lints/src/doc.rs | 2 +- clippy_lints/src/enum_clike.rs | 4 ++-- clippy_lints/src/implicit_return.rs | 4 ++-- clippy_lints/src/redundant_clone.rs | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/clippy_lints/src/doc.rs b/clippy_lints/src/doc.rs index e015b1b49c6..12c9ba8dcd2 100644 --- a/clippy_lints/src/doc.rs +++ b/clippy_lints/src/doc.rs @@ -229,7 +229,7 @@ fn lint_for_missing_headers<'a, 'tcx>( if let Some(body_id) = body_id; if let Some(future) = cx.tcx.lang_items().future_trait(); let def_id = cx.tcx.hir().body_owner_def_id(body_id); - let mir = cx.tcx.optimized_mir(def_id); + let mir = cx.tcx.optimized_mir(def_id.to_def_id()); let ret_ty = mir.return_ty(); if implements_trait(cx, ret_ty, future, &[]); if let ty::Opaque(_, subs) = ret_ty.kind; diff --git a/clippy_lints/src/enum_clike.rs b/clippy_lints/src/enum_clike.rs index ace11073a8f..a1fed3fb6e2 100644 --- a/clippy_lints/src/enum_clike.rs +++ b/clippy_lints/src/enum_clike.rs @@ -46,10 +46,10 @@ fn check_item(&mut self, cx: &LateContext<'a, 'tcx>, item: &'tcx Item<'_>) { for var in def.variants { if let Some(anon_const) = &var.disr_expr { let def_id = cx.tcx.hir().body_owner_def_id(anon_const.body); - let mut ty = cx.tcx.type_of(def_id); + let mut ty = cx.tcx.type_of(def_id.to_def_id()); let constant = cx .tcx - .const_eval_poly(def_id) + .const_eval_poly(def_id.to_def_id()) .ok() .map(|val| rustc_middle::ty::Const::from_value(cx.tcx, val, ty)); if let Some(Constant::Int(val)) = constant.and_then(miri_to_const) { diff --git a/clippy_lints/src/implicit_return.rs b/clippy_lints/src/implicit_return.rs index d968a928c33..8b87f4c896a 100644 --- a/clippy_lints/src/implicit_return.rs +++ b/clippy_lints/src/implicit_return.rs @@ -135,11 +135,11 @@ fn check_fn( let def_id = cx.tcx.hir().body_owner_def_id(body.id()); // Building MIR for `fn`s with unsatisfiable preds results in ICE. - if fn_has_unsatisfiable_preds(cx, def_id) { + if fn_has_unsatisfiable_preds(cx, def_id.to_def_id()) { return; } - let mir = cx.tcx.optimized_mir(def_id); + let mir = cx.tcx.optimized_mir(def_id.to_def_id()); // checking return type through MIR, HIR is not able to determine inferred closure return types // make sure it's not a macro diff --git a/clippy_lints/src/redundant_clone.rs b/clippy_lints/src/redundant_clone.rs index dc1ff86c0bd..c315b575ef5 100644 --- a/clippy_lints/src/redundant_clone.rs +++ b/clippy_lints/src/redundant_clone.rs @@ -80,15 +80,15 @@ fn check_fn( let def_id = cx.tcx.hir().body_owner_def_id(body.id()); // Building MIR for `fn`s with unsatisfiable preds results in ICE. - if fn_has_unsatisfiable_preds(cx, def_id) { + if fn_has_unsatisfiable_preds(cx, def_id.to_def_id()) { return; } - let mir = cx.tcx.optimized_mir(def_id); + let mir = cx.tcx.optimized_mir(def_id.to_def_id()); let mir_read_only = mir.unwrap_read_only(); let maybe_storage_live_result = MaybeStorageLive - .into_engine(cx.tcx, mir, def_id) + .into_engine(cx.tcx, mir, def_id.to_def_id()) .iterate_to_fixpoint() .into_results_cursor(mir); let mut possible_borrower = {