1
Fork 0

Rename ret_ty to declared_ret_ty

This commit is contained in:
leonardo.yvens 2018-05-15 15:42:41 -03:00
parent 587566eda7
commit 0582d025e8

View file

@ -1036,9 +1036,9 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
let mut fcx = FnCtxt::new(inherited, param_env, body.value.id); let mut fcx = FnCtxt::new(inherited, param_env, body.value.id);
*fcx.ps.borrow_mut() = UnsafetyState::function(fn_sig.unsafety, fn_id); *fcx.ps.borrow_mut() = UnsafetyState::function(fn_sig.unsafety, fn_id);
let ret_ty = fn_sig.output(); let declared_ret_ty = fn_sig.output();
fcx.require_type_is_sized(ret_ty, decl.output.span(), traits::SizedReturnType); fcx.require_type_is_sized(declared_ret_ty, decl.output.span(), traits::SizedReturnType);
let revealed_ret_ty = fcx.instantiate_anon_types_from_return_value(fn_id, &ret_ty); let revealed_ret_ty = fcx.instantiate_anon_types_from_return_value(fn_id, &declared_ret_ty);
fcx.ret_coercion = Some(RefCell::new(CoerceMany::new(revealed_ret_ty))); fcx.ret_coercion = Some(RefCell::new(CoerceMany::new(revealed_ret_ty)));
fn_sig = fcx.tcx.mk_fn_sig( fn_sig = fcx.tcx.mk_fn_sig(
fn_sig.inputs().iter().cloned(), fn_sig.inputs().iter().cloned(),
@ -1132,7 +1132,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
if id == fn_id { if id == fn_id {
match entry_type { match entry_type {
config::EntryMain => { config::EntryMain => {
let substs = fcx.tcx.mk_substs(iter::once(Kind::from(ret_ty))); let substs = fcx.tcx.mk_substs(iter::once(Kind::from(declared_ret_ty)));
let trait_ref = ty::TraitRef::new(term_id, substs); let trait_ref = ty::TraitRef::new(term_id, substs);
let return_ty_span = decl.output.span(); let return_ty_span = decl.output.span();
let cause = traits::ObligationCause::new( let cause = traits::ObligationCause::new(