Skip to content

Commit de6bef7

Browse files
Fix for bevy CI on main - clippy safety comments on trait. (#5665)
# Objective Make CI pass on bevy main. Update to rust-1.63, updated clippy to 1.63 which introduced the following enhancements: - [undocumented_unsafe_blocks](https://rust-lang.github.io/rust-clippy/master/index.html#undocumented_unsafe_blocks): Now also lints on unsafe trait implementations This caught two incorrectly written ( but existing) safety comments for unsafe traits. ## Solution Fix the comment to use `SAFETY:`
1 parent 5595733 commit de6bef7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/bevy_ecs/src/system/system_param.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ impl<'w, 's> SystemParamFetch<'w, 's> for WorldState {
675675
/// ```
676676
pub struct Local<'a, T: FromWorld + Send + Sync + 'static>(&'a mut T);
677677

678-
// SAFE: Local only accesses internal state
678+
// SAFETY: Local only accesses internal state
679679
unsafe impl<T: Send + Sync + 'static> ReadOnlySystemParamFetch for LocalState<T> {}
680680

681681
impl<'a, T: FromWorld + Send + Sync + 'static> Debug for Local<'a, T>
@@ -711,7 +711,7 @@ impl<'a, T: Send + Sync + 'static + FromWorld> SystemParam for Local<'a, T> {
711711
type Fetch = LocalState<T>;
712712
}
713713

714-
// SAFE: only local state is accessed
714+
// SAFETY: only local state is accessed
715715
unsafe impl<T: FromWorld + Send + Sync + 'static> SystemParamState for LocalState<T> {
716716
fn init(world: &mut World, _system_meta: &mut SystemMeta) -> Self {
717717
Self(T::from_world(world))

0 commit comments

Comments
 (0)