remove unsound DerefMut impls from EntityHashMap
/EntityHashSet
(#17450)
# Objective Noticed while doing #17449, I had left these `DerefMut` impls in. Obtaining mutable references to those inner iterator types allows for `mem::swap`, which can be used to swap an incorrectly behaving instance into the wrappers. ## Solution Remove them!
This commit is contained in:
parent
5a9bc28502
commit
59657ed1e2
@ -169,12 +169,6 @@ impl<'a, V> Deref for Keys<'a, V> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<V> DerefMut for Keys<'_, V> {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, V> Iterator for Keys<'a, V> {
|
||||
type Item = &'a Entity;
|
||||
|
||||
@ -233,12 +227,6 @@ impl<V> Deref for IntoKeys<V> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<V> DerefMut for IntoKeys<V> {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<V> Iterator for IntoKeys<V> {
|
||||
type Item = Entity;
|
||||
|
||||
|
@ -217,12 +217,6 @@ impl<'a> Deref for Iter<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl DerefMut for Iter<'_> {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Iterator for Iter<'a> {
|
||||
type Item = &'a Entity;
|
||||
|
||||
@ -278,12 +272,6 @@ impl Deref for IntoIter {
|
||||
}
|
||||
}
|
||||
|
||||
impl DerefMut for IntoIter {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl Iterator for IntoIter {
|
||||
type Item = Entity;
|
||||
|
||||
@ -336,12 +324,6 @@ impl<'a> Deref for Drain<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl DerefMut for Drain<'_> {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Iterator for Drain<'a> {
|
||||
type Item = Entity;
|
||||
|
||||
@ -391,12 +373,6 @@ impl<'a, F: FnMut(&Entity) -> bool> Deref for ExtractIf<'a, F> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<F: FnMut(&Entity) -> bool> DerefMut for ExtractIf<'_, F> {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, F: FnMut(&Entity) -> bool> Iterator for ExtractIf<'a, F> {
|
||||
type Item = Entity;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user