Skip to content

Commit aac4c3f

Browse files
authored
Merge pull request #1367 from Manishearth/rustup
rustup to rustc 1.15.0-nightly (d5814b0 2016-11-23)
2 parents 11ca07c + 31e4824 commit aac4c3f

11 files changed

+34
-20
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4-
## 0.0.102 — date
4+
## 0.0.103 — 2016-11-25
5+
* Update to *rustc 1.15.0-nightly (d5814b03e 2016-11-23)*
6+
7+
## 0.0.102 — 2016-11-24
58
* Update to *rustc 1.15.0-nightly (3bf2be9ce 2016-11-22)*
69

710
## 0.0.101 — 2016-11-23

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.0.102"
3+
version = "0.0.103"
44
authors = [
55
"Manish Goregaokar <[email protected]>",
66
"Andre Bogus <[email protected]>",
@@ -25,7 +25,7 @@ test = false
2525

2626
[dependencies]
2727
# begin automatic update
28-
clippy_lints = { version = "0.0.102", path = "clippy_lints" }
28+
clippy_lints = { version = "0.0.103", path = "clippy_lints" }
2929
# end automatic update
3030

3131
[dev-dependencies]

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints"
33
# begin automatic update
4-
version = "0.0.102"
4+
version = "0.0.103"
55
# end automatic update
66
authors = [
77
"Manish Goregaokar <[email protected]>",

clippy_lints/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ fn is_relevant_expr(cx: &LateContext, expr: &Expr) -> bool {
191191
match expr.node {
192192
ExprBlock(ref block) => is_relevant_block(cx, block),
193193
ExprRet(Some(ref e)) => is_relevant_expr(cx, e),
194-
ExprRet(None) | ExprBreak(_) => false,
194+
ExprRet(None) | ExprBreak(_, None) => false,
195195
ExprCall(ref path_expr, _) => {
196196
if let ExprPath(..) = path_expr.node {
197197
let fun_id = resolve_node(cx, path_expr.id).expect("function should be resolved").def_id();

clippy_lints/src/eval_order_dependence.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for DivergenceVisitor<'a, 'tcx> {
124124
fn visit_expr(&mut self, e: &'v Expr) {
125125
match e.node {
126126
ExprAgain(_) |
127-
ExprBreak(_) |
127+
ExprBreak(_, _) |
128128
ExprRet(_) => self.report_diverging_sub_expr(e),
129129
ExprCall(ref func, _) => match self.0.tcx.tables().expr_ty(func).sty {
130130
ty::TyFnDef(_, _, fn_ty) |

clippy_lints/src/loops.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ impl LateLintPass for Pass {
315315
// check for `loop { if let {} else break }` that could be `while let`
316316
// (also matches an explicit "match" instead of "if let")
317317
// (even if the "match" or "if let" is used for declaration)
318-
if let ExprLoop(ref block, _) = expr.node {
318+
if let ExprLoop(ref block, _, LoopSource::Loop) = expr.node {
319319
// also check for empty `loop {}` statements
320320
if block.stmts.is_empty() && block.expr.is_none() {
321321
span_lint(cx,
@@ -911,7 +911,7 @@ fn extract_first_expr(block: &Block) -> Option<&Expr> {
911911
/// Return true if expr contains a single break expr (maybe within a block).
912912
fn is_break_expr(expr: &Expr) -> bool {
913913
match expr.node {
914-
ExprBreak(None) => true,
914+
ExprBreak(None, _) => true,
915915
ExprBlock(ref b) => {
916916
match extract_first_expr(b) {
917917
Some(subexpr) => is_break_expr(subexpr),

clippy_lints/src/shadow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ fn check_expr(cx: &LateContext, expr: &Expr, bindings: &mut Vec<(Name, Span)>) {
278278
ExprAddrOf(_, ref e) |
279279
ExprBox(ref e) => check_expr(cx, e, bindings),
280280
ExprBlock(ref block) |
281-
ExprLoop(ref block, _) => check_block(cx, block, bindings),
281+
ExprLoop(ref block, _, _) => check_block(cx, block, bindings),
282282
// ExprCall
283283
// ExprMethodCall
284284
ExprArray(ref v) | ExprTup(ref v) => {

clippy_lints/src/unused_label.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ impl LateLintPass for UnusedLabel {
6464
impl<'v> Visitor<'v> for UnusedLabelVisitor {
6565
fn visit_expr(&mut self, expr: &hir::Expr) {
6666
match expr.node {
67-
hir::ExprBreak(Some(label)) |
67+
hir::ExprBreak(Some(label), _) |
6868
hir::ExprAgain(Some(label)) => {
6969
self.labels.remove(&label.node.as_str());
7070
}
71-
hir::ExprLoop(_, Some(label)) |
71+
hir::ExprLoop(_, Some(label), _) |
7272
hir::ExprWhile(_, _, Some(label)) => {
7373
self.labels.insert(label.node.as_str(), expr.span);
7474
}

clippy_lints/src/utils/higher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub fn for_loop(expr: &hir::Expr) -> Option<(&hir::Pat, &hir::Expr, &hir::Expr)>
141141
let hir::ExprMatch(ref iterexpr, ref arms, _) = expr.node,
142142
let hir::ExprCall(_, ref iterargs) = iterexpr.node,
143143
iterargs.len() == 1 && arms.len() == 1 && arms[0].guard.is_none(),
144-
let hir::ExprLoop(ref block, _) = arms[0].body.node,
144+
let hir::ExprLoop(ref block, _, _) = arms[0].body.node,
145145
block.stmts.is_empty(),
146146
let Some(ref loopexpr) = block.expr,
147147
let hir::ExprMatch(_, ref innerarms, hir::MatchSource::ForLoopDesugar) = loopexpr.node,

clippy_lints/src/utils/hir.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
8181
l_op == r_op.node && self.eq_expr(ll, rl) && self.eq_expr(lr, rr)
8282
})
8383
}
84-
(&ExprBreak(li), &ExprBreak(ri)) => both(&li, &ri, |l, r| l.node.as_str() == r.node.as_str()),
84+
(&ExprBreak(li, ref le), &ExprBreak(ri, ref re)) =>
85+
both(&li, &ri, |l, r| l.node.as_str() == r.node.as_str())
86+
&& both(le, re, |l, r| self.eq_expr(l, r)),
8587
(&ExprBox(ref l), &ExprBox(ref r)) => self.eq_expr(l, r),
8688
(&ExprCall(ref l_fun, ref l_args), &ExprCall(ref r_fun, ref r_args)) => {
8789
!self.ignore_fn && self.eq_expr(l_fun, r_fun) && self.eq_exprs(l_args, r_args)
@@ -98,8 +100,8 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
98100
self.eq_expr(lc, rc) && self.eq_block(lt, rt) && both(le, re, |l, r| self.eq_expr(l, r))
99101
}
100102
(&ExprLit(ref l), &ExprLit(ref r)) => l.node == r.node,
101-
(&ExprLoop(ref lb, ref ll), &ExprLoop(ref rb, ref rl)) => {
102-
self.eq_block(lb, rb) && both(ll, rl, |l, r| l.node.as_str() == r.node.as_str())
103+
(&ExprLoop(ref lb, ref ll, ref lls), &ExprLoop(ref rb, ref rl, ref rls)) => {
104+
self.eq_block(lb, rb) && both(ll, rl, |l, r| l.node.as_str() == r.node.as_str()) && lls == rls
103105
}
104106
(&ExprMatch(ref le, ref la, ref ls), &ExprMatch(ref re, ref ra, ref rs)) => {
105107
ls == rs && self.eq_expr(le, re) &&
@@ -344,12 +346,15 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
344346
self.hash_expr(l);
345347
self.hash_expr(r);
346348
}
347-
ExprBreak(i) => {
348-
let c: fn(_) -> _ = ExprBreak;
349+
ExprBreak(i, ref j) => {
350+
let c: fn(_, _) -> _ = ExprBreak;
349351
c.hash(&mut self.s);
350352
if let Some(i) = i {
351353
self.hash_name(&i.node);
352354
}
355+
if let Some(ref j) = *j {
356+
self.hash_expr(&*j);
357+
}
353358
}
354359
ExprBox(ref e) => {
355360
let c: fn(_) -> _ = ExprBox;
@@ -404,13 +409,14 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
404409
c.hash(&mut self.s);
405410
l.hash(&mut self.s);
406411
}
407-
ExprLoop(ref b, ref i) => {
408-
let c: fn(_, _) -> _ = ExprLoop;
412+
ExprLoop(ref b, ref i, ref j) => {
413+
let c: fn(_, _, _) -> _ = ExprLoop;
409414
c.hash(&mut self.s);
410415
self.hash_block(b);
411416
if let Some(i) = *i {
412417
self.hash_name(&i.node);
413418
}
419+
j.hash(&mut self.s);
414420
}
415421
ExprMatch(ref e, ref arms, ref s) => {
416422
let c: fn(_, _, _) -> _ = ExprMatch;

clippy_lints/src/utils/inspector.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,12 @@ fn print_expr(cx: &LateContext, expr: &hir::Expr, indent: usize) {
285285
println!("mutability: {:?}", muta);
286286
print_expr(cx, e, indent + 1);
287287
},
288-
hir::ExprBreak(_) => println!("{}Break, {}", ind, ty),
288+
hir::ExprBreak(_, ref e) => {
289+
println!("{}Break, {}", ind, ty);
290+
if let Some(ref e) = *e {
291+
print_expr(cx, e, indent + 1);
292+
}
293+
},
289294
hir::ExprAgain(_) => println!("{}Again, {}", ind, ty),
290295
hir::ExprRet(ref e) => {
291296
println!("{}Ret, {}", ind, ty);

0 commit comments

Comments
 (0)