mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-19 03:03:21 +00:00
parent
ff02953a02
commit
e4cca21a10
@ -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
|
||||
// want to unwrap them when they only contain a single expression.
|
||||
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()
|
||||
}
|
||||
_ => expr,
|
||||
|
@ -82,4 +82,5 @@ fn homura<T: Deref<Target = i32>>(_: T) {
|
||||
fn main() {
|
||||
let _ = function(move || 5);
|
||||
let _ = move || 42;
|
||||
let _ = || unsafe { abort() };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user