@@ -785,7 +785,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
785785
786786 // Create the function context. This is either derived from scratch or,
787787 // in the case of function expressions, based on the outer context.
788- let mut fcx = FnCtxt :: new ( inherited, body. id ) ;
788+ let mut fcx = FnCtxt :: new ( inherited, None , body. id ) ;
789789 let ret_ty = fn_sig. output ( ) ;
790790 * fcx. ps . borrow_mut ( ) = UnsafetyState :: function ( unsafety, unsafety_id) ;
791791
@@ -1246,7 +1246,7 @@ fn check_const_with_type<'a, 'tcx>(ccx: &'a CrateCtxt<'a, 'tcx>,
12461246 expected_type : Ty < ' tcx > ,
12471247 id : ast:: NodeId ) {
12481248 ccx. inherited ( id) . enter ( |inh| {
1249- let fcx = FnCtxt :: new ( & inh, expr. id ) ;
1249+ let fcx = FnCtxt :: new ( & inh, None , expr. id ) ;
12501250 fcx. require_type_is_sized ( expected_type, expr. span , traits:: ConstSized ) ;
12511251
12521252 // Gather locals in statics (because of block expressions).
@@ -1531,14 +1531,15 @@ enum TupleArgumentsFlag {
15311531
15321532impl < ' a , ' gcx , ' tcx > FnCtxt < ' a , ' gcx , ' tcx > {
15331533 pub fn new ( inh : & ' a Inherited < ' a , ' gcx , ' tcx > ,
1534+ rty : Option < Ty < ' tcx > > ,
15341535 body_id : ast:: NodeId )
15351536 -> FnCtxt < ' a , ' gcx , ' tcx > {
15361537 FnCtxt {
15371538 ast_ty_to_ty_cache : RefCell :: new ( NodeMap ( ) ) ,
15381539 body_id : body_id,
15391540 writeback_errors : Cell :: new ( false ) ,
15401541 err_count_on_creation : inh. tcx . sess . err_count ( ) ,
1541- ret_ty : None ,
1542+ ret_ty : rty ,
15421543 ps : RefCell :: new ( UnsafetyState :: function ( hir:: Unsafety :: Normal ,
15431544 ast:: CRATE_NODE_ID ) ) ,
15441545 diverges : Cell :: new ( Diverges :: Maybe ) ,
0 commit comments