Skip to content

Commit c05689b

Browse files
leoyvenspietroalbini
authored andcommitted
Rename ret_ty to declared_ret_ty
1 parent b485887 commit c05689b

File tree

1 file changed

+4
-4
lines changed
  • src/librustc_typeck/check

1 file changed

+4
-4
lines changed

src/librustc_typeck/check/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1036,9 +1036,9 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
10361036
let mut fcx = FnCtxt::new(inherited, param_env, body.value.id);
10371037
*fcx.ps.borrow_mut() = UnsafetyState::function(fn_sig.unsafety, fn_id);
10381038

1039-
let ret_ty = fn_sig.output();
1040-
fcx.require_type_is_sized(ret_ty, decl.output.span(), traits::SizedReturnType);
1041-
let revealed_ret_ty = fcx.instantiate_anon_types_from_return_value(fn_id, &ret_ty);
1039+
let declared_ret_ty = fn_sig.output();
1040+
fcx.require_type_is_sized(declared_ret_ty, decl.output.span(), traits::SizedReturnType);
1041+
let revealed_ret_ty = fcx.instantiate_anon_types_from_return_value(fn_id, &declared_ret_ty);
10421042
fcx.ret_coercion = Some(RefCell::new(CoerceMany::new(revealed_ret_ty)));
10431043
fn_sig = fcx.tcx.mk_fn_sig(
10441044
fn_sig.inputs().iter().cloned(),
@@ -1132,7 +1132,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
11321132
if id == fn_id {
11331133
match entry_type {
11341134
config::EntryMain => {
1135-
let substs = fcx.tcx.mk_substs(iter::once(Kind::from(ret_ty)));
1135+
let substs = fcx.tcx.mk_substs(iter::once(Kind::from(declared_ret_ty)));
11361136
let trait_ref = ty::TraitRef::new(term_id, substs);
11371137
let return_ty_span = decl.output.span();
11381138
let cause = traits::ObligationCause::new(

0 commit comments

Comments
 (0)