clippy: (Body, DefId) -> Body

This commit is contained in:
Dylan MacKenzie 2020-10-04 15:23:20 -07:00
parent 840f7daaad
commit 29d43f63bd
3 changed files with 4 additions and 3 deletions

View file

@ -118,7 +118,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingConstForFn {
let mir = cx.tcx.optimized_mir(def_id); let mir = cx.tcx.optimized_mir(def_id);
if let Err((span, err)) = is_min_const_fn(cx.tcx, def_id.to_def_id(), &mir) { if let Err((span, err)) = is_min_const_fn(cx.tcx, &mir) {
if rustc_mir::const_eval::is_min_const_fn(cx.tcx, def_id.to_def_id()) { if rustc_mir::const_eval::is_min_const_fn(cx.tcx, def_id.to_def_id()) {
cx.tcx.sess.span_err(span, &err); cx.tcx.sess.span_err(span, &err);
} }

View file

@ -86,7 +86,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantClone {
let mir = cx.tcx.optimized_mir(def_id.to_def_id()); let mir = cx.tcx.optimized_mir(def_id.to_def_id());
let maybe_storage_live_result = MaybeStorageLive let maybe_storage_live_result = MaybeStorageLive
.into_engine(cx.tcx, mir, def_id.to_def_id()) .into_engine(cx.tcx, mir)
.pass_name("redundant_clone") .pass_name("redundant_clone")
.iterate_to_fixpoint() .iterate_to_fixpoint()
.into_results_cursor(mir); .into_results_cursor(mir);

View file

@ -10,7 +10,8 @@ use std::borrow::Cow;
type McfResult = Result<(), (Span, Cow<'static, str>)>; type McfResult = Result<(), (Span, Cow<'static, str>)>;
pub fn is_min_const_fn(tcx: TyCtxt<'tcx>, def_id: DefId, body: &'a Body<'tcx>) -> McfResult { pub fn is_min_const_fn(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>) -> McfResult {
let def_id = body.source.def_id();
let mut current = def_id; let mut current = def_id;
loop { loop {
let predicates = tcx.predicates_of(current); let predicates = tcx.predicates_of(current);