@@ -785,7 +785,7 @@ fn check_fn<'a, 'gcx, 'tcx>(inherited: &'a Inherited<'a, 'gcx, 'tcx>,
785
785
786
786
// Create the function context. This is either derived from scratch or,
787
787
// 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 ) ;
789
789
let ret_ty = fn_sig. output ( ) ;
790
790
* fcx. ps . borrow_mut ( ) = UnsafetyState :: function ( unsafety, unsafety_id) ;
791
791
@@ -1246,7 +1246,7 @@ fn check_const_with_type<'a, 'tcx>(ccx: &'a CrateCtxt<'a, 'tcx>,
1246
1246
expected_type : Ty < ' tcx > ,
1247
1247
id : ast:: NodeId ) {
1248
1248
ccx. inherited ( id) . enter ( |inh| {
1249
- let fcx = FnCtxt :: new ( & inh, expr. id ) ;
1249
+ let fcx = FnCtxt :: new ( & inh, None , expr. id ) ;
1250
1250
fcx. require_type_is_sized ( expected_type, expr. span , traits:: ConstSized ) ;
1251
1251
1252
1252
// Gather locals in statics (because of block expressions).
@@ -1531,14 +1531,15 @@ enum TupleArgumentsFlag {
1531
1531
1532
1532
impl < ' a , ' gcx , ' tcx > FnCtxt < ' a , ' gcx , ' tcx > {
1533
1533
pub fn new ( inh : & ' a Inherited < ' a , ' gcx , ' tcx > ,
1534
+ rty : Option < Ty < ' tcx > > ,
1534
1535
body_id : ast:: NodeId )
1535
1536
-> FnCtxt < ' a , ' gcx , ' tcx > {
1536
1537
FnCtxt {
1537
1538
ast_ty_to_ty_cache : RefCell :: new ( NodeMap ( ) ) ,
1538
1539
body_id : body_id,
1539
1540
writeback_errors : Cell :: new ( false ) ,
1540
1541
err_count_on_creation : inh. tcx . sess . err_count ( ) ,
1541
- ret_ty : None ,
1542
+ ret_ty : rty ,
1542
1543
ps : RefCell :: new ( UnsafetyState :: function ( hir:: Unsafety :: Normal ,
1543
1544
ast:: CRATE_NODE_ID ) ) ,
1544
1545
diverges : Cell :: new ( Diverges :: Maybe ) ,
0 commit comments