Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions crates/bevy_ecs/src/bundle/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![expect(
unsafe_op_in_unsafe_fn,
reason = "See #11590. To be removed once all applicable unsafe code has an unsafe block with a safety comment."
)]

//! Types for handling [`Bundle`]s.
//!
//! This module contains the [`Bundle`] trait and some other helper types.
Expand Down
5 changes: 5 additions & 0 deletions crates/bevy_ecs/src/entity/clone_entities.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![expect(
unsafe_op_in_unsafe_fn,
reason = "See #11590. To be removed once all applicable unsafe code has an unsafe block with a safety comment."
)]

use crate::{
archetype::Archetype,
bundle::{Bundle, BundleRemover, InsertMode},
Expand Down
4 changes: 0 additions & 4 deletions crates/bevy_ecs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#![expect(
unsafe_op_in_unsafe_fn,
reason = "See #11590. To be removed once all applicable unsafe code has an unsafe block with a safety comment."
)]
#![doc = include_str!("../README.md")]
#![cfg_attr(
any(docsrs, docsrs_dep),
Expand Down
5 changes: 5 additions & 0 deletions crates/bevy_ecs/src/query/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![expect(
unsafe_op_in_unsafe_fn,
reason = "See #11590. To be removed once all applicable unsafe code has an unsafe block with a safety comment."
)]

//! Contains APIs for retrieving component data from the world.
mod access;
Expand Down
21 changes: 15 additions & 6 deletions crates/bevy_ecs/src/schedule/executor/multi_threaded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,12 +448,21 @@ impl ExecutorState {
}

#[cfg(feature = "hotpatching")]
let hotpatch_tick = context
.environment
.world_cell
.get_resource_ref::<HotPatchChanges>()
.map(|r| r.last_changed())
.unwrap_or_default();
#[expect(
clippy::undocumented_unsafe_blocks,
reason = "This actually could result in UB if a system tries to mutate
`HotPatchChanges`. We allow this as the resource only exists with the `hotpatching` feature.
and `hotpatching` should never be enabled in release."
)]
#[cfg(feature = "hotpatching")]
let hotpatch_tick = unsafe {
context
.environment
.world_cell
.get_resource_ref::<HotPatchChanges>()
}
.map(|r| r.last_changed())
.unwrap_or_default();

// can't borrow since loop mutably borrows `self`
let mut ready_systems = core::mem::take(&mut self.ready_systems_copy);
Expand Down
5 changes: 5 additions & 0 deletions crates/bevy_ecs/src/storage/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![expect(
unsafe_op_in_unsafe_fn,
reason = "See #11590. To be removed once all applicable unsafe code has an unsafe block with a safety comment."
)]

//! Storage layouts for ECS data.
//!
//! This module implements the low-level collections that store data in a [`World`]. These all offer minimal and often
Expand Down
2 changes: 0 additions & 2 deletions crates/bevy_ecs/src/system/combinator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ where
input: SystemIn<S>,
world: &mut PrivateUnsafeWorldCell,
) -> Result<S::Out, RunSystemError> {
#![deny(unsafe_op_in_unsafe_fn)]

// SAFETY: see comment on `Func::combine` call
match (|| unsafe {
system.validate_param_unsafe(world.0)?;
Expand Down
5 changes: 5 additions & 0 deletions crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![expect(
unsafe_op_in_unsafe_fn,
reason = "See #11590. To be removed once all applicable unsafe code has an unsafe block with a safety comment."
)]

pub use crate::change_detection::{NonSend, NonSendMut, Res, ResMut};
use crate::{
archetype::Archetypes,
Expand Down
5 changes: 5 additions & 0 deletions crates/bevy_ecs/src/world/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#![expect(
unsafe_op_in_unsafe_fn,
reason = "See #11590. To be removed once all applicable unsafe code has an unsafe block with a safety comment."
)]

//! Defines the [`World`] and APIs for accessing it directly.

pub(crate) mod command_queue;
Expand Down