diff --git a/src/librustc/cfg/construct.rs b/src/librustc/cfg/construct.rs index 20e4b1343c1..f52d201abec 100644 --- a/src/librustc/cfg/construct.rs +++ b/src/librustc/cfg/construct.rs @@ -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]); diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs index ed86ef70564..5041bb9b935 100644 --- a/src/librustc/hir/intravisit.rs +++ b/src/librustc/hir/intravisit.rs @@ -1071,7 +1071,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 { diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 6291e0eb113..b2ab7f102af 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -3351,7 +3351,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(), diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index f6876113c11..a263925b37b 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -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>), /// A `continue`, with an optional label - ExprAgain(Destination), + ExprContinue(Destination), /// A `return`, with an optional value to be returned ExprRet(Option>), diff --git a/src/librustc/hir/print.rs b/src/librustc/hir/print.rs index 14f780fab7f..75773c027d8 100644 --- a/src/librustc/hir/print.rs +++ b/src/librustc/hir/print.rs @@ -1476,7 +1476,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 { diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index 882194ae64e..5c7b235f385 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -616,7 +616,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), diff --git a/src/librustc/middle/expr_use_visitor.rs b/src/librustc/middle/expr_use_visitor.rs index 8ef45a966da..718445bd356 100644 --- a/src/librustc/middle/expr_use_visitor.rs +++ b/src/librustc/middle/expr_use_visitor.rs @@ -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, _, _) => { diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 82686bc737b..b98a4416d21 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -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(..) | diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index 597872ef45d..e3b59d25ab9 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -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)) } diff --git a/src/librustc_mir/hair/cx/expr.rs b/src/librustc_mir/hair/cx/expr.rs index f23e10ae5d2..9c6c35a340e 100644 --- a/src/librustc_mir/hair/cx/expr.rs +++ b/src/librustc_mir/hair/cx/expr.rs @@ -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), diff --git a/src/librustc_passes/loops.rs b/src/librustc_passes/loops.rs index 4719f00b4d2..c99f1e9da43 100644 --- a/src/librustc_passes/loops.rs +++ b/src/librustc_passes/loops.rs @@ -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 { diff --git a/src/librustc_passes/rvalue_promotion.rs b/src/librustc_passes/rvalue_promotion.rs index 51b2988023b..e9d03daa7ea 100644 --- a/src/librustc_passes/rvalue_promotion.rs +++ b/src/librustc_passes/rvalue_promotion.rs @@ -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 diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 366420cfcab..0031d687833 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -2331,7 +2331,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { hir::ExprRepeat(..) | hir::ExprArray(..) | hir::ExprBreak(..) | - hir::ExprAgain(..) | + hir::ExprContinue(..) | hir::ExprRet(..) | hir::ExprWhile(..) | hir::ExprLoop(..) | @@ -3847,7 +3847,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } } - hir::ExprAgain(_) => { tcx.types.never } + hir::ExprContinue(_) => { tcx.types.never } hir::ExprRet(ref expr_opt) => { if self.ret_coercion.is_none() { struct_span_err!(self.tcx.sess, expr.span, E0572,