about summary refs log tree commit diff
path: root/clippy_lints/src/loops/while_immutable_condition.rs
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-03-29 17:11:12 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2022-03-29 18:50:52 +0200
commite01897edcbcf89952b1823125c199a4ce8ec628d (patch)
tree45c3888db7b14e1b2044e652b15b35aa1f866eea /clippy_lints/src/loops/while_immutable_condition.rs
parenta7da8a601903eb3bd70523644dd0ce936359c13a (diff)
Remember mutability in `DefKind::Static`.
This allows to compute the `BodyOwnerKind` from `DefKind` only, and
removes a direct dependency of some MIR queries onto HIR.

As a side effect, it also simplifies metadata, since we don't need 4
flavours of `EntryKind::*Static` any more.
Diffstat (limited to 'clippy_lints/src/loops/while_immutable_condition.rs')
-rw-r--r--clippy_lints/src/loops/while_immutable_condition.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/clippy_lints/src/loops/while_immutable_condition.rs b/clippy_lints/src/loops/while_immutable_condition.rs
index 5dcfed65c78..a63422d2a36 100644
--- a/clippy_lints/src/loops/while_immutable_condition.rs
+++ b/clippy_lints/src/loops/while_immutable_condition.rs
@@ -104,7 +104,7 @@ impl<'a, 'tcx> VarCollectorVisitor<'a, 'tcx> {
                     Res::Local(hir_id) => {
                         self.ids.insert(hir_id);
                     },
-                    Res::Def(DefKind::Static, def_id) => {
+                    Res::Def(DefKind::Static(_), def_id) => {
                         let mutable = self.cx.tcx.is_mutable_static(def_id);
                         self.def_ids.insert(def_id, mutable);
                     },