Skip to content

Commit cefb7b0

Browse files
authored
Merge pull request #2670 from mikerite/fix_compilation_20180415
Fix compilation for nightly 2018-04-15
2 parents fc8e358 + d171e89 commit cefb7b0

File tree

8 files changed

+5
-33
lines changed

8 files changed

+5
-33
lines changed

clippy_lints/src/loops.rs

-1
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,6 @@ fn never_loop_expr(expr: &Expr, main_loop_id: &NodeId) -> NeverLoopResult {
602602
ExprCast(ref e, _) |
603603
ExprType(ref e, _) |
604604
ExprField(ref e, _) |
605-
ExprTupField(ref e, _) |
606605
ExprAddrOf(_, ref e) |
607606
ExprStruct(_, _, Some(ref e)) |
608607
ExprRepeat(ref e, _) => never_loop_expr(e, main_loop_id),

clippy_lints/src/no_effect.rs

-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ fn has_no_effect(cx: &LateContext, expr: &Expr) -> bool {
5656
Expr_::ExprType(ref inner, _) |
5757
Expr_::ExprUnary(_, ref inner) |
5858
Expr_::ExprField(ref inner, _) |
59-
Expr_::ExprTupField(ref inner, _) |
6059
Expr_::ExprAddrOf(_, ref inner) |
6160
Expr_::ExprBox(ref inner) => has_no_effect(cx, inner),
6261
Expr_::ExprStruct(_, ref fields, ref base) => {
@@ -143,7 +142,6 @@ fn reduce_expression<'a>(cx: &LateContext, expr: &'a Expr) -> Option<Vec<&'a Exp
143142
Expr_::ExprType(ref inner, _) |
144143
Expr_::ExprUnary(_, ref inner) |
145144
Expr_::ExprField(ref inner, _) |
146-
Expr_::ExprTupField(ref inner, _) |
147145
Expr_::ExprAddrOf(_, ref inner) |
148146
Expr_::ExprBox(ref inner) => reduce_expression(cx, inner).or_else(|| Some(vec![inner])),
149147
Expr_::ExprStruct(_, ref fields, ref base) => if has_drop(cx, expr) {

clippy_lints/src/shadow.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ fn check_expr<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr, bindings:
306306
return;
307307
}
308308
match expr.node {
309-
ExprUnary(_, ref e) | ExprField(ref e, _) | ExprTupField(ref e, _) | ExprAddrOf(_, ref e) | ExprBox(ref e) => {
309+
ExprUnary(_, ref e) | ExprField(ref e, _) | ExprAddrOf(_, ref e) | ExprBox(ref e) => {
310310
check_expr(cx, e, bindings)
311311
},
312312
ExprBlock(ref block) | ExprLoop(ref block, _, _) => check_block(cx, block, bindings),

clippy_lints/src/temporary_assignment.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
2-
use rustc::hir::{Expr, ExprAssign, ExprField, ExprStruct, ExprTup, ExprTupField};
2+
use rustc::hir::{Expr, ExprAssign, ExprField, ExprStruct, ExprTup};
33
use utils::is_adjusted;
44
use utils::span_lint;
55

@@ -40,11 +40,10 @@ impl LintPass for Pass {
4040
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
4141
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
4242
if let ExprAssign(ref target, _) = expr.node {
43-
match target.node {
44-
ExprField(ref base, _) | ExprTupField(ref base, _) => if is_temporary(base) && !is_adjusted(cx, base) {
43+
if let ExprField(ref base, _) = target.node {
44+
if is_temporary(base) && !is_adjusted(cx, base) {
4545
span_lint(cx, TEMPORARY_ASSIGNMENT, expr.span, "assignment to temporary");
46-
},
47-
_ => (),
46+
}
4847
}
4948
}
5049
}

clippy_lints/src/utils/author.rs

-8
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,6 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
371371
self.current = obj_pat;
372372
self.visit_expr(object);
373373
},
374-
Expr_::ExprTupField(ref object, ref field_id) => {
375-
let obj_pat = self.next("object");
376-
let field_id_pat = self.next("field_id");
377-
println!("TupField(ref {}, ref {}) = {};", obj_pat, field_id_pat, current);
378-
println!(" if {}.node == {}", field_id_pat, field_id.node);
379-
self.current = obj_pat;
380-
self.visit_expr(object);
381-
},
382374
Expr_::ExprIndex(ref object, ref index) => {
383375
let object_pat = self.next("object");
384376
let index_pat = self.next("index");

clippy_lints/src/utils/hir_utils.rs

-8
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
131131
&& over(lf, rf, |l, r| self.eq_field(l, r))
132132
},
133133
(&ExprTup(ref l_tup), &ExprTup(ref r_tup)) => self.eq_exprs(l_tup, r_tup),
134-
(&ExprTupField(ref le, li), &ExprTupField(ref re, ri)) => li.node == ri.node && self.eq_expr(le, re),
135134
(&ExprUnary(l_op, ref le), &ExprUnary(r_op, ref re)) => l_op == r_op && self.eq_expr(le, re),
136135
(&ExprArray(ref l), &ExprArray(ref r)) => self.eq_exprs(l, r),
137136
(&ExprWhile(ref lc, ref lb, ref ll), &ExprWhile(ref rc, ref rb, ref rl)) => {
@@ -496,13 +495,6 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
496495
c.hash(&mut self.s);
497496
self.hash_exprs(tup);
498497
},
499-
ExprTupField(ref le, li) => {
500-
let c: fn(_, _) -> _ = ExprTupField;
501-
c.hash(&mut self.s);
502-
503-
self.hash_expr(le);
504-
li.node.hash(&mut self.s);
505-
},
506498
ExprType(ref e, ref _ty) => {
507499
let c: fn(_, _) -> _ = ExprType;
508500
c.hash(&mut self.s);

clippy_lints/src/utils/inspector.rs

-6
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,6 @@ fn print_expr(cx: &LateContext, expr: &hir::Expr, indent: usize) {
274274
println!("{}struct expr:", ind);
275275
print_expr(cx, e, indent + 1);
276276
},
277-
hir::ExprTupField(ref e, ref idx) => {
278-
println!("{}TupField", ind);
279-
println!("{}field index: {}", ind, idx.node);
280-
println!("{}tuple expr:", ind);
281-
print_expr(cx, e, indent + 1);
282-
},
283277
hir::ExprIndex(ref arr, ref idx) => {
284278
println!("{}Index", ind);
285279
println!("{}array expr:", ind);

clippy_lints/src/utils/sugg.rs

-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ impl<'a> Sugg<'a> {
6969
hir::ExprRet(..) |
7070
hir::ExprStruct(..) |
7171
hir::ExprTup(..) |
72-
hir::ExprTupField(..) |
7372
hir::ExprWhile(..) => Sugg::NonParen(snippet),
7473
hir::ExprAssign(..) => Sugg::BinOp(AssocOp::Assign, snippet),
7574
hir::ExprAssignOp(op, ..) => Sugg::BinOp(hirbinop2assignop(op), snippet),
@@ -121,7 +120,6 @@ impl<'a> Sugg<'a> {
121120
ast::ExprKind::Struct(..) |
122121
ast::ExprKind::Try(..) |
123122
ast::ExprKind::Tup(..) |
124-
ast::ExprKind::TupField(..) |
125123
ast::ExprKind::Array(..) |
126124
ast::ExprKind::While(..) |
127125
ast::ExprKind::WhileLet(..) => Sugg::NonParen(snippet),

0 commit comments

Comments
 (0)