Skip to content

rustup to rustc 1.15.0-nightly (d5814b03e 2016-11-23) #1367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.0.102"
version = "0.0.103"
authors = [
"Manish Goregaokar <[email protected]>",
"Andre Bogus <[email protected]>",
Expand All @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/attrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/eval_order_dependence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/loops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/shadow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to check ExprBreak here, too?

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) => {
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/unused_label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/higher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
20 changes: 13 additions & 7 deletions clippy_lints/src/utils/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) &&
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion clippy_lints/src/utils/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down