Skip to content

Commit ab93133

Browse files
committed
address some review comments
1 parent 7a818c0 commit ab93133

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/tools/clippy/clippy_lints/src/transmute.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,15 +718,12 @@ fn check_cast<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, from_ty: Ty<'tcx>
718718
Inherited::build(cx.tcx, local_def_id).enter(|inherited| {
719719
let fn_ctxt = FnCtxt::new(
720720
&inherited,
721-
// TODO should we try to get the correct ParamEnv?
722-
ty::ParamEnv::empty(),
721+
cx.param_env,
723722
hir_id
724723
);
725724

726725
// If we already have errors, we can't be sure we can pointer cast.
727-
if fn_ctxt.errors_reported_since_creation() {
728-
return None;
729-
}
726+
assert!(!fn_ctxt.errors_reported_since_creation());
730727

731728
if let Ok(check) = CastCheck::new(
732729
&fn_ctxt,
@@ -746,4 +743,4 @@ fn check_cast<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, from_ty: Ty<'tcx>
746743
None
747744
}
748745
})
749-
}
746+
}

0 commit comments

Comments
 (0)