-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Migrate #[allow(...)]
to #[expect(...)]
#15118
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
Conversation
Fixes a warning that was raised!
pub attrs: FieldAttributes, | ||
/// The index of this variant within the enum. | ||
#[allow(dead_code)] | ||
#[expect(dead_code, reason = "TODO(MrGVSV): Why should this be kept?")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It probably doesn't need to be kept anymore 😅
@@ -922,8 +920,7 @@ pub(crate) enum ReflectTypePath<'a> { | |||
generics: &'a Generics, | |||
}, | |||
/// Any [`Type`] with only a defined `type_path` and `short_type_path`. | |||
#[allow(dead_code)] | |||
// Not currently used but may be useful in the future due to its generality. | |||
#[expect(dead_code, reason = "Not current used but may be useful in the future due to its generality.")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[expect(dead_code, reason = "Not current used but may be useful in the future due to its generality.")] | |
#[expect(dead_code, reason = "Not currently used but may be useful in the future due to its generality.")] |
d7f134a
to
59a0b28
Compare
Co-authored-by: Ben Frankel <[email protected]>
Expands on 2a947d7.
I'm going to put this PR up for adoption. I no longer have the energy to work on it, and there are still a lot of crates left. If you want to adopt this, my workflow looked like this:
|
# Objective > Rust 1.81 released the #[expect(...)] attribute, which works like #[allow(...)] but throws a warning if the lint isn't raised. This is preferred to #[allow(...)] because it tells us when it can be removed. - Adopts the parts of #15118 that are complete, and updates the branch so it can be merged. - There were a few conflicts, let me know if I misjudged any of 'em. Alice's [recommendation](#15059 (comment)) seems well-taken, let's do this crate by crate now that @BD103 has done the lion's share of this! (Relates to, but doesn't yet completely finish #15059.) Crates this _doesn't_ cover: - bevy_input - bevy_gilrs - bevy_window - bevy_winit - bevy_state - bevy_render - bevy_picking - bevy_core_pipeline - bevy_sprite - bevy_text - bevy_pbr - bevy_ui - bevy_gltf - bevy_gizmos - bevy_dev_tools - bevy_internal - bevy_dylib --------- Co-authored-by: BD103 <[email protected]> Co-authored-by: Ben Frankel <[email protected]> Co-authored-by: Antony <[email protected]>
Objective
#[expect(...)]
attribute, which works like#[allow(...)]
but throws a warning if the lint isn't raised. This is preferred to#[allow(...)]
because it tells us when it can be removed.Solution
Switch all applicable
#[allow(...)]
attributes to#[expect(...)]
with a reason attribute.Progress
bevy_ptr
bevy_utils
bevy_reflect
bevy_tasks
bevy_ecs
bevy_derive
bevy_app
bevy_reflect_derive
bevy_asset_macros
bevy_encase_derive
bevy_render_macros
bevy_state_macros
bevy_log
bevy_time
bevy_diagnostic
bevy_transform
bevy_asset
bevy_input
bevy_gilrs
bevy_window
bevy_winit
bevy_state
bevy_render
bevy_picking
bevy_core_pipeline
bevy_sprite
bevy_text
bevy_pbr
bevy_ui
bevy_gltf
bevy_gizmos
bevy_dev_tools
bevy_internal
bevy_dylib
Testing
cargo clippy --workspace --all-features