Skip to content

Commit 6f3909c

Browse files
committed
remove unsafe blocker from bevy_pbr
1 parent 9c826d8 commit 6f3909c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

crates/bevy_pbr/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// FIXME(3492): remove once docs are ready
22
#![allow(missing_docs)]
33
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
4-
#![forbid(unsafe_code)]
54
#![doc(
65
html_logo_url = "https://bevyengine.org/assets/icon.png",
76
html_favicon_url = "https://bevyengine.org/assets/icon.png"

crates/bevy_pbr/src/light/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1028,9 +1028,11 @@ impl PointLightAssignmentData {
10281028

10291029
// SAFETY: `PointLightAssignmentData` is only used in `assign_lights_to_clusters`, where it is not reused
10301030
// between system calls.
1031+
#[allow(unsafe_code)]
10311032
unsafe impl Send for PointLightAssignmentData {}
10321033
// SAFETY: `PointLightAssignmentData` is only used in `assign_lights_to_clusters`, where it is not reused
10331034
// between system calls.
1035+
#[allow(unsafe_code)]
10341036
unsafe impl Sync for PointLightAssignmentData {}
10351037

10361038
#[derive(Resource, Default)]
@@ -1428,6 +1430,7 @@ pub(crate) fn assign_lights_to_clusters(
14281430
// check if the light groups overlap the view groups
14291431
// SAFETY: `lights` is cleared at the start of this system call, and is populated from
14301432
// immutable queries.
1433+
#[allow(unsafe_code)]
14311434
let light_renderlayers = unsafe { light.render_layers.get() };
14321435
if !view_layer.intersects(light_renderlayers) {
14331436
continue;
@@ -2152,6 +2155,7 @@ fn derive_render_layers_ptr_for_light(
21522155
) -> RenderLayersPtr {
21532156
let render_layers = derive_render_layers_ptr(maybe_inherited, maybe_layers);
21542157
// SAFETY: The pointer points to references within the lifetime of this function.
2158+
#[allow(unsafe_code)]
21552159
let len = unsafe { render_layers.get().len() };
21562160
if len > 1 {
21572161
warn_once!(

crates/bevy_ui/src/render/render_pass.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::ops::Range;
22

33
use super::{UiBatch, UiImageBindGroups, UiMeta};
4-
use crate::DefaultCameraLayer;
4+
use crate::DefaultCameraView;
55
use bevy_ecs::{
66
prelude::*,
77
system::{lifetimeless::*, SystemParamItem},
@@ -26,7 +26,7 @@ pub struct UiPassNode {
2626
),
2727
With<ExtractedView>,
2828
>,
29-
default_camera_view_query: QueryState<&'static DefaultCameraLayer>,
29+
default_camera_view_query: QueryState<&'static DefaultCameraView>,
3030
}
3131

3232
impl UiPassNode {

0 commit comments

Comments
 (0)