Fix unsoundness in Query::for_each_mut (#2045)
This commit is contained in:
parent
85ab55a05b
commit
dbf519c1d7
@ -206,7 +206,7 @@ where
|
|||||||
/// Runs `f` on each query result. This is faster than the equivalent iter() method, but cannot
|
/// Runs `f` on each query result. This is faster than the equivalent iter() method, but cannot
|
||||||
/// be chained like a normal [`Iterator`].
|
/// be chained like a normal [`Iterator`].
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn for_each_mut(&self, f: impl FnMut(<Q::Fetch as Fetch<'w>>::Item)) {
|
pub fn for_each_mut(&mut self, f: impl FnMut(<Q::Fetch as Fetch<'w>>::Item)) {
|
||||||
// SAFE: system runs without conflicts with other systems. same-system queries have runtime
|
// SAFE: system runs without conflicts with other systems. same-system queries have runtime
|
||||||
// borrow checks when they conflict
|
// borrow checks when they conflict
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user