Take into account ExprKind::Scope
when calculating span of temporary
This commit is contained in:
parent
5f38c839ad
commit
d6c737adb5
1 changed files with 6 additions and 6 deletions
|
@ -141,12 +141,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
||||||
if let ExprKind::Block { body } = &expr.kind {
|
if let ExprKind::Block { body } = &expr.kind {
|
||||||
if let Some(tail_expr) = &body.expr {
|
if let Some(tail_expr) = &body.expr {
|
||||||
let mut expr = &*tail_expr;
|
let mut expr = &*tail_expr;
|
||||||
while let ExprKind::Block { body: subblock } = &expr.kind {
|
while let ExprKind::Block {
|
||||||
if let Some(subtail_expr) = &subblock.expr {
|
body: Block { expr: Some(nested_expr), .. },
|
||||||
expr = subtail_expr
|
}
|
||||||
} else {
|
| ExprKind::Scope { value: nested_expr, .. } = &expr.kind
|
||||||
break;
|
{
|
||||||
}
|
expr = nested_expr;
|
||||||
}
|
}
|
||||||
this.block_context.push(BlockFrame::TailExpr {
|
this.block_context.push(BlockFrame::TailExpr {
|
||||||
tail_result_is_ignored: true,
|
tail_result_is_ignored: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue