Auto merge of #51727 - varkor:expragain-to-exprcontinue, r=petrochenkov
Rename hir::ExprAgain to hir::ExprContinue The current name is confusing and historical. I also used this PR to clean up the annoying indentation in `check/mod.rs`. If that's viewed as too tangential a change, I'll split it up, but it seemed reasonable to slip it in to reduce @bors's work. It's easy to compare for the two commits individually. r? @petrochenkov
This commit is contained in:
commit
4fe88c05cd
13 changed files with 552 additions and 552 deletions
|
|
@ -335,7 +335,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
|
|||
self.add_unreachable_node()
|
||||
}
|
||||
|
||||
hir::ExprAgain(destination) => {
|
||||
hir::ExprContinue(destination) => {
|
||||
let (target_scope, cont_dest) =
|
||||
self.find_scope_edge(expr, destination, ScopeCfKind::Continue);
|
||||
let a = self.add_ast_node(expr.hir_id.local_id, &[pred]);
|
||||
|
|
|
|||
|
|
@ -1068,7 +1068,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
|
|||
}
|
||||
walk_list!(visitor, visit_expr, opt_expr);
|
||||
}
|
||||
ExprAgain(ref destination) => {
|
||||
ExprContinue(ref destination) => {
|
||||
if let Some(ref label) = destination.label {
|
||||
visitor.visit_label(label);
|
||||
match destination.target_id {
|
||||
|
|
|
|||
|
|
@ -3731,7 +3731,7 @@ impl<'a> LoweringContext<'a> {
|
|||
)
|
||||
}
|
||||
ExprKind::Continue(opt_label) => {
|
||||
hir::ExprAgain(if self.is_in_loop_condition && opt_label.is_none() {
|
||||
hir::ExprContinue(if self.is_in_loop_condition && opt_label.is_none() {
|
||||
hir::Destination {
|
||||
label: None,
|
||||
target_id: Err(hir::LoopIdError::UnlabeledCfInWhileCondition).into(),
|
||||
|
|
|
|||
|
|
@ -1279,7 +1279,7 @@ impl Expr {
|
|||
ExprPath(..) => ExprPrecedence::Path,
|
||||
ExprAddrOf(..) => ExprPrecedence::AddrOf,
|
||||
ExprBreak(..) => ExprPrecedence::Break,
|
||||
ExprAgain(..) => ExprPrecedence::Continue,
|
||||
ExprContinue(..) => ExprPrecedence::Continue,
|
||||
ExprRet(..) => ExprPrecedence::Ret,
|
||||
ExprInlineAsm(..) => ExprPrecedence::InlineAsm,
|
||||
ExprStruct(..) => ExprPrecedence::Struct,
|
||||
|
|
@ -1374,7 +1374,7 @@ pub enum Expr_ {
|
|||
/// A `break`, with an optional label to break
|
||||
ExprBreak(Destination, Option<P<Expr>>),
|
||||
/// A `continue`, with an optional label
|
||||
ExprAgain(Destination),
|
||||
ExprContinue(Destination),
|
||||
/// A `return`, with an optional value to be returned
|
||||
ExprRet(Option<P<Expr>>),
|
||||
|
||||
|
|
|
|||
|
|
@ -1475,7 +1475,7 @@ impl<'a> State<'a> {
|
|||
self.s.space()?;
|
||||
}
|
||||
}
|
||||
hir::ExprAgain(destination) => {
|
||||
hir::ExprContinue(destination) => {
|
||||
self.s.word("continue")?;
|
||||
self.s.space()?;
|
||||
if let Some(label) = destination.label {
|
||||
|
|
|
|||
|
|
@ -621,7 +621,7 @@ impl_stable_hash_for!(enum hir::Expr_ {
|
|||
ExprPath(path),
|
||||
ExprAddrOf(mutability, sub),
|
||||
ExprBreak(destination, sub),
|
||||
ExprAgain(destination),
|
||||
ExprContinue(destination),
|
||||
ExprRet(val),
|
||||
ExprInlineAsm(asm, inputs, outputs),
|
||||
ExprStruct(path, fields, base),
|
||||
|
|
|
|||
|
|
@ -479,7 +479,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
|
|||
self.consume_exprs(inputs);
|
||||
}
|
||||
|
||||
hir::ExprAgain(..) |
|
||||
hir::ExprContinue(..) |
|
||||
hir::ExprLit(..) => {}
|
||||
|
||||
hir::ExprLoop(ref blk, _, _) => {
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ fn visit_expr<'a, 'tcx>(ir: &mut IrMaps<'a, 'tcx>, expr: &'tcx Expr) {
|
|||
hir::ExprArray(..) | hir::ExprCall(..) | hir::ExprMethodCall(..) |
|
||||
hir::ExprTup(..) | hir::ExprBinary(..) | hir::ExprAddrOf(..) |
|
||||
hir::ExprCast(..) | hir::ExprUnary(..) | hir::ExprBreak(..) |
|
||||
hir::ExprAgain(_) | hir::ExprLit(_) | hir::ExprRet(..) |
|
||||
hir::ExprContinue(_) | hir::ExprLit(_) | hir::ExprRet(..) |
|
||||
hir::ExprBlock(..) | hir::ExprAssign(..) | hir::ExprAssignOp(..) |
|
||||
hir::ExprStruct(..) | hir::ExprRepeat(..) |
|
||||
hir::ExprInlineAsm(..) | hir::ExprBox(..) | hir::ExprYield(..) |
|
||||
|
|
@ -1047,7 +1047,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
hir::ExprAgain(label) => {
|
||||
hir::ExprContinue(label) => {
|
||||
// Find which label this expr continues to
|
||||
let sc = match label.target_id {
|
||||
Ok(node_id) => node_id,
|
||||
|
|
@ -1431,7 +1431,7 @@ fn check_expr<'a, 'tcx>(this: &mut Liveness<'a, 'tcx>, expr: &'tcx Expr) {
|
|||
hir::ExprIndex(..) | hir::ExprField(..) |
|
||||
hir::ExprArray(..) | hir::ExprTup(..) | hir::ExprBinary(..) |
|
||||
hir::ExprCast(..) | hir::ExprUnary(..) | hir::ExprRet(..) |
|
||||
hir::ExprBreak(..) | hir::ExprAgain(..) | hir::ExprLit(_) |
|
||||
hir::ExprBreak(..) | hir::ExprContinue(..) | hir::ExprLit(_) |
|
||||
hir::ExprBlock(..) | hir::ExprAddrOf(..) |
|
||||
hir::ExprStruct(..) | hir::ExprRepeat(..) |
|
||||
hir::ExprClosure(..) | hir::ExprPath(_) | hir::ExprYield(..) |
|
||||
|
|
|
|||
|
|
@ -686,7 +686,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
|
|||
hir::ExprBinary(..) | hir::ExprWhile(..) |
|
||||
hir::ExprBlock(..) | hir::ExprLoop(..) | hir::ExprMatch(..) |
|
||||
hir::ExprLit(..) | hir::ExprBreak(..) |
|
||||
hir::ExprAgain(..) | hir::ExprStruct(..) | hir::ExprRepeat(..) |
|
||||
hir::ExprContinue(..) | hir::ExprStruct(..) | hir::ExprRepeat(..) |
|
||||
hir::ExprInlineAsm(..) | hir::ExprBox(..) => {
|
||||
Ok(self.cat_rvalue_node(expr.id(), expr.span(), expr_ty))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ fn make_mirror_unadjusted<'a, 'gcx, 'tcx>(cx: &mut Cx<'a, 'gcx, 'tcx>,
|
|||
Err(err) => bug!("invalid loop id for break: {}", err)
|
||||
}
|
||||
}
|
||||
hir::ExprAgain(dest) => {
|
||||
hir::ExprContinue(dest) => {
|
||||
match dest.target_id {
|
||||
Ok(loop_id) => ExprKind::Continue {
|
||||
label: region::Scope::Node(cx.tcx.hir.node_to_hir_id(loop_id).local_id),
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ impl<'a, 'hir> Visitor<'hir> for CheckLoopVisitor<'a, 'hir> {
|
|||
|
||||
self.require_break_cx("break", e.span);
|
||||
}
|
||||
hir::ExprAgain(label) => {
|
||||
hir::ExprContinue(label) => {
|
||||
self.require_label_in_labeled_block(e.span, &label, "continue");
|
||||
|
||||
match label.target_id {
|
||||
|
|
|
|||
|
|
@ -469,7 +469,7 @@ fn check_expr<'a, 'tcx>(v: &mut CheckCrateVisitor<'a, 'tcx>, e: &hir::Expr, node
|
|||
|
||||
// More control flow (also not very meaningful).
|
||||
hir::ExprBreak(..) |
|
||||
hir::ExprAgain(_) |
|
||||
hir::ExprContinue(_) |
|
||||
hir::ExprRet(_) |
|
||||
|
||||
// Generator expressions
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue