Skip to content

Commit 4352c85

Browse files
committed
1 parent f7bdead commit 4352c85

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

clippy_lints/src/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ fn lint_for_missing_headers<'a, 'tcx>(
229229
if let Some(body_id) = body_id;
230230
if let Some(future) = cx.tcx.lang_items().future_trait();
231231
let def_id = cx.tcx.hir().body_owner_def_id(body_id);
232-
let mir = cx.tcx.optimized_mir(def_id);
232+
let mir = cx.tcx.optimized_mir(def_id.to_def_id());
233233
let ret_ty = mir.return_ty();
234234
if implements_trait(cx, ret_ty, future, &[]);
235235
if let ty::Opaque(_, subs) = ret_ty.kind;

clippy_lints/src/enum_clike.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnportableVariant {
4646
for var in def.variants {
4747
if let Some(anon_const) = &var.disr_expr {
4848
let def_id = cx.tcx.hir().body_owner_def_id(anon_const.body);
49-
let mut ty = cx.tcx.type_of(def_id);
49+
let mut ty = cx.tcx.type_of(def_id.to_def_id());
5050
let constant = cx
5151
.tcx
52-
.const_eval_poly(def_id)
52+
.const_eval_poly(def_id.to_def_id())
5353
.ok()
5454
.map(|val| rustc_middle::ty::Const::from_value(cx.tcx, val, ty));
5555
if let Some(Constant::Int(val)) = constant.and_then(miri_to_const) {

clippy_lints/src/implicit_return.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ImplicitReturn {
135135
let def_id = cx.tcx.hir().body_owner_def_id(body.id());
136136

137137
// Building MIR for `fn`s with unsatisfiable preds results in ICE.
138-
if fn_has_unsatisfiable_preds(cx, def_id) {
138+
if fn_has_unsatisfiable_preds(cx, def_id.to_def_id()) {
139139
return;
140140
}
141141

142-
let mir = cx.tcx.optimized_mir(def_id);
142+
let mir = cx.tcx.optimized_mir(def_id.to_def_id());
143143

144144
// checking return type through MIR, HIR is not able to determine inferred closure return types
145145
// make sure it's not a macro

clippy_lints/src/redundant_clone.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,15 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for RedundantClone {
8080
let def_id = cx.tcx.hir().body_owner_def_id(body.id());
8181

8282
// Building MIR for `fn`s with unsatisfiable preds results in ICE.
83-
if fn_has_unsatisfiable_preds(cx, def_id) {
83+
if fn_has_unsatisfiable_preds(cx, def_id.to_def_id()) {
8484
return;
8585
}
8686

87-
let mir = cx.tcx.optimized_mir(def_id);
87+
let mir = cx.tcx.optimized_mir(def_id.to_def_id());
8888
let mir_read_only = mir.unwrap_read_only();
8989

9090
let maybe_storage_live_result = MaybeStorageLive
91-
.into_engine(cx.tcx, mir, def_id)
91+
.into_engine(cx.tcx, mir, def_id.to_def_id())
9292
.iterate_to_fixpoint()
9393
.into_results_cursor(mir);
9494
let mut possible_borrower = {

0 commit comments

Comments
 (0)