Skip to content

Commit f3ae929

Browse files
committed
Rustup
1 parent 3ab06c1 commit f3ae929

27 files changed

+60
-57
lines changed

clippy_lints/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ fn is_relevant_expr(tcx: TyCtxt, tables: &ty::TypeckTables, expr: &Expr) -> bool
215215
ExprBreak(_, None) => false,
216216
ExprCall(ref path_expr, _) => {
217217
if let ExprPath(ref qpath) = path_expr.node {
218-
let fun_id = tables.qpath_def(qpath, path_expr.id).def_id();
218+
let fun_id = tables.qpath_def(qpath, path_expr.hir_id).def_id();
219219
!match_def_path(tcx, fun_id, &paths::BEGIN_PANIC)
220220
} else {
221221
true

clippy_lints/src/bit_mask.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ fn fetch_int_literal(cx: &LateContext, lit: &Expr) -> Option<u128> {
318318
}
319319
},
320320
ExprPath(ref qpath) => {
321-
let def = cx.tables.qpath_def(qpath, lit.id);
321+
let def = cx.tables.qpath_def(qpath, lit.hir_id);
322322
if let Def::Const(def_id) = def {
323323
lookup_const_by_id(cx.tcx, cx.param_env.and((def_id, Substs::empty()))).and_then(|(l, _ty)| {
324324
let body = if let Some(id) = cx.tcx.hir.as_local_node_id(l) {

clippy_lints/src/booleans.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ impl<'a, 'tcx, 'v> Hir2Qmm<'a, 'tcx, 'v> {
122122
let mk_expr = |op| {
123123
Expr {
124124
id: DUMMY_NODE_ID,
125+
hir_id: DUMMY_HIR_ID,
125126
span: DUMMY_SP,
126127
attrs: ThinVec::new(),
127128
node: ExprBinary(dummy_spanned(op), lhs.clone(), rhs.clone()),
@@ -411,7 +412,7 @@ impl<'a, 'tcx> Visitor<'tcx> for NonminimalBoolVisitor<'a, 'tcx> {
411412
match e.node {
412413
ExprBinary(binop, _, _) if binop.node == BiOr || binop.node == BiAnd => self.bool_expr(e),
413414
ExprUnary(UnNot, ref inner) => {
414-
if self.cx.tables.node_types[&inner.id].is_bool() {
415+
if self.cx.tables.node_types()[inner.hir_id].is_bool() {
415416
self.bool_expr(e);
416417
} else {
417418
walk_expr(self, e);

clippy_lints/src/consts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::cmp::PartialOrd;
1212
use std::hash::{Hash, Hasher};
1313
use std::mem;
1414
use std::rc::Rc;
15-
use syntax::ast::{FloatTy, LitKind, StrStyle, NodeId};
15+
use syntax::ast::{FloatTy, LitKind, StrStyle};
1616
use syntax::ptr::P;
1717

1818
#[derive(Debug, Copy, Clone)]
@@ -249,7 +249,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
249249
/// simple constant folding: Insert an expression, get a constant or none.
250250
fn expr(&mut self, e: &Expr) -> Option<Constant> {
251251
match e.node {
252-
ExprPath(ref qpath) => self.fetch_path(qpath, e.id),
252+
ExprPath(ref qpath) => self.fetch_path(qpath, e.hir_id),
253253
ExprBlock(ref block) => self.block(block),
254254
ExprIf(ref cond, ref then, ref otherwise) => self.ifthenelse(cond, then, otherwise),
255255
ExprLit(ref lit) => Some(lit_to_constant(&lit.node, self.tcx, self.tables.expr_ty(e))),
@@ -284,7 +284,7 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
284284
}
285285

286286
/// lookup a possibly constant expression from a ExprPath
287-
fn fetch_path(&mut self, qpath: &QPath, id: NodeId) -> Option<Constant> {
287+
fn fetch_path(&mut self, qpath: &QPath, id: HirId) -> Option<Constant> {
288288
let def = self.tables.qpath_def(qpath, id);
289289
match def {
290290
Def::Const(def_id) |

clippy_lints/src/cyclomatic_complexity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl CyclomaticComplexity {
7171
returns,
7272
..
7373
} = helper;
74-
let ret_ty = cx.tables.node_id_to_type(expr.id);
74+
let ret_ty = cx.tables.node_id_to_type(expr.hir_id);
7575
let ret_adjust = if match_type(cx, ret_ty, &paths::RESULT) {
7676
returns
7777
} else {
@@ -160,7 +160,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CCHelper<'a, 'tcx> {
160160
},
161161
ExprCall(ref callee, _) => {
162162
walk_expr(self, e);
163-
let ty = self.cx.tables.node_id_to_type(callee.id);
163+
let ty = self.cx.tables.node_id_to_type(callee.hir_id);
164164
match ty.sty {
165165
ty::TyFnDef(..) | ty::TyFnPtr(_) => {
166166
let sig = ty.fn_sig(self.cx.tcx);

clippy_lints/src/drop_forget_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
120120
let ExprPath(ref qpath) = path.node,
121121
args.len() == 1,
122122
], {
123-
let def_id = cx.tables.qpath_def(qpath, path.id).def_id();
123+
let def_id = cx.tables.qpath_def(qpath, path.hir_id).def_id();
124124
let lint;
125125
let msg;
126126
let arg = &args[0];

clippy_lints/src/eval_order_dependence.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EvalOrderDependence {
6767
if let ExprPath(ref qpath) = lhs.node {
6868
if let QPath::Resolved(_, ref path) = *qpath {
6969
if path.segments.len() == 1 {
70-
let var = cx.tables.qpath_def(qpath, lhs.id).def_id();
70+
let var = cx.tables.qpath_def(qpath, lhs.hir_id).def_id();
7171
let mut visitor = ReadVisitor {
7272
cx: cx,
7373
var: var,
@@ -304,7 +304,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ReadVisitor<'a, 'tcx> {
304304
match expr.node {
305305
ExprPath(ref qpath) => {
306306
if let QPath::Resolved(None, ref path) = *qpath {
307-
if path.segments.len() == 1 && self.cx.tables.qpath_def(qpath, expr.id).def_id() == self.var {
307+
if path.segments.len() == 1 && self.cx.tables.qpath_def(qpath, expr.hir_id).def_id() == self.var {
308308
if is_in_assignment_position(self.cx, expr) {
309309
// This is a write, not a read.
310310
} else {

clippy_lints/src/format.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
4747
if_let_chain!{[
4848
let ExprPath(ref qpath) = fun.node,
4949
args.len() == 2,
50-
match_def_path(cx.tcx, resolve_node(cx, qpath, fun.id).def_id(), &paths::FMT_ARGUMENTS_NEWV1),
50+
match_def_path(cx.tcx, resolve_node(cx, qpath, fun.hir_id).def_id(), &paths::FMT_ARGUMENTS_NEWV1),
5151
// ensure the format string is `"{..}"` with only one argument and no text
5252
check_static_str(cx, &args[0]),
5353
// ensure the format argument is `{}` ie. Display with no fancy option
@@ -130,7 +130,7 @@ fn check_arg_is_display(cx: &LateContext, expr: &Expr) -> bool {
130130
let ExprCall(_, ref args) = exprs[0].node,
131131
args.len() == 2,
132132
let ExprPath(ref qpath) = args[1].node,
133-
match_def_path(cx.tcx, resolve_node(cx, qpath, args[1].id).def_id(), &paths::DISPLAY_FMT_METHOD),
133+
match_def_path(cx.tcx, resolve_node(cx, qpath, args[1].hir_id).def_id(), &paths::DISPLAY_FMT_METHOD),
134134
], {
135135
let ty = walk_ptrs_ty(cx.tables.pat_ty(&pat[0]));
136136

clippy_lints/src/functions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl<'a, 'tcx> hir::intravisit::Visitor<'tcx> for DerefVisitor<'a, 'tcx> {
187187
}
188188
},
189189
hir::ExprMethodCall(_, _, ref args) => {
190-
let def_id = self.cx.tables.type_dependent_defs[&expr.id].def_id();
190+
let def_id = self.cx.tables.type_dependent_defs()[expr.hir_id].def_id();
191191
let base_type = self.cx.tcx.type_of(def_id);
192192

193193
if type_is_unsafe_function(self.cx, base_type) {
@@ -210,7 +210,7 @@ impl<'a, 'tcx> hir::intravisit::Visitor<'tcx> for DerefVisitor<'a, 'tcx> {
210210
impl<'a, 'tcx: 'a> DerefVisitor<'a, 'tcx> {
211211
fn check_arg(&self, ptr: &hir::Expr) {
212212
if let hir::ExprPath(ref qpath) = ptr.node {
213-
let def = self.cx.tables.qpath_def(qpath, ptr.id);
213+
let def = self.cx.tables.qpath_def(qpath, ptr.hir_id);
214214
if self.ptrs.contains(&def.def_id()) {
215215
span_lint(
216216
self.cx,

clippy_lints/src/let_if_seq.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl<'a, 'tcx> hir::intravisit::Visitor<'tcx> for UsedVisitor<'a, 'tcx> {
139139
fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
140140
if_let_chain! {[
141141
let hir::ExprPath(ref qpath) = expr.node,
142-
self.id == self.cx.tables.qpath_def(qpath, expr.id).def_id(),
142+
self.id == self.cx.tables.qpath_def(qpath, expr.hir_id).def_id(),
143143
], {
144144
self.used = true;
145145
return;
@@ -162,7 +162,7 @@ fn check_assign<'a, 'tcx>(
162162
let hir::StmtSemi(ref expr, _) = expr.node,
163163
let hir::ExprAssign(ref var, ref value) = expr.node,
164164
let hir::ExprPath(ref qpath) = var.node,
165-
decl == cx.tables.qpath_def(qpath, var.id).def_id(),
165+
decl == cx.tables.qpath_def(qpath, var.hir_id).def_id(),
166166
], {
167167
let mut v = UsedVisitor {
168168
cx: cx,

clippy_lints/src/lifetimes.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ impl<'v, 't> RefVisitor<'v, 't> {
284284
let last_path_segment = &last_path_segment(qpath).parameters;
285285
if let AngleBracketedParameters(ref params) = *last_path_segment {
286286
if params.lifetimes.is_empty() {
287-
match self.cx.tables.qpath_def(qpath, ty.id) {
287+
let hir_id = self.cx.tcx.hir.node_to_hir_id(ty.id);
288+
match self.cx.tables.qpath_def(qpath, hir_id) {
288289
Def::TyAlias(def_id) |
289290
Def::Struct(def_id) => {
290291
let generics = self.cx.tcx.generics_of(def_id);

clippy_lints/src/loops.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,8 @@ fn check_for_loop_arg(cx: &LateContext, pat: &Pat, arg: &Expr, expr: &Expr) {
801801
lint_iter_method(cx, args, arg, method_name);
802802
}
803803
} else if method_name == "into_iter" && match_trait_method(cx, arg, &paths::INTO_ITERATOR) {
804-
let def_id = cx.tables.type_dependent_defs[&arg.id].def_id();
805-
let substs = cx.tables.node_substs(arg.id);
804+
let def_id = cx.tables.type_dependent_defs()[arg.hir_id].def_id();
805+
let substs = cx.tables.node_substs(arg.hir_id);
806806
let method_type = cx.tcx.type_of(def_id).subst(cx.tcx, substs);
807807

808808
let fn_arg_tys = method_type.fn_sig(cx.tcx).inputs();
@@ -1053,13 +1053,13 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
10531053
let QPath::Resolved(None, ref path) = *qpath,
10541054
path.segments.len() == 1,
10551055
// our variable!
1056-
self.cx.tables.qpath_def(qpath, expr.id).def_id() == self.var,
1056+
self.cx.tables.qpath_def(qpath, expr.hir_id).def_id() == self.var,
10571057
// the indexed container is referenced by a name
10581058
let ExprPath(ref seqpath) = seqexpr.node,
10591059
let QPath::Resolved(None, ref seqvar) = *seqpath,
10601060
seqvar.segments.len() == 1,
10611061
], {
1062-
let def = self.cx.tables.qpath_def(seqpath, seqexpr.id);
1062+
let def = self.cx.tables.qpath_def(seqpath, seqexpr.hir_id);
10631063
match def {
10641064
Def::Local(..) | Def::Upvar(..) => {
10651065
let def_id = def.def_id();
@@ -1085,7 +1085,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
10851085
let QPath::Resolved(None, ref path) = *qpath,
10861086
path.segments.len() == 1,
10871087
], {
1088-
if self.cx.tables.qpath_def(qpath, expr.id).def_id() == self.var {
1088+
if self.cx.tables.qpath_def(qpath, expr.hir_id).def_id() == self.var {
10891089
// we are not indexing anything, record that
10901090
self.nonindex = true;
10911091
} else {
@@ -1376,7 +1376,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
13761376

13771377
fn var_def_id(cx: &LateContext, expr: &Expr) -> Option<NodeId> {
13781378
if let ExprPath(ref qpath) = expr.node {
1379-
let path_res = cx.tables.qpath_def(qpath, expr.id);
1379+
let path_res = cx.tables.qpath_def(qpath, expr.hir_id);
13801380
if let Def::Local(def_id) = path_res {
13811381
let node_id = cx.tcx.hir.as_local_node_id(def_id).expect(
13821382
"That DefId should be valid",

clippy_lints/src/mem_forget.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MemForget {
3232
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
3333
if let ExprCall(ref path_expr, ref args) = e.node {
3434
if let ExprPath(ref qpath) = path_expr.node {
35-
let def_id = cx.tables.qpath_def(qpath, path_expr.id).def_id();
35+
let def_id = cx.tables.qpath_def(qpath, path_expr.hir_id).def_id();
3636
if match_def_path(cx.tcx, def_id, &paths::MEM_FORGET) {
3737
let forgot_ty = cx.tables.expr_ty(&args[0]);
3838

clippy_lints/src/methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ fn lint_cstring_as_ptr(cx: &LateContext, expr: &hir::Expr, new: &hir::Expr, unwr
898898
let hir::ExprCall(ref fun, ref args) = new.node,
899899
args.len() == 1,
900900
let hir::ExprPath(ref path) = fun.node,
901-
let Def::Method(did) = cx.tables.qpath_def(path, fun.id),
901+
let Def::Method(did) = cx.tables.qpath_def(path, fun.hir_id),
902902
match_def_path(cx.tcx, did, &paths::CSTRING_NEW)
903903
], {
904904
span_lint_and_then(cx, TEMPORARY_CSTRING_AS_PTR, expr.span,

clippy_lints/src/minmax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ enum MinMax {
6262
fn min_max<'a>(cx: &LateContext, expr: &'a Expr) -> Option<(MinMax, Constant, &'a Expr)> {
6363
if let ExprCall(ref path, ref args) = expr.node {
6464
if let ExprPath(ref qpath) = path.node {
65-
let def_id = cx.tables.qpath_def(qpath, path.id).def_id();
65+
let def_id = cx.tables.qpath_def(qpath, path.hir_id).def_id();
6666

6767
if match_def_path(cx.tcx, def_id, &paths::CMP_MIN) {
6868
fetch_const(cx, args, MinMax::Min)

clippy_lints/src/misc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
361361
binding != "_result" && // FIXME: #944
362362
is_used(cx, expr) &&
363363
// don't lint if the declaration is in a macro
364-
non_macro_local(cx, &cx.tables.qpath_def(qpath, expr.id))
364+
non_macro_local(cx, &cx.tables.qpath_def(qpath, expr.hir_id))
365365
{
366366
Some(binding)
367367
} else {

clippy_lints/src/mut_reference.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnnecessaryMutPassed {
4747
}
4848
},
4949
ExprMethodCall(ref path, _, ref arguments) => {
50-
let def_id = cx.tables.type_dependent_defs[&e.id].def_id();
51-
let substs = cx.tables.node_substs(e.id);
50+
let def_id = cx.tables.type_dependent_defs()[e.hir_id].def_id();
51+
let substs = cx.tables.node_substs(e.hir_id);
5252
let method_type = cx.tcx.type_of(def_id).subst(cx.tcx, substs);
5353
check_arguments(cx, arguments, method_type, &path.name.as_str())
5454
},

clippy_lints/src/no_effect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ fn has_no_effect(cx: &LateContext, expr: &Expr) -> bool {
6969
},
7070
Expr_::ExprCall(ref callee, ref args) => {
7171
if let Expr_::ExprPath(ref qpath) = callee.node {
72-
let def = cx.tables.qpath_def(qpath, callee.id);
72+
let def = cx.tables.qpath_def(qpath, callee.hir_id);
7373
match def {
7474
Def::Struct(..) |
7575
Def::Variant(..) |
@@ -165,7 +165,7 @@ fn reduce_expression<'a>(cx: &LateContext, expr: &'a Expr) -> Option<Vec<&'a Exp
165165
},
166166
Expr_::ExprCall(ref callee, ref args) => {
167167
if let Expr_::ExprPath(ref qpath) = callee.node {
168-
let def = cx.tables.qpath_def(qpath, callee.id);
168+
let def = cx.tables.qpath_def(qpath, callee.hir_id);
169169
match def {
170170
Def::Struct(..) |
171171
Def::Variant(..) |

clippy_lints/src/panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
4040
let ExprCall(ref fun, ref params) = ex.node,
4141
params.len() == 2,
4242
let ExprPath(ref qpath) = fun.node,
43-
match_def_path(cx.tcx, resolve_node(cx, qpath, fun.id).def_id(), &paths::BEGIN_PANIC),
43+
match_def_path(cx.tcx, resolve_node(cx, qpath, fun.hir_id).def_id(), &paths::BEGIN_PANIC),
4444
let ExprLit(ref lit) = params[0].node,
4545
is_direct_expn_of(expr.span, "panic").is_some(),
4646
let LitKind::Str(ref string, _) = lit.node,

clippy_lints/src/print.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
7373
let ExprCall(ref fun, ref args) = expr.node,
7474
let ExprPath(ref qpath) = fun.node,
7575
], {
76-
let fun = resolve_node(cx, qpath, fun.id);
76+
let fun = resolve_node(cx, qpath, fun.hir_id);
7777
let fun_id = fun.def_id();
7878

7979
// Search for `std::io::_print(..)` which is unique in a
@@ -97,7 +97,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
9797
let ExprCall(ref args_fun, ref args_args) = args[0].node,
9898
let ExprPath(ref qpath) = args_fun.node,
9999
match_def_path(cx.tcx,
100-
resolve_node(cx, qpath, args_fun.id).def_id(),
100+
resolve_node(cx, qpath, args_fun.hir_id).def_id(),
101101
&paths::FMT_ARGUMENTS_NEWV1),
102102
args_args.len() == 2,
103103
let ExprAddrOf(_, ref match_expr) = args_args[1].node,
@@ -125,7 +125,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
125125
// `::std::fmt::ArgumentV1::new(__arg0, ::std::fmt::Debug::fmt)`
126126
else if args.len() == 2 && match_def_path(cx.tcx, fun_id, &paths::FMT_ARGUMENTV1_NEW) {
127127
if let ExprPath(ref qpath) = args[1].node {
128-
let def_id = cx.tables.qpath_def(qpath, args[1].id).def_id();
128+
let def_id = cx.tables.qpath_def(qpath, args[1].hir_id).def_id();
129129
if match_def_path(cx.tcx, def_id, &paths::DEBUG_FMT_METHOD) && !is_in_debug_impl(cx, expr) &&
130130
is_expn_of(expr.span, "panic").is_none() {
131131
span_lint(cx, USE_DEBUG, args[0].span, "use of `Debug`-based formatting");

clippy_lints/src/regex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
118118
let ExprPath(ref qpath) = fun.node,
119119
args.len() == 1,
120120
], {
121-
let def_id = cx.tables.qpath_def(qpath, fun.id).def_id();
121+
let def_id = cx.tables.qpath_def(qpath, fun.hir_id).def_id();
122122
if match_def_path(cx.tcx, def_id, &paths::REGEX_NEW) ||
123123
match_def_path(cx.tcx, def_id, &paths::REGEX_BUILDER_NEW) {
124124
check_regex(cx, &args[0], true);

clippy_lints/src/shadow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ fn check_decl<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, decl: &'tcx Decl, bindings:
148148
}
149149
}
150150

151-
fn is_binding(cx: &LateContext, pat_id: NodeId) -> bool {
151+
fn is_binding(cx: &LateContext, pat_id: HirId) -> bool {
152152
let var_ty = cx.tables.node_id_to_type(pat_id);
153153
match var_ty.sty {
154154
ty::TyAdt(..) => false,
@@ -167,7 +167,7 @@ fn check_pat<'a, 'tcx>(
167167
match pat.node {
168168
PatKind::Binding(_, _, ref ident, ref inner) => {
169169
let name = ident.node;
170-
if is_binding(cx, pat.id) {
170+
if is_binding(cx, pat.hir_id) {
171171
let mut new_binding = true;
172172
for tup in bindings.iter_mut() {
173173
if tup.0 == name {

clippy_lints/src/transmute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Transmute {
8888
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
8989
if let ExprCall(ref path_expr, ref args) = e.node {
9090
if let ExprPath(ref qpath) = path_expr.node {
91-
let def_id = cx.tables.qpath_def(qpath, path_expr.id).def_id();
91+
let def_id = cx.tables.qpath_def(qpath, path_expr.hir_id).def_id();
9292

9393
if match_def_path(cx.tcx, def_id, &paths::TRANSMUTE) {
9494
let from_ty = cx.tables.expr_ty(&args[0]);

0 commit comments

Comments
 (0)