Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit b205192

Browse files
committed
Change DefKind::Static to a struct variant
1 parent 6c863bc commit b205192

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

clippy_lints/src/loops/needless_range_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl<'a, 'tcx> VarVisitor<'a, 'tcx> {
273273
}
274274
return false; // no need to walk further *on the variable*
275275
},
276-
Res::Def(DefKind::Static(_) | DefKind::Const, ..) => {
276+
Res::Def(DefKind::Static{..} | DefKind::Const, ..) => {
277277
if index_used_directly {
278278
self.indexed_directly.insert(
279279
seqvar.segments[0].ident.name,

clippy_lints/src/loops/while_immutable_condition.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl<'a, 'tcx> VarCollectorVisitor<'a, 'tcx> {
101101
Res::Local(hir_id) => {
102102
self.ids.insert(hir_id);
103103
},
104-
Res::Def(DefKind::Static(_), def_id) => {
104+
Res::Def(DefKind::Static{..}, def_id) => {
105105
let mutable = self.cx.tcx.is_mutable_static(def_id);
106106
self.def_ids.insert(def_id, mutable);
107107
},

clippy_lints/src/methods/expect_fun_call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub(super) fn check<'tcx>(
9191
},
9292
hir::ExprKind::Path(ref p) => matches!(
9393
cx.qpath_res(p, arg.hir_id),
94-
hir::def::Res::Def(hir::def::DefKind::Const | hir::def::DefKind::Static(_), _)
94+
hir::def::Res::Def(hir::def::DefKind::Const | hir::def::DefKind::Static{..}, _)
9595
),
9696
_ => false,
9797
}

clippy_lints/src/multiple_unsafe_ops_per_block.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ fn collect_unsafe_exprs<'tcx>(
109109
ExprKind::Path(QPath::Resolved(
110110
_,
111111
hir::Path {
112-
res: Res::Def(DefKind::Static(Mutability::Mut), _),
112+
res: Res::Def(DefKind::Static{mt:Mutability::Mut}, _),
113113
..
114114
},
115115
)) => {
@@ -149,7 +149,7 @@ fn collect_unsafe_exprs<'tcx>(
149149
ExprKind::Path(QPath::Resolved(
150150
_,
151151
hir::Path {
152-
res: Res::Def(DefKind::Static(Mutability::Mut), _),
152+
res: Res::Def(DefKind::Static{mt:Mutability::Mut}, _),
153153
..
154154
}
155155
))

0 commit comments

Comments
 (0)