1
Fork 0

separate the receiver from arguments in HIR

This commit is contained in:
Takayuki Maeda 2022-09-01 13:27:31 +09:00
parent 6e4a9ab650
commit 87c6da363f
27 changed files with 115 additions and 96 deletions

View file

@ -1039,9 +1039,12 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
self.propagate_through_expr(&f, succ)
}
hir::ExprKind::MethodCall(.., ref args, _) => {
hir::ExprKind::MethodCall(.., receiver, ref args, _) => {
let succ = self.check_is_ty_uninhabited(expr, succ);
self.propagate_through_exprs(args, succ)
std::iter::once(receiver)
.chain(args.iter())
.rev()
.fold(succ, |succ, expr| self.propagate_through_expr(expr, succ))
}
hir::ExprKind::Tup(ref exprs) => self.propagate_through_exprs(exprs, succ),