mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
Rollup merge of #40790 - stepancheg:btreemap-drop, r=alexcrichton
Unnecessary iteration in BTreeMap::drop `IntoIter::drop` already iterates.
This commit is contained in:
@@ -141,8 +141,7 @@ pub struct BTreeMap<K, V> {
|
||||
unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for BTreeMap<K, V> {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
for _ in ptr::read(self).into_iter() {
|
||||
}
|
||||
drop(ptr::read(self).into_iter());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user