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
This commit is contained in:
Jakub Beránek 2025-08-06 15:55:46 +02:00 committed by GitHub
commit 6afd162762
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {