@@ -222,7 +222,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
222
222
let ty = ensure_sufficient_stack ( || match & expr. kind {
223
223
hir:: ExprKind :: Path (
224
224
qpath @ ( hir:: QPath :: Resolved ( ..) | hir:: QPath :: TypeRelative ( ..) ) ,
225
- ) => self . check_expr_path ( qpath, expr, args, call) ,
225
+ ) => self . check_expr_path ( qpath, expr, Some ( args) , call) ,
226
226
_ => self . check_expr_kind ( expr, expected) ,
227
227
} ) ;
228
228
let ty = self . resolve_vars_if_possible ( ty) ;
@@ -289,7 +289,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
289
289
ExprKind :: Path ( QPath :: LangItem ( lang_item, _) ) => {
290
290
self . check_lang_item_path ( lang_item, expr)
291
291
}
292
- ExprKind :: Path ( ref qpath) => self . check_expr_path ( qpath, expr, & [ ] , None ) ,
292
+ ExprKind :: Path ( ref qpath) => self . check_expr_path ( qpath, expr, None , None ) ,
293
293
ExprKind :: InlineAsm ( asm) => {
294
294
// We defer some asm checks as we may not have resolved the input and output types yet (they may still be infer vars).
295
295
self . deferred_asm_checks . borrow_mut ( ) . push ( ( asm, expr. hir_id ) ) ;
@@ -501,7 +501,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
501
501
& self ,
502
502
qpath : & ' tcx hir:: QPath < ' tcx > ,
503
503
expr : & ' tcx hir:: Expr < ' tcx > ,
504
- args : & ' tcx [ hir:: Expr < ' tcx > ] ,
504
+ args : Option < & ' tcx [ hir:: Expr < ' tcx > ] > ,
505
505
call : Option < & ' tcx hir:: Expr < ' tcx > > ,
506
506
) -> Ty < ' tcx > {
507
507
let tcx = self . tcx ;
@@ -563,7 +563,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
563
563
// We just want to check sizedness, so instead of introducing
564
564
// placeholder lifetimes with probing, we just replace higher lifetimes
565
565
// with fresh vars.
566
- let span = args. get ( i ) . map ( |a| a . span ) . unwrap_or ( expr. span ) ;
566
+ let span = args. and_then ( |args| args . get ( i ) ) . map_or ( expr. span , |arg| arg . span ) ;
567
567
let input = self . instantiate_binder_with_fresh_vars (
568
568
span,
569
569
infer:: BoundRegionConversionTime :: FnCall ,
0 commit comments