From 930f1e6129e8cac05f4dd81988629a5f9d263507 Mon Sep 17 00:00:00 2001 From: Igor Matuszewski Date: Sun, 21 Apr 2019 21:00:52 +0200 Subject: [PATCH] Use newly-introduced mutability query for statics Fixes fallout from https://github.com/rust-lang/rust/pull/60124. cc https://github.com/rust-lang/rust/issues/60154 --- clippy_lints/src/loops.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clippy_lints/src/loops.rs b/clippy_lints/src/loops.rs index bf92cf5ae..a38ce24d1 100644 --- a/clippy_lints/src/loops.rs +++ b/clippy_lints/src/loops.rs @@ -2393,7 +2393,8 @@ impl<'a, 'tcx> VarCollectorVisitor<'a, 'tcx> { Def::Local(node_id) | Def::Upvar(node_id, ..) => { self.ids.insert(node_id); }, - Def::Static(def_id, mutable) => { + Def::Static(def_id) => { + let mutable = self.cx.tcx.is_mutable_static(def_id); self.def_ids.insert(def_id, mutable); }, _ => {},