Skip to content

Commit f400548

Browse files
authored
Merge pull request #2770 from mati865/rustup
Rustup to 2018-05-16
2 parents 1af2f20 + f0c823a commit f400548

25 files changed

+40
-41
lines changed

clippy_lints/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ fn is_relevant_block(tcx: TyCtxt, tables: &ty::TypeckTables, block: &Block) -> b
243243

244244
fn is_relevant_expr(tcx: TyCtxt, tables: &ty::TypeckTables, expr: &Expr) -> bool {
245245
match expr.node {
246-
ExprBlock(ref block) => is_relevant_block(tcx, tables, block),
246+
ExprBlock(ref block, _) => is_relevant_block(tcx, tables, block),
247247
ExprRet(Some(ref e)) => is_relevant_expr(tcx, tables, e),
248248
ExprRet(None) | ExprBreak(_, None) => false,
249249
ExprCall(ref path_expr, _) => if let ExprPath(ref qpath) = path_expr.node {

clippy_lints/src/block_in_if_condition.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ impl<'a, 'tcx: 'a> Visitor<'tcx> for ExVisitor<'a, 'tcx> {
5959
if let ExprClosure(_, _, eid, _, _) = expr.node {
6060
let body = self.cx.tcx.hir.body(eid);
6161
let ex = &body.value;
62-
if matches!(ex.node, ExprBlock(_)) {
62+
if matches!(ex.node, ExprBlock(_, _)) {
6363
self.found_block = Some(ex);
6464
return;
6565
}
@@ -78,7 +78,7 @@ const COMPLEX_BLOCK_MESSAGE: &str = "in an 'if' condition, avoid complex blocks
7878
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for BlockInIfCondition {
7979
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, expr: &'tcx Expr) {
8080
if let ExprIf(ref check, ref then, _) = expr.node {
81-
if let ExprBlock(ref block) = check.node {
81+
if let ExprBlock(ref block, _) = check.node {
8282
if block.rules == DefaultBlock {
8383
if block.stmts.is_empty() {
8484
if let Some(ref ex) = block.expr {

clippy_lints/src/bytecount.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ fn check_arg(name: Name, arg: Name, needle: &Expr) -> bool {
9999
fn get_path_name(expr: &Expr) -> Option<Name> {
100100
match expr.node {
101101
ExprBox(ref e) | ExprAddrOf(_, ref e) | ExprUnary(UnOp::UnDeref, ref e) => get_path_name(e),
102-
ExprBlock(ref b) => if b.stmts.is_empty() {
102+
ExprBlock(ref b, _) => if b.stmts.is_empty() {
103103
b.expr.as_ref().and_then(|p| get_path_name(p))
104104
} else {
105105
None

clippy_lints/src/collapsible_if.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fn check_if(cx: &EarlyContext, expr: &ast::Expr) {
101101

102102
fn check_collapsible_maybe_if_let(cx: &EarlyContext, else_: &ast::Expr) {
103103
if_chain! {
104-
if let ast::ExprKind::Block(ref block) = else_.node;
104+
if let ast::ExprKind::Block(ref block, _) = else_.node;
105105
if let Some(else_) = expr_block(block);
106106
if !in_macro(else_.span);
107107
then {

clippy_lints/src/consts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
202202
pub fn expr(&mut self, e: &Expr) -> Option<Constant> {
203203
match e.node {
204204
ExprPath(ref qpath) => self.fetch_path(qpath, e.hir_id),
205-
ExprBlock(ref block) => self.block(block),
205+
ExprBlock(ref block, _) => self.block(block),
206206
ExprIf(ref cond, ref then, ref otherwise) => self.ifthenelse(cond, then, otherwise),
207207
ExprLit(ref lit) => Some(lit_to_constant(&lit.node, self.tables.expr_ty(e))),
208208
ExprArray(ref vec) => self.multi(vec).map(Constant::Vec),

clippy_lints/src/copies.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ fn if_sequence(mut expr: &Expr) -> (SmallVector<&Expr>, SmallVector<&Block>) {
238238

239239
while let ExprIf(ref cond, ref then_expr, ref else_expr) = expr.node {
240240
conds.push(&**cond);
241-
if let ExprBlock(ref block) = then_expr.node {
241+
if let ExprBlock(ref block, _) = then_expr.node {
242242
blocks.push(block);
243243
} else {
244244
panic!("ExprIf node is not an ExprBlock");
@@ -253,7 +253,7 @@ fn if_sequence(mut expr: &Expr) -> (SmallVector<&Expr>, SmallVector<&Block>) {
253253

254254
// final `else {..}`
255255
if !blocks.is_empty() {
256-
if let ExprBlock(ref block) = expr.node {
256+
if let ExprBlock(ref block, _) = expr.node {
257257
blocks.push(&**block);
258258
}
259259
}

clippy_lints/src/entry.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for HashMapLint {
4747
// in case of `if !m.contains_key(&k) { m.insert(k, v); }`
4848
// we can give a better error message
4949
let sole_expr = {
50-
else_block.is_none() && if let ExprBlock(ref then_block) = then_block.node {
50+
else_block.is_none() && if let ExprBlock(ref then_block, _) = then_block.node {
5151
(then_block.expr.is_some() as usize) + then_block.stmts.len() == 1
5252
} else {
5353
true

clippy_lints/src/infinite_iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn is_infinite(cx: &LateContext, expr: &Expr) -> Finiteness {
160160
}
161161
Finite
162162
},
163-
ExprBlock(ref block) => block.expr.as_ref().map_or(Finite, |e| is_infinite(cx, e)),
163+
ExprBlock(ref block, _) => block.expr.as_ref().map_or(Finite, |e| is_infinite(cx, e)),
164164
ExprBox(ref e) | ExprAddrOf(_, ref e) => is_infinite(cx, e),
165165
ExprCall(ref path, _) => if let ExprPath(ref qpath) = path.node {
166166
match_qpath(qpath, &paths::REPEAT).into()

clippy_lints/src/let_if_seq.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LetIfSeq {
7171
if let hir::StmtExpr(ref if_, _) = expr.node;
7272
if let hir::ExprIf(ref cond, ref then, ref else_) = if_.node;
7373
if !used_in_expr(cx, canonical_id, cond);
74-
if let hir::ExprBlock(ref then) = then.node;
74+
if let hir::ExprBlock(ref then, _) = then.node;
7575
if let Some(value) = check_assign(cx, canonical_id, &*then);
7676
if !used_in_expr(cx, canonical_id, value);
7777
then {
7878
let span = stmt.span.to(if_.span);
7979

8080
let (default_multi_stmts, default) = if let Some(ref else_) = *else_ {
81-
if let hir::ExprBlock(ref else_) = else_.node {
81+
if let hir::ExprBlock(ref else_, _) = else_.node {
8282
if let Some(default) = check_assign(cx, canonical_id, else_) {
8383
(else_.stmts.len() > 1, default)
8484
} else if let Some(ref default) = decl.init {

clippy_lints/src/lifetimes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,13 +296,13 @@ impl<'v, 't> RefVisitor<'v, 't> {
296296
match self.cx.tables.qpath_def(qpath, hir_id) {
297297
Def::TyAlias(def_id) | Def::Struct(def_id) => {
298298
let generics = self.cx.tcx.generics_of(def_id);
299-
for _ in generics.regions.as_slice() {
299+
for _ in generics.params.as_slice() {
300300
self.record(&None);
301301
}
302302
},
303303
Def::Trait(def_id) => {
304304
let trait_def = self.cx.tcx.trait_def(def_id);
305-
for _ in &self.cx.tcx.generics_of(trait_def.def_id).regions {
305+
for _ in &self.cx.tcx.generics_of(trait_def.def_id).params {
306306
self.record(&None);
307307
}
308308
},

0 commit comments

Comments
 (0)