Fix rust/clippy warnings in rust 1.89.0#3653
Merged
stevenengler merged 6 commits intoshadow:mainfrom Sep 9, 2025
Merged
Conversation
```text
warning: hiding a lifetime that's elided elsewhere is confusing
--> lib/vasi-sync/src/atomic_tls_map.rs:135:23
|
135 | pub unsafe fn get(&self, key: NonZeroUsize) -> Option<Ref<V>> {
| ^^^^^ the lifetime is elided here ------ the same lifetime is hidden here
|
= help: the same lifetime is referred to in inconsistent ways, making the signature confusing
= note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
|
135 | pub unsafe fn get(&self, key: NonZeroUsize) -> Option<Ref<'_, V>> {
| +++
```
Also ran `cargo fmt`.
```text
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
--> lib/linux-api/src/bindings.rs:4238:5
|
4236 | #[derive(Debug, Copy, Clone, PartialEq, Eq)]
| --------- in this derive macro expansion
4237 | pub struct linux_sigaction {
4238 | pub lsa_handler: linux___sighandler_t,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the address of the same function can vary between different codegen units
= note: furthermore, different functions could have the same address after being merged together
= note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
= note: `#[warn(unpredictable_function_pointer_comparisons)]` on by default
```
```text
warning: this `if` statement can be collapsed
--> main/utility/byte_queue.rs:145:9
|
145 | / if let Some(ref unused_buffer) = self.unused_buffer {
146 | | if unused_buffer.is_empty() {
147 | | self.unused_buffer = None;
148 | | }
149 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if
= note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
|
145 ~ if let Some(ref unused_buffer) = self.unused_buffer
146 ~ && unused_buffer.is_empty() {
147 | self.unused_buffer = None;
148 ~ }
```
Contributor
Author
|
I changed this MR to not update the rust version in the CI, so we're no longer blocked. |
232b030 to
c135dc9
Compare
sporksmith
approved these changes
Sep 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Another rust release, another painful collection of warnings to fix. Might be easier to review with
git diff -w(edit: it looks like this is available in the github view as well).This also upgrades the bindgen version used in linux-api bindings.
Edit: This was originally an MR to fix the warnings and update our CI to use rust 1.89.0. But we can't update to 1.89.0 due to #3654. So this MR now just fixes the warnings without updating the CI.