Swap most uses of allow in lints to expect
What problem does this solve or what need does it fill?
With the advent of Rust 1.81, we can now distinguish between lints that we haven't gotten around to fixing and those where the lint is wrong.
What solution would you like?
Most localized lints in Bevy should be expect: the only exception that comes to mind is missing_docs.
Leave the Cargo.toml lints set as allow, as funny as it would be to set a crate-level expect(type_complexity).
I'd also like to turn on the new allow_attributes_without_reason lint as part of this.
I'll take a stab at this!
If someone wants to work on this, I got a lot of progress done in #15118. Feel free to adopt it and follow my advice here for finishing it.
My suggestion for those tackling this is to handle this one crate at a time: that will ensure it's easier to complete and review smaller bits of work.
Copying BD103's instructions/workflow for ease of reference. Also note that crate-level expect/missing_docs should be fixed in an upcoming Rust version.
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:
- Run
cargo clippy --workspace --message-format=shortcdinto the first crate that raises warnings.- Run
cargo watch -c -x clippyuntil warnings stop appearing.- Run
cargo clippy --no-default-featuresandcargo clippy --all-featuresfor good measure.- Repeat step 1 until there are no more warning.
(Note that the current bug doesn't surface until --all-targets is specified, so usually worth adding that to the workflow. See #15321.)
Keeping a list here for my own reference: these were not covered by the previous PR.
- [x] bevy_core_pipeline has crate-level
allow, needs crate-levelexpectlater - [x] bevy_dev_tools no warnings, already looks pretty covered
- [x] bevy_dylib already covered
- [x] bevy_gilrs already covered
- [x] bevy_gizmos none found
- [ ] bevy_gltf
- [x] bevy_input no warnings, looks pretty well-covered
- [ ] bevy_internal
- [ ] bevy_pbr
- [ ] bevy_picking
- [ ] bevy_render
- [ ] bevy_sprite
- [ ] bevy_state
- [ ] bevy_text
- [ ] bevy_ui
- [ ] bevy_window
- [ ] bevy_winit
Just tracking things for myself... it looks like stable Rust 1.83 is 62 days away, so I have a reminder to revisit this end of November when we can rely on missing_docs working as expected.
Looking into this again...
@bas-ie, are we fully done with this at this point?
I don't think so. I haven't looked specifically lately, but I think we just got the instances that were in BD's original PR and a few extras. I'll go hunting for more 👀