Skip to content

Commit

Permalink
bevy_gizmos: Apply `#![deny(clippy::allow_attributes, clippy::allow_a…
Browse files Browse the repository at this point in the history
…ttributes_without_reason)]` (#17281)

# Objective
- #17111

## Solution
Set the `clippy::allow_attributes` and
`clippy::allow_attributes_without_reason` lints to `deny`, and bring
`bevy_gizmos` in line with the new restrictions.

## Testing
`cargo clippy --tests --all-features --package bevy_gizmos` was run, and
no errors were encountered.
  • Loading branch information
LikeLakers2 authored Jan 10, 2025
1 parent ec795a2 commit f1dcd70
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/bevy_gizmos/src/gizmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ where
state: <GizmosState<Config, Clear> as SystemParam>::State,
}

#[allow(unsafe_code)]
#[expect(
unsafe_code,
reason = "We cannot implement SystemParam without using unsafe code."
)]
// SAFETY: All methods are delegated to existing `SystemParam` implementations
unsafe impl<Config, Clear> SystemParam for Gizmos<'_, '_, Config, Clear>
where
Expand Down Expand Up @@ -254,7 +257,10 @@ where
}
}

#[allow(unsafe_code)]
#[expect(
unsafe_code,
reason = "We cannot implement ReadOnlySystemParam without using unsafe code."
)]
// Safety: Each field is `ReadOnlySystemParam`, and Gizmos SystemParam does not mutate world
unsafe impl<'w, 's, Config, Clear> ReadOnlySystemParam for Gizmos<'w, 's, Config, Clear>
where
Expand Down
5 changes: 5 additions & 0 deletions crates/bevy_gizmos/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![deny(
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
reason = "See #17111; To be removed once all crates are in-line with these attributes"
)]
#![doc(
html_logo_url = "https://bevyengine.org/assets/icon.png",
html_favicon_url = "https://bevyengine.org/assets/icon.png"
Expand Down

0 comments on commit f1dcd70

Please sign in to comment.