Rename ExprAgain to ExprContinue
This commit is contained in:
parent
cbc4c8380f
commit
7ba2952af6
@ -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]);
|
||||
|
@ -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 {
|
||||
|
@ -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(),
|
||||
|
@ -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>>),
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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),
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user