Skip to content

Commit 6a16b38

Browse files
csmoeoli-obk
authored andcommitted
ExprKind
1 parent 1d19e0c commit 6a16b38

File tree

50 files changed

+666
-667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+666
-667
lines changed

src/librustc/cfg/construct.rs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
179179

180180
fn expr(&mut self, expr: &hir::Expr, pred: CFGIndex) -> CFGIndex {
181181
match expr.node {
182-
hir::ExprBlock(ref blk, _) => {
182+
hir::ExprKind::Block(ref blk, _) => {
183183
let blk_exit = self.block(&blk, pred);
184184
self.add_ast_node(expr.hir_id.local_id, &[blk_exit])
185185
}
186186

187-
hir::ExprIf(ref cond, ref then, None) => {
187+
hir::ExprKind::If(ref cond, ref then, None) => {
188188
//
189189
// [pred]
190190
// |
@@ -204,7 +204,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
204204
self.add_ast_node(expr.hir_id.local_id, &[cond_exit, then_exit]) // 3,4
205205
}
206206

207-
hir::ExprIf(ref cond, ref then, Some(ref otherwise)) => {
207+
hir::ExprKind::If(ref cond, ref then, Some(ref otherwise)) => {
208208
//
209209
// [pred]
210210
// |
@@ -225,7 +225,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
225225
self.add_ast_node(expr.hir_id.local_id, &[then_exit, else_exit]) // 4, 5
226226
}
227227

228-
hir::ExprWhile(ref cond, ref body, _) => {
228+
hir::ExprKind::While(ref cond, ref body, _) => {
229229
//
230230
// [pred]
231231
// |
@@ -267,7 +267,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
267267
expr_exit
268268
}
269269

270-
hir::ExprLoop(ref body, _, _) => {
270+
hir::ExprKind::Loop(ref body, _, _) => {
271271
//
272272
// [pred]
273273
// |
@@ -295,11 +295,11 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
295295
expr_exit
296296
}
297297

298-
hir::ExprMatch(ref discr, ref arms, _) => {
298+
hir::ExprKind::Match(ref discr, ref arms, _) => {
299299
self.match_(expr.hir_id.local_id, &discr, &arms, pred)
300300
}
301301

302-
hir::ExprBinary(op, ref l, ref r) if op.node.is_lazy() => {
302+
hir::ExprKind::Binary(op, ref l, ref r) if op.node.is_lazy() => {
303303
//
304304
// [pred]
305305
// |
@@ -319,14 +319,14 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
319319
self.add_ast_node(expr.hir_id.local_id, &[l_exit, r_exit]) // 3,4
320320
}
321321

322-
hir::ExprRet(ref v) => {
322+
hir::ExprKind::Ret(ref v) => {
323323
let v_exit = self.opt_expr(v, pred);
324324
let b = self.add_ast_node(expr.hir_id.local_id, &[v_exit]);
325325
self.add_returning_edge(expr, b);
326326
self.add_unreachable_node()
327327
}
328328

329-
hir::ExprBreak(destination, ref opt_expr) => {
329+
hir::ExprKind::Break(destination, ref opt_expr) => {
330330
let v = self.opt_expr(opt_expr, pred);
331331
let (target_scope, break_dest) =
332332
self.find_scope_edge(expr, destination, ScopeCfKind::Break);
@@ -335,74 +335,74 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
335335
self.add_unreachable_node()
336336
}
337337

338-
hir::ExprContinue(destination) => {
338+
hir::ExprKind::Continue(destination) => {
339339
let (target_scope, cont_dest) =
340340
self.find_scope_edge(expr, destination, ScopeCfKind::Continue);
341341
let a = self.add_ast_node(expr.hir_id.local_id, &[pred]);
342342
self.add_exiting_edge(expr, a, target_scope, cont_dest);
343343
self.add_unreachable_node()
344344
}
345345

346-
hir::ExprArray(ref elems) => {
346+
hir::ExprKind::Array(ref elems) => {
347347
self.straightline(expr, pred, elems.iter().map(|e| &*e))
348348
}
349349

350-
hir::ExprCall(ref func, ref args) => {
350+
hir::ExprKind::Call(ref func, ref args) => {
351351
self.call(expr, pred, &func, args.iter().map(|e| &*e))
352352
}
353353

354-
hir::ExprMethodCall(.., ref args) => {
354+
hir::ExprKind::MethodCall(.., ref args) => {
355355
self.call(expr, pred, &args[0], args[1..].iter().map(|e| &*e))
356356
}
357357

358-
hir::ExprIndex(ref l, ref r) |
359-
hir::ExprBinary(_, ref l, ref r) if self.tables.is_method_call(expr) => {
358+
hir::ExprKind::Index(ref l, ref r) |
359+
hir::ExprKind::Binary(_, ref l, ref r) if self.tables.is_method_call(expr) => {
360360
self.call(expr, pred, &l, Some(&**r).into_iter())
361361
}
362362

363-
hir::ExprUnary(_, ref e) if self.tables.is_method_call(expr) => {
363+
hir::ExprKind::Unary(_, ref e) if self.tables.is_method_call(expr) => {
364364
self.call(expr, pred, &e, None::<hir::Expr>.iter())
365365
}
366366

367-
hir::ExprTup(ref exprs) => {
367+
hir::ExprKind::Tup(ref exprs) => {
368368
self.straightline(expr, pred, exprs.iter().map(|e| &*e))
369369
}
370370

371-
hir::ExprStruct(_, ref fields, ref base) => {
371+
hir::ExprKind::Struct(_, ref fields, ref base) => {
372372
let field_cfg = self.straightline(expr, pred, fields.iter().map(|f| &*f.expr));
373373
self.opt_expr(base, field_cfg)
374374
}
375375

376-
hir::ExprAssign(ref l, ref r) |
377-
hir::ExprAssignOp(_, ref l, ref r) => {
376+
hir::ExprKind::Assign(ref l, ref r) |
377+
hir::ExprKind::AssignOp(_, ref l, ref r) => {
378378
self.straightline(expr, pred, [r, l].iter().map(|&e| &**e))
379379
}
380380

381-
hir::ExprIndex(ref l, ref r) |
382-
hir::ExprBinary(_, ref l, ref r) => { // NB: && and || handled earlier
381+
hir::ExprKind::Index(ref l, ref r) |
382+
hir::ExprKind::Binary(_, ref l, ref r) => { // NB: && and || handled earlier
383383
self.straightline(expr, pred, [l, r].iter().map(|&e| &**e))
384384
}
385385

386-
hir::ExprBox(ref e) |
387-
hir::ExprAddrOf(_, ref e) |
388-
hir::ExprCast(ref e, _) |
389-
hir::ExprType(ref e, _) |
390-
hir::ExprUnary(_, ref e) |
391-
hir::ExprField(ref e, _) |
392-
hir::ExprYield(ref e) |
393-
hir::ExprRepeat(ref e, _) => {
386+
hir::ExprKind::Box(ref e) |
387+
hir::ExprKind::AddrOf(_, ref e) |
388+
hir::ExprKind::Cast(ref e, _) |
389+
hir::ExprKind::Type(ref e, _) |
390+
hir::ExprKind::Unary(_, ref e) |
391+
hir::ExprKind::Field(ref e, _) |
392+
hir::ExprKind::Yield(ref e) |
393+
hir::ExprKind::Repeat(ref e, _) => {
394394
self.straightline(expr, pred, Some(&**e).into_iter())
395395
}
396396

397-
hir::ExprInlineAsm(_, ref outputs, ref inputs) => {
397+
hir::ExprKind::InlineAsm(_, ref outputs, ref inputs) => {
398398
let post_outputs = self.exprs(outputs.iter().map(|e| &*e), pred);
399399
let post_inputs = self.exprs(inputs.iter().map(|e| &*e), post_outputs);
400400
self.add_ast_node(expr.hir_id.local_id, &[post_inputs])
401401
}
402402

403-
hir::ExprClosure(..) |
404-
hir::ExprLit(..) |
405-
hir::ExprPath(_) => {
403+
hir::ExprKind::Closure(..) |
404+
hir::ExprKind::Lit(..) |
405+
hir::ExprKind::Path(_) => {
406406
self.straightline(expr, pred, None::<hir::Expr>.iter())
407407
}
408408
}

src/librustc/hir/check_attr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
283283

284284
fn check_expr_attributes(&self, expr: &hir::Expr) {
285285
let target = match expr.node {
286-
hir::ExprClosure(..) => Target::Closure,
286+
hir::ExprKind::Closure(..) => Target::Closure,
287287
_ => Target::Expression,
288288
};
289289
for attr in expr.attrs.iter() {

src/librustc/hir/intravisit.rs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -963,17 +963,17 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
963963
visitor.visit_id(expression.id);
964964
walk_list!(visitor, visit_attribute, expression.attrs.iter());
965965
match expression.node {
966-
ExprBox(ref subexpression) => {
966+
ExprKind::Box(ref subexpression) => {
967967
visitor.visit_expr(subexpression)
968968
}
969-
ExprArray(ref subexpressions) => {
969+
ExprKind::Array(ref subexpressions) => {
970970
walk_list!(visitor, visit_expr, subexpressions);
971971
}
972-
ExprRepeat(ref element, ref count) => {
972+
ExprKind::Repeat(ref element, ref count) => {
973973
visitor.visit_expr(element);
974974
visitor.visit_anon_const(count)
975975
}
976-
ExprStruct(ref qpath, ref fields, ref optional_base) => {
976+
ExprKind::Struct(ref qpath, ref fields, ref optional_base) => {
977977
visitor.visit_qpath(qpath, expression.id, expression.span);
978978
for field in fields {
979979
visitor.visit_id(field.id);
@@ -982,78 +982,78 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
982982
}
983983
walk_list!(visitor, visit_expr, optional_base);
984984
}
985-
ExprTup(ref subexpressions) => {
985+
ExprKind::Tup(ref subexpressions) => {
986986
walk_list!(visitor, visit_expr, subexpressions);
987987
}
988-
ExprCall(ref callee_expression, ref arguments) => {
988+
ExprKind::Call(ref callee_expression, ref arguments) => {
989989
visitor.visit_expr(callee_expression);
990990
walk_list!(visitor, visit_expr, arguments);
991991
}
992-
ExprMethodCall(ref segment, _, ref arguments) => {
992+
ExprKind::MethodCall(ref segment, _, ref arguments) => {
993993
visitor.visit_path_segment(expression.span, segment);
994994
walk_list!(visitor, visit_expr, arguments);
995995
}
996-
ExprBinary(_, ref left_expression, ref right_expression) => {
996+
ExprKind::Binary(_, ref left_expression, ref right_expression) => {
997997
visitor.visit_expr(left_expression);
998998
visitor.visit_expr(right_expression)
999999
}
1000-
ExprAddrOf(_, ref subexpression) | ExprUnary(_, ref subexpression) => {
1000+
ExprKind::AddrOf(_, ref subexpression) | ExprKind::Unary(_, ref subexpression) => {
10011001
visitor.visit_expr(subexpression)
10021002
}
1003-
ExprLit(_) => {}
1004-
ExprCast(ref subexpression, ref typ) | ExprType(ref subexpression, ref typ) => {
1003+
ExprKind::Lit(_) => {}
1004+
ExprKind::Cast(ref subexpression, ref typ) | ExprKind::Type(ref subexpression, ref typ) => {
10051005
visitor.visit_expr(subexpression);
10061006
visitor.visit_ty(typ)
10071007
}
1008-
ExprIf(ref head_expression, ref if_block, ref optional_else) => {
1008+
ExprKind::If(ref head_expression, ref if_block, ref optional_else) => {
10091009
visitor.visit_expr(head_expression);
10101010
visitor.visit_expr(if_block);
10111011
walk_list!(visitor, visit_expr, optional_else);
10121012
}
1013-
ExprWhile(ref subexpression, ref block, ref opt_label) => {
1013+
ExprKind::While(ref subexpression, ref block, ref opt_label) => {
10141014
walk_list!(visitor, visit_label, opt_label);
10151015
visitor.visit_expr(subexpression);
10161016
visitor.visit_block(block);
10171017
}
1018-
ExprLoop(ref block, ref opt_label, _) => {
1018+
ExprKind::Loop(ref block, ref opt_label, _) => {
10191019
walk_list!(visitor, visit_label, opt_label);
10201020
visitor.visit_block(block);
10211021
}
1022-
ExprMatch(ref subexpression, ref arms, _) => {
1022+
ExprKind::Match(ref subexpression, ref arms, _) => {
10231023
visitor.visit_expr(subexpression);
10241024
walk_list!(visitor, visit_arm, arms);
10251025
}
1026-
ExprClosure(_, ref function_declaration, body, _fn_decl_span, _gen) => {
1026+
ExprKind::Closure(_, ref function_declaration, body, _fn_decl_span, _gen) => {
10271027
visitor.visit_fn(FnKind::Closure(&expression.attrs),
10281028
function_declaration,
10291029
body,
10301030
expression.span,
10311031
expression.id)
10321032
}
1033-
ExprBlock(ref block, ref opt_label) => {
1033+
ExprKind::Block(ref block, ref opt_label) => {
10341034
walk_list!(visitor, visit_label, opt_label);
10351035
visitor.visit_block(block);
10361036
}
1037-
ExprAssign(ref left_hand_expression, ref right_hand_expression) => {
1037+
ExprKind::Assign(ref left_hand_expression, ref right_hand_expression) => {
10381038
visitor.visit_expr(right_hand_expression);
10391039
visitor.visit_expr(left_hand_expression)
10401040
}
1041-
ExprAssignOp(_, ref left_expression, ref right_expression) => {
1041+
ExprKind::AssignOp(_, ref left_expression, ref right_expression) => {
10421042
visitor.visit_expr(right_expression);
10431043
visitor.visit_expr(left_expression)
10441044
}
1045-
ExprField(ref subexpression, ident) => {
1045+
ExprKind::Field(ref subexpression, ident) => {
10461046
visitor.visit_expr(subexpression);
10471047
visitor.visit_ident(ident);
10481048
}
1049-
ExprIndex(ref main_expression, ref index_expression) => {
1049+
ExprKind::Index(ref main_expression, ref index_expression) => {
10501050
visitor.visit_expr(main_expression);
10511051
visitor.visit_expr(index_expression)
10521052
}
1053-
ExprPath(ref qpath) => {
1053+
ExprKind::Path(ref qpath) => {
10541054
visitor.visit_qpath(qpath, expression.id, expression.span);
10551055
}
1056-
ExprBreak(ref destination, ref opt_expr) => {
1056+
ExprKind::Break(ref destination, ref opt_expr) => {
10571057
if let Some(ref label) = destination.label {
10581058
visitor.visit_label(label);
10591059
match destination.target_id {
@@ -1063,7 +1063,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
10631063
}
10641064
walk_list!(visitor, visit_expr, opt_expr);
10651065
}
1066-
ExprContinue(ref destination) => {
1066+
ExprKind::Continue(ref destination) => {
10671067
if let Some(ref label) = destination.label {
10681068
visitor.visit_label(label);
10691069
match destination.target_id {
@@ -1072,18 +1072,18 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
10721072
};
10731073
}
10741074
}
1075-
ExprRet(ref optional_expression) => {
1075+
ExprKind::Ret(ref optional_expression) => {
10761076
walk_list!(visitor, visit_expr, optional_expression);
10771077
}
1078-
ExprInlineAsm(_, ref outputs, ref inputs) => {
1078+
ExprKind::InlineAsm(_, ref outputs, ref inputs) => {
10791079
for output in outputs {
10801080
visitor.visit_expr(output)
10811081
}
10821082
for input in inputs {
10831083
visitor.visit_expr(input)
10841084
}
10851085
}
1086-
ExprYield(ref subexpression) => {
1086+
ExprKind::Yield(ref subexpression) => {
10871087
visitor.visit_expr(subexpression);
10881088
}
10891089
}

0 commit comments

Comments
 (0)