parent
ff02953a02
commit
e4cca21a10
2 changed files with 4 additions and 1 deletions
|
@ -280,7 +280,9 @@ fn rewrite_closure(capture: ast::CaptureClause,
|
||||||
// All closure bodies are blocks in the eyes of the AST, but we may not
|
// All closure bodies are blocks in the eyes of the AST, but we may not
|
||||||
// want to unwrap them when they only contain a single expression.
|
// want to unwrap them when they only contain a single expression.
|
||||||
let inner_expr = match expr.node {
|
let inner_expr = match expr.node {
|
||||||
ast::Expr_::ExprBlock(ref inner) if inner.stmts.is_empty() && inner.expr.is_some() => {
|
ast::Expr_::ExprBlock(ref inner) if inner.stmts.is_empty() && inner.expr.is_some() &&
|
||||||
|
inner.rules ==
|
||||||
|
ast::BlockCheckMode::DefaultBlock => {
|
||||||
inner.expr.as_ref().unwrap()
|
inner.expr.as_ref().unwrap()
|
||||||
}
|
}
|
||||||
_ => expr,
|
_ => expr,
|
||||||
|
|
|
@ -82,4 +82,5 @@ fn homura<T: Deref<Target = i32>>(_: T) {
|
||||||
fn main() {
|
fn main() {
|
||||||
let _ = function(move || 5);
|
let _ = function(move || 5);
|
||||||
let _ = move || 42;
|
let _ = move || 42;
|
||||||
|
let _ = || unsafe { abort() };
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue