X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_hir_typeck%2Fsrc%2Fcheck.rs;h=b9e90e47e508bdecbb522fc62d077893bfc8ff59;hb=a673364c543986789cfbb844c925063519fb872a;hp=3c57e33f6f7fb164e10213569cf5a32cd538343c;hpb=a00f8ba7fcac1b27341679c51bf5a3271fa82df3;p=rust.git diff --git a/compiler/rustc_hir_typeck/src/check.rs b/compiler/rustc_hir_typeck/src/check.rs index 3c57e33f6f7..b9e90e47e50 100644 --- a/compiler/rustc_hir_typeck/src/check.rs +++ b/compiler/rustc_hir_typeck/src/check.rs @@ -26,10 +26,12 @@ pub(super) fn check_fn<'a, 'tcx>( param_env: ty::ParamEnv<'tcx>, fn_sig: ty::FnSig<'tcx>, decl: &'tcx hir::FnDecl<'tcx>, - fn_id: hir::HirId, + fn_def_id: LocalDefId, body: &'tcx hir::Body<'tcx>, can_be_generator: Option, ) -> (FnCtxt<'a, 'tcx>, Option>) { + let fn_id = inherited.tcx.hir().local_def_id_to_hir_id(fn_def_id); + // Create the function context. This is either derived from scratch or, // in the case of closures, based on the outer context. let mut fcx = FnCtxt::new(inherited, param_env, body.value.hir_id); @@ -100,7 +102,7 @@ pub(super) fn check_fn<'a, 'tcx>( inherited.typeck_results.borrow_mut().liberated_fn_sigs_mut().insert(fn_id, fn_sig); - if let ty::Dynamic(..) = declared_ret_ty.kind() { + if let ty::Dynamic(_, _, ty::Dyn) = declared_ret_ty.kind() { // FIXME: We need to verify that the return type is `Sized` after the return expression has // been evaluated so that we have types available for all the nodes being returned, but that // requires the coerced evaluated type to be stored. Moving `check_return_expr` before this