You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Objective
- Trying to doc most of the unsafe in the ecs crate so we can turn on
`unsafe_op_in_unsafe_fn`.
## Solution
- Unfortunately reviewing the unsafe docs will probably not be trivial
if we try to do it all in one pr. There are 400+ warnings when you turn
on the lint. So we need to break it up as much as possible as reviewing
the safety contracts in some cases isn't the easiest.
- This pr includes two types of unsafe blocks.
1. Blocks that already had safety comments, but were missing the `unsafe
{}` block.
2. Unsafe functions that have the same safety contract as their unsafe
parent function and are very short. (Usually just the call to the
function).
Copy file name to clipboardExpand all lines: crates/bevy_ecs/src/bundle/impls.rs
+14-2Lines changed: 14 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -138,8 +138,14 @@ macro_rules! tuple_impl {
138
138
bevy_ptr::deconstruct_moving_ptr!({
139
139
let tuple { $($index: $alias,)*} = ptr;
140
140
});
141
+
#[allow(
142
+
unused_unsafe,
143
+
reason = "Zero-length tuples will generate a function body equivalatent to (); however, this macro is meant for all applicable tuples, and as such it makes no sense to rewrite it just for that case."
144
+
)]
141
145
// SAFETY: Caller ensures requirements for calling `get_components` are met.
reason = "Zero-length tuples will generate a function body equivalent to `()`; however, this macro is meant for all applicable tuples, and as such it makes no sense to rewrite it just for that case."
163
+
)]
154
164
// SAFETY: Caller ensures requirements for calling `apply_effect` are met.
0 commit comments