mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
Cleanup formatting
This commit is contained in:
parent
b8dc2a7c76
commit
298a1c056f
@ -978,7 +978,6 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
// std::intrinsics::move_val_init(raw_place, pop_unsafe!( EXPR ));
|
||||
// InPlace::finalize(place)
|
||||
// })
|
||||
return {
|
||||
let placer_expr = lower_expr(lctx, placer);
|
||||
let value_expr = lower_expr(lctx, value_expr);
|
||||
|
||||
@ -1067,13 +1066,12 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
hir::PushUnsafeBlock(hir::CompilerGenerated), None)
|
||||
};
|
||||
|
||||
signal_block_expr(lctx,
|
||||
return signal_block_expr(lctx,
|
||||
hir_vec![s1, s2, s3],
|
||||
expr,
|
||||
e.span,
|
||||
hir::PushUnstableBlock,
|
||||
e.attrs.clone())
|
||||
}
|
||||
e.attrs.clone());
|
||||
}
|
||||
|
||||
ExprKind::Vec(ref exprs) => {
|
||||
@ -1227,10 +1225,9 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
None)
|
||||
}
|
||||
|
||||
return {
|
||||
use syntax::ast::RangeLimits::*;
|
||||
|
||||
match (e1, e2, lims) {
|
||||
return match (e1, e2, lims) {
|
||||
(&None, &None, HalfOpen) =>
|
||||
make_struct(lctx, e, &["RangeFull"],
|
||||
&[]),
|
||||
@ -1257,8 +1254,7 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
|
||||
_ => panic!(lctx.diagnostic().span_fatal(e.span,
|
||||
"inclusive range with no end"))
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
ExprKind::Path(ref qself, ref path) => {
|
||||
let hir_qself = qself.as_ref().map(|&QSelf { ref ty, position }| {
|
||||
@ -1332,7 +1328,6 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
// _ => [<else_opt> | ()]
|
||||
// }
|
||||
|
||||
return {
|
||||
// `<pat> => <body>`
|
||||
let pat_arm = {
|
||||
let body = lower_block(lctx, body);
|
||||
@ -1398,15 +1393,14 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
|
||||
let sub_expr = lower_expr(lctx, sub_expr);
|
||||
// add attributes to the outer returned expr node
|
||||
expr(lctx,
|
||||
return expr(lctx,
|
||||
e.span,
|
||||
hir::ExprMatch(sub_expr,
|
||||
arms.into(),
|
||||
hir::MatchSource::IfLetDesugar {
|
||||
contains_else_clause: contains_else_clause,
|
||||
}),
|
||||
e.attrs.clone())
|
||||
}
|
||||
e.attrs.clone());
|
||||
}
|
||||
|
||||
// Desugar ExprWhileLet
|
||||
@ -1421,7 +1415,6 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
// }
|
||||
// }
|
||||
|
||||
return {
|
||||
// `<pat> => <body>`
|
||||
let pat_arm = {
|
||||
let body = lower_block(lctx, body);
|
||||
@ -1451,8 +1444,7 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
let loop_expr = hir::ExprLoop(loop_block,
|
||||
opt_ident.map(|ident| lower_ident(lctx, ident)));
|
||||
// add attributes to the outer returned expr node
|
||||
expr(lctx, e.span, loop_expr, e.attrs.clone())
|
||||
}
|
||||
return expr(lctx, e.span, loop_expr, e.attrs.clone());
|
||||
}
|
||||
|
||||
// Desugar ExprForLoop
|
||||
@ -1474,7 +1466,6 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
// result
|
||||
// }
|
||||
|
||||
return {
|
||||
// expand <head>
|
||||
let head = lower_expr(lctx, head);
|
||||
|
||||
@ -1572,8 +1563,7 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
let result = expr_ident(lctx, e.span, result_ident, None);
|
||||
let block = block_all(lctx, e.span, hir_vec![let_stmt], Some(result));
|
||||
// add the attributes to the outer returned expr node
|
||||
expr_block(lctx, block, e.attrs.clone())
|
||||
}
|
||||
return expr_block(lctx, block, e.attrs.clone());
|
||||
}
|
||||
|
||||
// Desugar ExprKind::Try
|
||||
@ -1590,7 +1580,6 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
// }
|
||||
// }
|
||||
|
||||
return {
|
||||
// expand <expr>
|
||||
let sub_expr = lower_expr(lctx, sub_expr);
|
||||
|
||||
@ -1629,9 +1618,8 @@ pub fn lower_expr(lctx: &LoweringContext, e: &Expr) -> P<hir::Expr> {
|
||||
arm(hir_vec![err_pat], ret_expr)
|
||||
};
|
||||
|
||||
expr_match(lctx, e.span, sub_expr, hir_vec![err_arm, ok_arm],
|
||||
hir::MatchSource::TryDesugar, None)
|
||||
}
|
||||
return expr_match(lctx, e.span, sub_expr, hir_vec![err_arm, ok_arm],
|
||||
hir::MatchSource::TryDesugar, None);
|
||||
}
|
||||
|
||||
ExprKind::Mac(_) => panic!("Shouldn't exist here"),
|
||||
|
Loading…
Reference in New Issue
Block a user