Skip to content

Commit ca20dd9

Browse files
matthiaskrgrManishearth
authored andcommitted
Rustup to rustc 1.36.0-nightly (13fde05 2019-05-03)
1 parent 19316b4 commit ca20dd9

39 files changed

+118
-114
lines changed

clippy_lints/src/assign_ops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for AssignOps {
9999
let parent_fn = cx.tcx.hir().get_parent_item(e.hir_id);
100100
if_chain! {
101101
if let Some(trait_ref) = trait_ref_of_method(cx, parent_fn);
102-
if trait_ref.path.def.def_id() == trait_id;
102+
if trait_ref.path.res.def_id() == trait_id;
103103
then { return; }
104104
}
105105
implements_trait($cx, $ty, trait_id, &[$rty])

clippy_lints/src/attrs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ fn is_relevant_expr(cx: &LateContext<'_, '_>, tables: &ty::TypeckTables<'_>, exp
394394
ExprKind::Ret(None) | ExprKind::Break(_, None) => false,
395395
ExprKind::Call(path_expr, _) => {
396396
if let ExprKind::Path(qpath) = &path_expr.node {
397-
if let Some(fun_id) = tables.qpath_def(qpath, path_expr.hir_id).opt_def_id() {
397+
if let Some(fun_id) = tables.qpath_res(qpath, path_expr.hir_id).opt_def_id() {
398398
!cx.match_def_path(fun_id, &paths::BEGIN_PANIC)
399399
} else {
400400
true

clippy_lints/src/consts.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use crate::utils::{clip, sext, unsext};
44
use if_chain::if_chain;
5-
use rustc::hir::def::Def;
5+
use rustc::hir::def::{DefKind, Res};
66
use rustc::hir::*;
77
use rustc::lint::LateContext;
88
use rustc::ty::subst::{Subst, SubstsRef};
@@ -247,8 +247,8 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
247247
if_chain! {
248248
if args.is_empty();
249249
if let ExprKind::Path(qpath) = &callee.node;
250-
let def = self.tables.qpath_def(qpath, callee.hir_id);
251-
if let Some(def_id) = def.opt_def_id();
250+
let res = self.tables.qpath_res(qpath, callee.hir_id);
251+
if let Some(def_id) = res.opt_def_id();
252252
let def_path = self.lcx.get_def_path(def_id)
253253
.iter()
254254
.map(LocalInternedString::get)
@@ -322,9 +322,9 @@ impl<'c, 'cc> ConstEvalLateContext<'c, 'cc> {
322322
fn fetch_path(&mut self, qpath: &QPath, id: HirId) -> Option<Constant> {
323323
use rustc::mir::interpret::GlobalId;
324324

325-
let def = self.tables.qpath_def(qpath, id);
326-
match def {
327-
Def::Const(def_id) | Def::AssociatedConst(def_id) => {
325+
let res = self.tables.qpath_res(qpath, id);
326+
match res {
327+
Res::Def(DefKind::Const, def_id) | Res::Def(DefKind::AssociatedConst, def_id) => {
328328
let substs = self.tables.node_substs(id);
329329
let substs = if self.substs.is_empty() {
330330
substs

clippy_lints/src/default_trait_access.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DefaultTraitAccess {
3636
if let ExprKind::Call(ref path, ..) = expr.node;
3737
if !any_parent_is_automatically_derived(cx.tcx, expr.hir_id);
3838
if let ExprKind::Path(ref qpath) = path.node;
39-
if let Some(def_id) = cx.tables.qpath_def(qpath, path.hir_id).opt_def_id();
39+
if let Some(def_id) = cx.tables.qpath_res(qpath, path.hir_id).opt_def_id();
4040
if cx.match_def_path(def_id, &paths::DEFAULT_TRAIT_METHOD);
4141
then {
4242
match qpath {

clippy_lints/src/drop_bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DropBounds {
5555
fn lint_bound<'a, 'tcx>(cx: &rustc::lint::LateContext<'a, 'tcx>, bound: &'tcx GenericBound) {
5656
if_chain! {
5757
if let GenericBound::Trait(t, _) = bound;
58-
if let Some(def_id) = t.trait_ref.path.def.opt_def_id();
58+
if let Some(def_id) = t.trait_ref.path.res.opt_def_id();
5959
if cx.match_def_path(def_id, &paths::DROP_TRAIT);
6060
then {
6161
span_lint(

clippy_lints/src/drop_forget_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for DropForgetRef {
114114
if let ExprKind::Call(ref path, ref args) = expr.node;
115115
if let ExprKind::Path(ref qpath) = path.node;
116116
if args.len() == 1;
117-
if let Some(def_id) = cx.tables.qpath_def(qpath, path.hir_id).opt_def_id();
117+
if let Some(def_id) = cx.tables.qpath_res(qpath, path.hir_id).opt_def_id();
118118
then {
119119
let lint;
120120
let msg;

clippy_lints/src/enum_glob_use.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! lint on `use`ing all variants of an enum
22
33
use crate::utils::span_lint;
4-
use rustc::hir::def::Def;
4+
use rustc::hir::def::{DefKind, Res};
55
use rustc::hir::*;
66
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
77
use rustc::{declare_lint_pass, declare_tool_lint};
@@ -43,7 +43,7 @@ impl EnumGlobUse {
4343
return; // re-exports are fine
4444
}
4545
if let ItemKind::Use(ref path, UseKind::Glob) = item.node {
46-
if let Def::Enum(_) = path.def {
46+
if let Res::Def(DefKind::Enum, _) = path.res {
4747
span_lint(cx, ENUM_GLOB_USE, item.span, "don't use glob imports for enum variants");
4848
}
4949
}

clippy_lints/src/eval_order_dependence.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for EvalOrderDependence {
6363
if let ExprKind::Path(ref qpath) = lhs.node {
6464
if let QPath::Resolved(_, ref path) = *qpath {
6565
if path.segments.len() == 1 {
66-
if let def::Def::Local(var) = cx.tables.qpath_def(qpath, lhs.hir_id) {
66+
if let def::Res::Local(var) = cx.tables.qpath_res(qpath, lhs.hir_id) {
6767
let mut visitor = ReadVisitor {
6868
cx,
6969
var,
@@ -295,7 +295,7 @@ impl<'a, 'tcx> Visitor<'tcx> for ReadVisitor<'a, 'tcx> {
295295
if_chain! {
296296
if let QPath::Resolved(None, ref path) = *qpath;
297297
if path.segments.len() == 1;
298-
if let def::Def::Local(local_id) = self.cx.tables.qpath_def(qpath, expr.hir_id);
298+
if let def::Res::Local(local_id) = self.cx.tables.qpath_res(qpath, expr.hir_id);
299299
if local_id == self.var;
300300
// Check that this is a read, not a write.
301301
if !is_in_assignment_position(self.cx, expr);

clippy_lints/src/fallible_impl_from.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ fn lint_impl_body<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, impl_span: Span, impl_it
6161
if_chain! {
6262
if let ExprKind::Call(ref func_expr, _) = expr.node;
6363
if let ExprKind::Path(QPath::Resolved(_, ref path)) = func_expr.node;
64-
if let Some(path_def_id) = path.def.opt_def_id();
64+
if let Some(path_def_id) = path.res.opt_def_id();
6565
if self.lcx.match_def_path(path_def_id, &BEGIN_PANIC) ||
6666
self.lcx.match_def_path(path_def_id, &BEGIN_PANIC_FMT);
6767
if is_expn_of(expr.span, "unreachable").is_none();

clippy_lints/src/functions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::convert::TryFrom;
33
use crate::utils::{iter_input_pats, snippet, snippet_opt, span_lint, type_is_unsafe_function};
44
use matches::matches;
55
use rustc::hir;
6-
use rustc::hir::def::Def;
6+
use rustc::hir::def::Res;
77
use rustc::hir::intravisit;
88
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
99
use rustc::ty;
@@ -333,7 +333,7 @@ impl<'a, 'tcx> hir::intravisit::Visitor<'tcx> for DerefVisitor<'a, 'tcx> {
333333
impl<'a, 'tcx: 'a> DerefVisitor<'a, 'tcx> {
334334
fn check_arg(&self, ptr: &hir::Expr) {
335335
if let hir::ExprKind::Path(ref qpath) = ptr.node {
336-
if let Def::Local(id) = self.cx.tables.qpath_def(qpath, ptr.hir_id) {
336+
if let Res::Local(id) = self.cx.tables.qpath_res(qpath, ptr.hir_id) {
337337
if self.ptrs.contains(&id) {
338338
span_lint(
339339
self.cx,

clippy_lints/src/invalid_ref.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidRef {
3535
if let ExprKind::Path(ref qpath) = path.node;
3636
if args.len() == 0;
3737
if let ty::Ref(..) = cx.tables.expr_ty(expr).sty;
38-
if let Some(def_id) = cx.tables.qpath_def(qpath, path.hir_id).opt_def_id();
38+
if let Some(def_id) = cx.tables.qpath_res(qpath, path.hir_id).opt_def_id();
3939
then {
4040
let msg = if cx.match_def_path(def_id, &paths::MEM_ZEROED) |
4141
cx.match_def_path(def_id, &paths::INIT)

clippy_lints/src/let_if_seq.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::utils::{snippet, span_lint_and_then};
22
use if_chain::if_chain;
33
use rustc::hir;
4-
use rustc::hir::def::Def;
4+
use rustc::hir::def::Res;
55
use rustc::hir::BindingAnnotation;
66
use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass};
77
use rustc::{declare_lint_pass, declare_tool_lint};
@@ -145,7 +145,7 @@ impl<'a, 'tcx> hir::intravisit::Visitor<'tcx> for UsedVisitor<'a, 'tcx> {
145145
fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
146146
if_chain! {
147147
if let hir::ExprKind::Path(ref qpath) = expr.node;
148-
if let Def::Local(local_id) = self.cx.tables.qpath_def(qpath, expr.hir_id);
148+
if let Res::Local(local_id) = self.cx.tables.qpath_res(qpath, expr.hir_id);
149149
if self.id == local_id;
150150
then {
151151
self.used = true;
@@ -170,7 +170,7 @@ fn check_assign<'a, 'tcx>(
170170
if let hir::StmtKind::Semi(ref expr) = expr.node;
171171
if let hir::ExprKind::Assign(ref var, ref value) = expr.node;
172172
if let hir::ExprKind::Path(ref qpath) = var.node;
173-
if let Def::Local(local_id) = cx.tables.qpath_def(qpath, var.hir_id);
173+
if let Res::Local(local_id) = cx.tables.qpath_res(qpath, var.hir_id);
174174
if decl == local_id;
175175
then {
176176
let mut v = UsedVisitor {

clippy_lints/src/lifetimes.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use matches::matches;
2-
use rustc::hir::def::Def;
2+
use rustc::hir::def::{DefKind, Res};
33
use rustc::hir::intravisit::*;
44
use rustc::hir::*;
55
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
@@ -310,14 +310,14 @@ impl<'v, 't> RefVisitor<'v, 't> {
310310
})
311311
{
312312
let hir_id = ty.hir_id;
313-
match self.cx.tables.qpath_def(qpath, hir_id) {
314-
Def::TyAlias(def_id) | Def::Struct(def_id) => {
313+
match self.cx.tables.qpath_res(qpath, hir_id) {
314+
Res::Def(DefKind::TyAlias, def_id) | Res::Def(DefKind::Struct, def_id) => {
315315
let generics = self.cx.tcx.generics_of(def_id);
316316
for _ in generics.params.as_slice() {
317317
self.record(&None);
318318
}
319319
},
320-
Def::Trait(def_id) => {
320+
Res::Def(DefKind::Trait, def_id) => {
321321
let trait_def = self.cx.tcx.trait_def(def_id);
322322
for _ in &self.cx.tcx.generics_of(trait_def.def_id).params {
323323
self.record(&None);

clippy_lints/src/loops.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use crate::reexport::*;
22
use if_chain::if_chain;
33
use itertools::Itertools;
4-
use rustc::hir::def::Def;
4+
use rustc::hir::def::{DefKind, Res};
55
use rustc::hir::def_id;
66
use rustc::hir::intravisit::{walk_block, walk_expr, walk_pat, walk_stmt, NestedVisitorMap, Visitor};
77
use rustc::hir::*;
@@ -778,7 +778,7 @@ fn same_var<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, expr: &Expr, var: HirId) -> bo
778778
if let ExprKind::Path(ref qpath) = expr.node;
779779
if let QPath::Resolved(None, ref path) = *qpath;
780780
if path.segments.len() == 1;
781-
if let Def::Local(local_id) = cx.tables.qpath_def(qpath, expr.hir_id);
781+
if let Res::Local(local_id) = cx.tables.qpath_res(qpath, expr.hir_id);
782782
// our variable!
783783
if local_id == var;
784784
then {
@@ -1637,8 +1637,8 @@ fn check_for_mutability(cx: &LateContext<'_, '_>, bound: &Expr) -> Option<HirId>
16371637
if let ExprKind::Path(ref qpath) = bound.node;
16381638
if let QPath::Resolved(None, _) = *qpath;
16391639
then {
1640-
let def = cx.tables.qpath_def(qpath, bound.hir_id);
1641-
if let Def::Local(node_id) = def {
1640+
let res = cx.tables.qpath_res(qpath, bound.hir_id);
1641+
if let Res::Local(node_id) = res {
16421642
let node_str = cx.tcx.hir().get_by_hir_id(node_id);
16431643
if_chain! {
16441644
if let Node::Binding(pat) = node_str;
@@ -1772,9 +1772,9 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
17721772
if self.prefer_mutable {
17731773
self.indexed_mut.insert(seqvar.segments[0].ident.name);
17741774
}
1775-
let def = self.cx.tables.qpath_def(seqpath, seqexpr.hir_id);
1776-
match def {
1777-
Def::Local(hir_id) | Def::Upvar(hir_id, ..) => {
1775+
let res = self.cx.tables.qpath_res(seqpath, seqexpr.hir_id);
1776+
match res {
1777+
Res::Local(hir_id) | Res::Upvar(hir_id, ..) => {
17781778
let parent_id = self.cx.tcx.hir().get_parent_item(expr.hir_id);
17791779
let parent_def_id = self.cx.tcx.hir().local_def_id_from_hir_id(parent_id);
17801780
let extent = self.cx.tcx.region_scope_tree(parent_def_id).var_scope(hir_id.local_id);
@@ -1789,7 +1789,7 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
17891789
}
17901790
return false; // no need to walk further *on the variable*
17911791
}
1792-
Def::Static(..) | Def::Const(..) => {
1792+
Res::Def(DefKind::Static, ..) | Res::Def(DefKind::Const, ..) => {
17931793
if indexed_indirectly {
17941794
self.indexed_indirectly.insert(seqvar.segments[0].ident.name, None);
17951795
}
@@ -1834,14 +1834,14 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
18341834
if let QPath::Resolved(None, ref path) = *qpath;
18351835
if path.segments.len() == 1;
18361836
then {
1837-
match self.cx.tables.qpath_def(qpath, expr.hir_id) {
1838-
Def::Upvar(local_id, ..) => {
1837+
match self.cx.tables.qpath_res(qpath, expr.hir_id) {
1838+
Res::Upvar(local_id, ..) => {
18391839
if local_id == self.var {
18401840
// we are not indexing anything, record that
18411841
self.nonindex = true;
18421842
}
18431843
}
1844-
Def::Local(local_id) =>
1844+
Res::Local(local_id) =>
18451845
{
18461846

18471847
if local_id == self.var {
@@ -2187,8 +2187,8 @@ impl<'a, 'tcx> Visitor<'tcx> for InitializeVisitor<'a, 'tcx> {
21872187

21882188
fn var_def_id(cx: &LateContext<'_, '_>, expr: &Expr) -> Option<HirId> {
21892189
if let ExprKind::Path(ref qpath) = expr.node {
2190-
let path_res = cx.tables.qpath_def(qpath, expr.hir_id);
2191-
if let Def::Local(node_id) = path_res {
2190+
let path_res = cx.tables.qpath_res(qpath, expr.hir_id);
2191+
if let Res::Local(node_id) = path_res {
21922192
return Some(node_id);
21932193
}
21942194
}
@@ -2380,13 +2380,13 @@ impl<'a, 'tcx> VarCollectorVisitor<'a, 'tcx> {
23802380
if_chain! {
23812381
if let ExprKind::Path(ref qpath) = ex.node;
23822382
if let QPath::Resolved(None, _) = *qpath;
2383-
let def = self.cx.tables.qpath_def(qpath, ex.hir_id);
2383+
let res = self.cx.tables.qpath_res(qpath, ex.hir_id);
23842384
then {
2385-
match def {
2386-
Def::Local(node_id) | Def::Upvar(node_id, ..) => {
2385+
match res {
2386+
Res::Local(node_id) | Res::Upvar(node_id, ..) => {
23872387
self.ids.insert(node_id);
23882388
},
2389-
Def::Static(def_id) => {
2389+
Res::Def(DefKind::Static, def_id) => {
23902390
let mutable = self.cx.tcx.is_mutable_static(def_id);
23912391
self.def_ids.insert(def_id, mutable);
23922392
},

clippy_lints/src/matches.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,11 @@ fn check_wild_enum_match(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) {
505505
for pat in &arm.pats {
506506
if let PatKind::Path(ref path) = pat.deref().node {
507507
if let QPath::Resolved(_, p) = path {
508-
missing_variants.retain(|e| e.ctor_def_id != Some(p.def.def_id()));
508+
missing_variants.retain(|e| e.ctor_def_id != Some(p.res.def_id()));
509509
}
510510
} else if let PatKind::TupleStruct(ref path, ..) = pat.deref().node {
511511
if let QPath::Resolved(_, p) = path {
512-
missing_variants.retain(|e| e.ctor_def_id != Some(p.def.def_id()));
512+
missing_variants.retain(|e| e.ctor_def_id != Some(p.res.def_id()));
513513
}
514514
}
515515
}

clippy_lints/src/mem_discriminant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MemDiscriminant {
3535
if let ExprKind::Call(ref func, ref func_args) = expr.node;
3636
// is `mem::discriminant`
3737
if let ExprKind::Path(ref func_qpath) = func.node;
38-
if let Some(def_id) = cx.tables.qpath_def(func_qpath, func.hir_id).opt_def_id();
38+
if let Some(def_id) = cx.tables.qpath_res(func_qpath, func.hir_id).opt_def_id();
3939
if cx.match_def_path(def_id, &paths::MEM_DISCRIMINANT);
4040
// type is non-enum
4141
let ty_param = cx.tables.node_substs(func.hir_id).type_at(0);

clippy_lints/src/mem_forget.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MemForget {
2727
fn check_expr(&mut self, cx: &LateContext<'a, 'tcx>, e: &'tcx Expr) {
2828
if let ExprKind::Call(ref path_expr, ref args) = e.node {
2929
if let ExprKind::Path(ref qpath) = path_expr.node {
30-
if let Some(def_id) = cx.tables.qpath_def(qpath, path_expr.hir_id).opt_def_id() {
30+
if let Some(def_id) = cx.tables.qpath_res(qpath, path_expr.hir_id).opt_def_id() {
3131
if cx.match_def_path(def_id, &paths::MEM_FORGET) {
3232
let forgot_ty = cx.tables.expr_ty(&args[0]);
3333

clippy_lints/src/mem_replace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for MemReplace {
4141
if let ExprKind::Call(ref func, ref func_args) = expr.node;
4242
if func_args.len() == 2;
4343
if let ExprKind::Path(ref func_qpath) = func.node;
44-
if let Some(def_id) = cx.tables.qpath_def(func_qpath, func.hir_id).opt_def_id();
44+
if let Some(def_id) = cx.tables.qpath_res(func_qpath, func.hir_id).opt_def_id();
4545
if cx.match_def_path(def_id, &paths::MEM_REPLACE);
4646

4747
// Check that second argument is `Option::None`

clippy_lints/src/methods/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::iter;
88
use if_chain::if_chain;
99
use matches::matches;
1010
use rustc::hir;
11-
use rustc::hir::def::Def;
11+
use rustc::hir::def::{DefKind, Res};
1212
use rustc::lint::{in_external_macro, LateContext, LateLintPass, Lint, LintArray, LintContext, LintPass};
1313
use rustc::ty::{self, Predicate, Ty};
1414
use rustc::{declare_lint_pass, declare_tool_lint};
@@ -1504,7 +1504,7 @@ fn lint_cstring_as_ptr(cx: &LateContext<'_, '_>, expr: &hir::Expr, new: &hir::Ex
15041504
if let hir::ExprKind::Call(ref fun, ref args) = new.node;
15051505
if args.len() == 1;
15061506
if let hir::ExprKind::Path(ref path) = fun.node;
1507-
if let Def::Method(did) = cx.tables.qpath_def(path, fun.hir_id);
1507+
if let Res::Def(DefKind::Method, did) = cx.tables.qpath_res(path, fun.hir_id);
15081508
if cx.match_def_path(did, &paths::CSTRING_NEW);
15091509
then {
15101510
span_lint_and_then(

clippy_lints/src/methods/unnecessary_filter_map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::utils::paths;
22
use crate::utils::usage::mutated_variables;
33
use crate::utils::{match_qpath, match_trait_method, span_lint};
44
use rustc::hir;
5-
use rustc::hir::def::Def;
5+
use rustc::hir::def::Res;
66
use rustc::hir::intravisit::{walk_expr, NestedVisitorMap, Visitor};
77
use rustc::lint::LateContext;
88

@@ -66,7 +66,7 @@ fn check_expression<'a, 'tcx: 'a>(
6666
if match_qpath(path, &paths::OPTION_SOME) {
6767
if_chain! {
6868
if let hir::ExprKind::Path(path) = &args[0].node;
69-
if let Def::Local(ref local) = cx.tables.qpath_def(path, args[0].hir_id);
69+
if let Res::Local(ref local) = cx.tables.qpath_res(path, args[0].hir_id);
7070
then {
7171
if arg_id == *local {
7272
return (false, false)

0 commit comments

Comments
 (0)