mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
Stop passing empty args to check_expr_path
This commit is contained in:
parent
8f08625443
commit
e9957b922a
@ -222,7 +222,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
let ty = ensure_sufficient_stack(|| match &expr.kind {
|
let ty = ensure_sufficient_stack(|| match &expr.kind {
|
||||||
hir::ExprKind::Path(
|
hir::ExprKind::Path(
|
||||||
qpath @ (hir::QPath::Resolved(..) | hir::QPath::TypeRelative(..)),
|
qpath @ (hir::QPath::Resolved(..) | hir::QPath::TypeRelative(..)),
|
||||||
) => self.check_expr_path(qpath, expr, args, call),
|
) => self.check_expr_path(qpath, expr, Some(args), call),
|
||||||
_ => self.check_expr_kind(expr, expected),
|
_ => self.check_expr_kind(expr, expected),
|
||||||
});
|
});
|
||||||
let ty = self.resolve_vars_if_possible(ty);
|
let ty = self.resolve_vars_if_possible(ty);
|
||||||
@ -289,7 +289,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
ExprKind::Path(QPath::LangItem(lang_item, _)) => {
|
ExprKind::Path(QPath::LangItem(lang_item, _)) => {
|
||||||
self.check_lang_item_path(lang_item, expr)
|
self.check_lang_item_path(lang_item, expr)
|
||||||
}
|
}
|
||||||
ExprKind::Path(ref qpath) => self.check_expr_path(qpath, expr, &[], None),
|
ExprKind::Path(ref qpath) => self.check_expr_path(qpath, expr, None, None),
|
||||||
ExprKind::InlineAsm(asm) => {
|
ExprKind::InlineAsm(asm) => {
|
||||||
// We defer some asm checks as we may not have resolved the input and output types yet (they may still be infer vars).
|
// We defer some asm checks as we may not have resolved the input and output types yet (they may still be infer vars).
|
||||||
self.deferred_asm_checks.borrow_mut().push((asm, expr.hir_id));
|
self.deferred_asm_checks.borrow_mut().push((asm, expr.hir_id));
|
||||||
@ -501,7 +501,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
&self,
|
&self,
|
||||||
qpath: &'tcx hir::QPath<'tcx>,
|
qpath: &'tcx hir::QPath<'tcx>,
|
||||||
expr: &'tcx hir::Expr<'tcx>,
|
expr: &'tcx hir::Expr<'tcx>,
|
||||||
args: &'tcx [hir::Expr<'tcx>],
|
args: Option<&'tcx [hir::Expr<'tcx>]>,
|
||||||
call: Option<&'tcx hir::Expr<'tcx>>,
|
call: Option<&'tcx hir::Expr<'tcx>>,
|
||||||
) -> Ty<'tcx> {
|
) -> Ty<'tcx> {
|
||||||
let tcx = self.tcx;
|
let tcx = self.tcx;
|
||||||
@ -563,7 +563,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||||||
// We just want to check sizedness, so instead of introducing
|
// We just want to check sizedness, so instead of introducing
|
||||||
// placeholder lifetimes with probing, we just replace higher lifetimes
|
// placeholder lifetimes with probing, we just replace higher lifetimes
|
||||||
// with fresh vars.
|
// with fresh vars.
|
||||||
let span = args.get(i).map(|a| a.span).unwrap_or(expr.span);
|
let span = args.and_then(|args| args.get(i)).map_or(expr.span, |arg| arg.span);
|
||||||
let input = self.instantiate_binder_with_fresh_vars(
|
let input = self.instantiate_binder_with_fresh_vars(
|
||||||
span,
|
span,
|
||||||
infer::BoundRegionConversionTime::FnCall,
|
infer::BoundRegionConversionTime::FnCall,
|
||||||
|
Loading…
Reference in New Issue
Block a user