Skip to content

Commit e43eddc

Browse files
committed
Make it compile
1 parent 20c07ce commit e43eddc

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

clippy_lints/src/loops.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
17741774
}
17751775
let res = self.cx.tables.qpath_res(seqpath, seqexpr.hir_id);
17761776
match res {
1777-
Res::Local(hir_id) | Res::Def(Res::Upvar(..), hir_id, ..) => {
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);
@@ -1835,7 +1835,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarVisitor<'a, 'tcx> {
18351835
if path.segments.len() == 1;
18361836
then {
18371837
match self.cx.tables.qpath_res(qpath, expr.hir_id) {
1838-
Res::Def(Res::Upvar(..), local_id, ..) => {
1838+
Res::Upvar(local_id, ..) => {
18391839
if local_id == self.var {
18401840
// we are not indexing anything, record that
18411841
self.nonindex = true;
@@ -2383,7 +2383,7 @@ impl<'a, 'tcx> VarCollectorVisitor<'a, 'tcx> {
23832383
let res = self.cx.tables.qpath_res(qpath, ex.hir_id);
23842384
then {
23852385
match res {
2386-
Res::Local(node_id) | Res::Def(Res::Upvar(..), node_id, ..) => {
2386+
Res::Local(node_id) | Res::Upvar(node_id, ..) => {
23872387
self.ids.insert(node_id);
23882388
},
23892389
Res::Def(DefKind::Static, def_id) => {

clippy_lints/src/misc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ fn in_attributes_expansion(expr: &Expr) -> bool {
603603
/// Tests whether `res` is a variable defined outside a macro.
604604
fn non_macro_local(cx: &LateContext<'_, '_>, res: def::Res) -> bool {
605605
match res {
606-
def::Res::Local(id) | def::Res(Res::Upvar(..), id, _, _) => !in_macro(cx.tcx.hir().span_by_hir_id(id)),
606+
def::Res::Local(id) | def::Res::Upvar(id, ..) => !in_macro(cx.tcx.hir().span_by_hir_id(id)),
607607
_ => false,
608608
}
609609
}

clippy_lints/src/question_mark.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl QuestionMark {
117117
},
118118
ExprKind::Ret(Some(ref expr)) => Self::expression_returns_none(cx, expr),
119119
ExprKind::Path(ref qp) => {
120-
if let Res::Def(DefKind::Ctor(_, def::CtorOf::Variant), def_id) = cx.tables.qpath_res(qp, expression.hir_id) {
120+
if let Res::Def(DefKind::Ctor(def::CtorOf::Variant, def::CtorKind::Const), def_id) = cx.tables.qpath_res(qp, expression.hir_id) {
121121
return cx.match_def_path(def_id, &OPTION_NONE);
122122
}
123123

clippy_lints/src/use_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ impl<'a, 'tcx> Visitor<'tcx> for UseSelfVisitor<'a, 'tcx> {
223223
if path.segments.last().expect(SEGMENTS_MSG).ident.name != SelfUpper.name() {
224224
if self.item_path.res == path.res {
225225
span_use_self_lint(self.cx, path);
226-
} else if let Res::Def(DefKind::Ctor(def::CtorOf::Struct, ctor_did), CtorKind::Fn) = path.res {
226+
} else if let Res::Def(DefKind::Ctor(def::CtorOf::Struct, CtorKind::Fn), ctor_did) = path.res {
227227
if self.item_path.res.opt_def_id() == self.cx.tcx.parent(ctor_did) {
228228
span_use_self_lint(self.cx, path);
229229
}

clippy_lints/src/utils/usage.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub fn is_potentially_mutated<'a, 'tcx: 'a>(
3030
cx: &'a LateContext<'a, 'tcx>,
3131
) -> bool {
3232
let id = match variable.res {
33-
Res::Local(id) | Res::Def(Res::Upvar(..), id, ..) => id,
33+
Res::Local(id) | Res::Upvar(id, ..) => id,
3434
_ => return true,
3535
};
3636
mutated_variables(expr, cx).map_or(true, |mutated| mutated.contains(&id))

0 commit comments

Comments
 (0)