about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-08-06 15:55:46 +0200
committerGitHub <noreply@github.com>2025-08-06 15:55:46 +0200
commit6afd162762c109c3ece6aa6cae2b3d038f81f699 (patch)
treecd39c05df19c5b5c736c97cf2d375322abf9defc
parent5ac085681b1f827dc70e1d6c8d8c2790c605d025 (diff)
parentb3317dd0550a7e04997eacea353d936306e5eac0 (diff)
downloadrust-6afd162762c109c3ece6aa6cae2b3d038f81f699.tar.gz
rust-6afd162762c109c3ece6aa6cae2b3d038f81f699.zip
Rollup merge of #144926 - JonathanBrouwer:fix-mustuse, r=cuviper
Correct the use of `must_use` on btree::IterMut

I'm working on stricter target checking for attributes and found this one
-rw-r--r--library/alloc/src/collections/btree/map.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/library/alloc/src/collections/btree/map.rs b/library/alloc/src/collections/btree/map.rs
index 17c16e4aaff..acbbb6df9a5 100644
--- a/library/alloc/src/collections/btree/map.rs
+++ b/library/alloc/src/collections/btree/map.rs
@@ -382,6 +382,7 @@ impl<'a, K: 'a, V: 'a> Default for Iter<'a, K, V> {
 /// documentation for more.
 ///
 /// [`iter_mut`]: BTreeMap::iter_mut
+#[must_use = "iterators are lazy and do nothing unless consumed"]
 #[stable(feature = "rust1", since = "1.0.0")]
 pub struct IterMut<'a, K: 'a, V: 'a> {
     range: LazyLeafRange<marker::ValMut<'a>, K, V>,
@@ -391,7 +392,6 @@ pub struct IterMut<'a, K: 'a, V: 'a> {
     _marker: PhantomData<&'a mut (K, V)>,
 }
 
-#[must_use = "iterators are lazy and do nothing unless consumed"]
 #[stable(feature = "collection_debug", since = "1.17.0")]
 impl<K: fmt::Debug, V: fmt::Debug> fmt::Debug for IterMut<'_, K, V> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {