From ba4190cf7e919d7cc31c366906ded41874ef0439 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Mon, 17 Mar 2025 01:34:46 +0300 Subject: resolve: Avoid some unstable iteration 2 --- compiler/rustc_resolve/src/macros.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'compiler/rustc_resolve/src/macros.rs') diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index c4304a7a6df..d577d7e8079 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -323,7 +323,6 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> { } fn check_unused_macros(&mut self) { - #[allow(rustc::potential_query_instability)] // FIXME for (_, &(node_id, ident)) in self.unused_macros.iter() { self.lint_buffer.buffer_lint( UNUSED_MACROS, @@ -576,7 +575,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { match res { Res::Def(DefKind::Macro(_), def_id) => { if let Some(def_id) = def_id.as_local() { - self.unused_macros.remove(&def_id); + self.unused_macros.swap_remove(&def_id); if self.proc_macro_stubs.contains(&def_id) { self.dcx().emit_err(errors::ProcMacroSameCrate { span: path.span, -- cgit 1.4.1-3-g733a5