@@ -12,7 +12,7 @@ use rustc_errors::Applicability;
1212use rustc_hir:: def:: { DefKind , Res } ;
1313use rustc_hir:: def_id:: DefId ;
1414use rustc_hir:: { BorrowKind , Expr , ExprKind , ItemKind , LangItem , Node } ;
15- use rustc_hir_typeck:: { FnCtxt , Inherited } ;
15+ use rustc_hir_typeck:: { FnCtxt , TypeckRootCtxt } ;
1616use rustc_infer:: infer:: TyCtxtInferExt ;
1717use rustc_lint:: LateContext ;
1818use rustc_middle:: mir:: Mutability ;
@@ -438,8 +438,8 @@ fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<
438438 Node :: Item ( item) => {
439439 if let ItemKind :: Fn ( _, _, body_id) = & item. kind
440440 && 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 )
443443 && fn_ctxt. can_coerce ( ty, output_ty)
444444 {
445445 if has_lifetime ( output_ty) && has_lifetime ( ty) {
0 commit comments