]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/transmute/utils.rs
Merge commit '4f142aa1058f14f153f8bfd2d82f04ddb9982388' into clippyup
[rust.git] / src / tools / clippy / clippy_lints / src / transmute / utils.rs
index b567d92230bb1cbe4085a444dbb6843b7b7a81bc..2f190e594a83197c57e62750423037927cd1b6f8 100644 (file)
@@ -1,8 +1,5 @@
 use rustc_hir::Expr;
-use rustc_hir_analysis::check::{
-    cast::{self, CastCheckResult},
-    FnCtxt, Inherited,
-};
+use rustc_hir_typeck::{cast, FnCtxt, Inherited};
 use rustc_lint::LateContext;
 use rustc_middle::ty::{cast::CastKind, Ty};
 use rustc_span::DUMMY_SP;
@@ -48,7 +45,7 @@ fn check_cast<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, from_ty: Ty<'tcx>
     let local_def_id = hir_id.owner.def_id;
 
     Inherited::build(cx.tcx, local_def_id).enter(|inherited| {
-        let fn_ctxt = FnCtxt::new(&inherited, cx.param_env, hir_id);
+        let fn_ctxt = FnCtxt::new(inherited, cx.param_env, hir_id);
 
         // If we already have errors, we can't be sure we can pointer cast.
         assert!(
@@ -56,7 +53,7 @@ fn check_cast<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, from_ty: Ty<'tcx>
             "Newly created FnCtxt contained errors"
         );
 
-        if let CastCheckResult::Deferred(check) = cast::check_cast(
+        if let Ok(check) = cast::CastCheck::new(
             &fn_ctxt, e, from_ty, to_ty,
             // We won't show any error to the user, so we don't care what the span is here.
             DUMMY_SP, DUMMY_SP,