@@ -12,7 +12,7 @@ use rustc_errors::Applicability;
12
12
use rustc_hir:: def:: { DefKind , Res } ;
13
13
use rustc_hir:: def_id:: DefId ;
14
14
use rustc_hir:: { BorrowKind , Expr , ExprKind , ItemKind , LangItem , Node } ;
15
- use rustc_hir_typeck:: { FnCtxt , Inherited } ;
15
+ use rustc_hir_typeck:: { FnCtxt , TypeckRootCtxt } ;
16
16
use rustc_infer:: infer:: TyCtxtInferExt ;
17
17
use rustc_lint:: LateContext ;
18
18
use rustc_middle:: mir:: Mutability ;
@@ -438,8 +438,8 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<
438
438
Node :: Item ( item) => {
439
439
if let ItemKind :: Fn ( _, _, body_id) = & item. kind
440
440
&& let output_ty = return_ty ( cx, item. owner_id )
441
- && let inherited = Inherited :: new ( cx. tcx , item. owner_id . def_id )
442
- && let fn_ctxt = FnCtxt :: new ( & inherited , cx. param_env , item. owner_id . def_id )
441
+ && let root_ctxt = TypeckRootCtxt :: new ( cx. tcx , item. owner_id . def_id )
442
+ && let fn_ctxt = FnCtxt :: new ( & root_ctxt , cx. param_env , item. owner_id . def_id )
443
443
&& fn_ctxt. can_coerce ( ty, output_ty)
444
444
{
445
445
if has_lifetime ( output_ty) && has_lifetime ( ty) {
0 commit comments