From e12f57293e47b7e2274f3346f26d136c7c0937d3 Mon Sep 17 00:00:00 2001 From: strmfos <155266597+strmfos@users.noreply.github.com> Date: Mon, 28 Jul 2025 13:43:37 +0200 Subject: [PATCH] fix: Use drain() instead of keys().next() + swap_remove() in auto_trait.rs --- src/librustdoc/clean/auto_trait.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/librustdoc/clean/auto_trait.rs b/src/librustdoc/clean/auto_trait.rs index a91ea55bcae68..a4eb177cdec51 100644 --- a/src/librustdoc/clean/auto_trait.rs +++ b/src/librustdoc/clean/auto_trait.rs @@ -280,8 +280,7 @@ fn clean_region_outlives_constraints<'tcx>( // `Region`s are encountered, we've computed a final constraint, and add it to our list. // Since we make sure to never re-add deleted items, this process will always finish. while !map.is_empty() { - let target = *map.keys().next().unwrap(); - let deps = map.swap_remove(&target).unwrap(); + let (target, deps) = map.drain().next().unwrap(); for smaller in &deps.smaller { for larger in &deps.larger {