-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable clippy::check-private-items
so that missing_safety_doc
will apply to private functions as well
#15161
Conversation
…e unsafe is due to the function signature of `RawWakerVTable::new` as it requires `unsafe fn`
- `Bundles::get_storage_unchecked`: Based on the function that writes to `dynamic_component_storages` - `Bundles::get_storages_unchecked`: Based on the function that writes to `dynamic_bundle_storages` - `QueryIterationCursor::init_empty`: Duplicated from `init` - `QueryIterationCursor::peek_last`: Thanks Giooschi (also added internal unsafe blocks) - `tests::drop_ptr`: Moved safety comment out to the doc string
…etadata like `components`, `removed_components`, `bundles` etc.
It looks like your PR is a breaking change, but you didn't provide a migration guide. Could you add some context on what users should update when this change get released in a new version of Bevy? |
I don't believe this is a breaking change? The only signature change was |
…ed for safety comments
@13ros27 Sorry for the delay on reviewing this; please ping me once merge conflicts are resolved and I'll merge this in. |
No worries, merge conflicts resolved and I've added safety comments to |
Enabled
check-private-items
inclippy.toml
and then fixed the resulting errors. Most of these were simply misformatted and of the remaining:AddedRemoved unsafe from a pair of functions in#[allow(clippy::missing_safety_doc)]
tobevy_utils/futures
which are only unsafe so that they can be passed to a function which requiresunsafe fn
unsafe
fromUnsafeWorldCell::observers
as from what I can tell it is always safe likecomponents
,bundles
etc. (this should be checked)Bundles::get_storage_unchecked
: Based on the function that writes todynamic_component_storages
Bundles::get_storages_unchecked
: Based on the function that writes todynamic_bundle_storages
QueryIterationCursor::init_empty
: Duplicated frominit
QueryIterationCursor::peek_last
: Thanks Giooschi (also added internal unsafe blocks)tests::drop_ptr
: Moved safety comment out to the doc stringThis lint would also apply to
missing_errors_doc
,missing_panics_doc
andunnecessary_safety_doc
if we chose to enable any of those at some point, although there is an open issue to separate these options.