rustup to rustc 1.15.0-nightly (d5814b03e
2016-11-23)
This commit is contained in:
parent
11ca07c8ad
commit
31e482403c
@ -1,7 +1,10 @@
|
||||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## 0.0.102 — date
|
||||
## 0.0.103 — 2016-11-25
|
||||
* Update to *rustc 1.15.0-nightly (d5814b03e 2016-11-23)*
|
||||
|
||||
## 0.0.102 — 2016-11-24
|
||||
* Update to *rustc 1.15.0-nightly (3bf2be9ce 2016-11-22)*
|
||||
|
||||
## 0.0.101 — 2016-11-23
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "clippy"
|
||||
version = "0.0.102"
|
||||
version = "0.0.103"
|
||||
authors = [
|
||||
"Manish Goregaokar <manishsmail@gmail.com>",
|
||||
"Andre Bogus <bogusandre@gmail.com>",
|
||||
@ -25,7 +25,7 @@ test = false
|
||||
|
||||
[dependencies]
|
||||
# begin automatic update
|
||||
clippy_lints = { version = "0.0.102", path = "clippy_lints" }
|
||||
clippy_lints = { version = "0.0.103", path = "clippy_lints" }
|
||||
# end automatic update
|
||||
|
||||
[dev-dependencies]
|
||||
|
@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "clippy_lints"
|
||||
# begin automatic update
|
||||
version = "0.0.102"
|
||||
version = "0.0.103"
|
||||
# end automatic update
|
||||
authors = [
|
||||
"Manish Goregaokar <manishsmail@gmail.com>",
|
||||
|
@ -191,7 +191,7 @@ fn is_relevant_expr(cx: &LateContext, expr: &Expr) -> bool {
|
||||
match expr.node {
|
||||
ExprBlock(ref block) => is_relevant_block(cx, block),
|
||||
ExprRet(Some(ref e)) => is_relevant_expr(cx, e),
|
||||
ExprRet(None) | ExprBreak(_) => false,
|
||||
ExprRet(None) | ExprBreak(_, None) => false,
|
||||
ExprCall(ref path_expr, _) => {
|
||||
if let ExprPath(..) = path_expr.node {
|
||||
let fun_id = resolve_node(cx, path_expr.id).expect("function should be resolved").def_id();
|
||||
|
@ -124,7 +124,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for DivergenceVisitor<'a, 'tcx> {
|
||||
fn visit_expr(&mut self, e: &'v Expr) {
|
||||
match e.node {
|
||||
ExprAgain(_) |
|
||||
ExprBreak(_) |
|
||||
ExprBreak(_, _) |
|
||||
ExprRet(_) => self.report_diverging_sub_expr(e),
|
||||
ExprCall(ref func, _) => match self.0.tcx.tables().expr_ty(func).sty {
|
||||
ty::TyFnDef(_, _, fn_ty) |
|
||||
|
@ -315,7 +315,7 @@ impl LateLintPass for Pass {
|
||||
// check for `loop { if let {} else break }` that could be `while let`
|
||||
// (also matches an explicit "match" instead of "if let")
|
||||
// (even if the "match" or "if let" is used for declaration)
|
||||
if let ExprLoop(ref block, _) = expr.node {
|
||||
if let ExprLoop(ref block, _, LoopSource::Loop) = expr.node {
|
||||
// also check for empty `loop {}` statements
|
||||
if block.stmts.is_empty() && block.expr.is_none() {
|
||||
span_lint(cx,
|
||||
@ -911,7 +911,7 @@ fn extract_first_expr(block: &Block) -> Option<&Expr> {
|
||||
/// Return true if expr contains a single break expr (maybe within a block).
|
||||
fn is_break_expr(expr: &Expr) -> bool {
|
||||
match expr.node {
|
||||
ExprBreak(None) => true,
|
||||
ExprBreak(None, _) => true,
|
||||
ExprBlock(ref b) => {
|
||||
match extract_first_expr(b) {
|
||||
Some(subexpr) => is_break_expr(subexpr),
|
||||
|
@ -278,7 +278,7 @@ fn check_expr(cx: &LateContext, expr: &Expr, bindings: &mut Vec<(Name, Span)>) {
|
||||
ExprAddrOf(_, ref e) |
|
||||
ExprBox(ref e) => check_expr(cx, e, bindings),
|
||||
ExprBlock(ref block) |
|
||||
ExprLoop(ref block, _) => check_block(cx, block, bindings),
|
||||
ExprLoop(ref block, _, _) => check_block(cx, block, bindings),
|
||||
// ExprCall
|
||||
// ExprMethodCall
|
||||
ExprArray(ref v) | ExprTup(ref v) => {
|
||||
|
@ -64,11 +64,11 @@ impl LateLintPass for UnusedLabel {
|
||||
impl<'v> Visitor<'v> for UnusedLabelVisitor {
|
||||
fn visit_expr(&mut self, expr: &hir::Expr) {
|
||||
match expr.node {
|
||||
hir::ExprBreak(Some(label)) |
|
||||
hir::ExprBreak(Some(label), _) |
|
||||
hir::ExprAgain(Some(label)) => {
|
||||
self.labels.remove(&label.node.as_str());
|
||||
}
|
||||
hir::ExprLoop(_, Some(label)) |
|
||||
hir::ExprLoop(_, Some(label), _) |
|
||||
hir::ExprWhile(_, _, Some(label)) => {
|
||||
self.labels.insert(label.node.as_str(), expr.span);
|
||||
}
|
||||
|
@ -141,7 +141,7 @@ pub fn for_loop(expr: &hir::Expr) -> Option<(&hir::Pat, &hir::Expr, &hir::Expr)>
|
||||
let hir::ExprMatch(ref iterexpr, ref arms, _) = expr.node,
|
||||
let hir::ExprCall(_, ref iterargs) = iterexpr.node,
|
||||
iterargs.len() == 1 && arms.len() == 1 && arms[0].guard.is_none(),
|
||||
let hir::ExprLoop(ref block, _) = arms[0].body.node,
|
||||
let hir::ExprLoop(ref block, _, _) = arms[0].body.node,
|
||||
block.stmts.is_empty(),
|
||||
let Some(ref loopexpr) = block.expr,
|
||||
let hir::ExprMatch(_, ref innerarms, hir::MatchSource::ForLoopDesugar) = loopexpr.node,
|
||||
|
@ -81,7 +81,9 @@ impl<'a, 'tcx: 'a> SpanlessEq<'a, 'tcx> {
|
||||
l_op == r_op.node && self.eq_expr(ll, rl) && self.eq_expr(lr, rr)
|
||||
})
|
||||
}
|
||||
(&ExprBreak(li), &ExprBreak(ri)) => both(&li, &ri, |l, r| l.node.as_str() == r.node.as_str()),
|
||||
(&ExprBreak(li, ref le), &ExprBreak(ri, ref re)) =>
|
||||
both(&li, &ri, |l, r| l.node.as_str() == r.node.as_str())
|
||||
&& both(le, re, |l, r| self.eq_expr(l, r)),
|
||||
(&ExprBox(ref l), &ExprBox(ref r)) => self.eq_expr(l, r),
|
||||
(&ExprCall(ref l_fun, ref l_args), &ExprCall(ref r_fun, ref r_args)) => {
|
||||
!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> {
|
||||
self.eq_expr(lc, rc) && self.eq_block(lt, rt) && both(le, re, |l, r| self.eq_expr(l, r))
|
||||
}
|
||||
(&ExprLit(ref l), &ExprLit(ref r)) => l.node == r.node,
|
||||
(&ExprLoop(ref lb, ref ll), &ExprLoop(ref rb, ref rl)) => {
|
||||
self.eq_block(lb, rb) && both(ll, rl, |l, r| l.node.as_str() == r.node.as_str())
|
||||
(&ExprLoop(ref lb, ref ll, ref lls), &ExprLoop(ref rb, ref rl, ref rls)) => {
|
||||
self.eq_block(lb, rb) && both(ll, rl, |l, r| l.node.as_str() == r.node.as_str()) && lls == rls
|
||||
}
|
||||
(&ExprMatch(ref le, ref la, ref ls), &ExprMatch(ref re, ref ra, ref rs)) => {
|
||||
ls == rs && self.eq_expr(le, re) &&
|
||||
@ -344,12 +346,15 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
|
||||
self.hash_expr(l);
|
||||
self.hash_expr(r);
|
||||
}
|
||||
ExprBreak(i) => {
|
||||
let c: fn(_) -> _ = ExprBreak;
|
||||
ExprBreak(i, ref j) => {
|
||||
let c: fn(_, _) -> _ = ExprBreak;
|
||||
c.hash(&mut self.s);
|
||||
if let Some(i) = i {
|
||||
self.hash_name(&i.node);
|
||||
}
|
||||
if let Some(ref j) = *j {
|
||||
self.hash_expr(&*j);
|
||||
}
|
||||
}
|
||||
ExprBox(ref e) => {
|
||||
let c: fn(_) -> _ = ExprBox;
|
||||
@ -404,13 +409,14 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
|
||||
c.hash(&mut self.s);
|
||||
l.hash(&mut self.s);
|
||||
}
|
||||
ExprLoop(ref b, ref i) => {
|
||||
let c: fn(_, _) -> _ = ExprLoop;
|
||||
ExprLoop(ref b, ref i, ref j) => {
|
||||
let c: fn(_, _, _) -> _ = ExprLoop;
|
||||
c.hash(&mut self.s);
|
||||
self.hash_block(b);
|
||||
if let Some(i) = *i {
|
||||
self.hash_name(&i.node);
|
||||
}
|
||||
j.hash(&mut self.s);
|
||||
}
|
||||
ExprMatch(ref e, ref arms, ref s) => {
|
||||
let c: fn(_, _, _) -> _ = ExprMatch;
|
||||
|
@ -285,7 +285,12 @@ fn print_expr(cx: &LateContext, expr: &hir::Expr, indent: usize) {
|
||||
println!("mutability: {:?}", muta);
|
||||
print_expr(cx, e, indent + 1);
|
||||
},
|
||||
hir::ExprBreak(_) => println!("{}Break, {}", ind, ty),
|
||||
hir::ExprBreak(_, ref e) => {
|
||||
println!("{}Break, {}", ind, ty);
|
||||
if let Some(ref e) = *e {
|
||||
print_expr(cx, e, indent + 1);
|
||||
}
|
||||
},
|
||||
hir::ExprAgain(_) => println!("{}Again, {}", ind, ty),
|
||||
hir::ExprRet(ref e) => {
|
||||
println!("{}Ret, {}", ind, ty);
|
||||
|
Loading…
Reference in New Issue
Block a user