Fix warnings for rust 1.87 and upgrade CI rust version#3591
Merged
stevenengler merged 5 commits intoshadow:mainfrom May 19, 2025
Merged
Fix warnings for rust 1.87 and upgrade CI rust version#3591stevenengler merged 5 commits intoshadow:mainfrom
stevenengler merged 5 commits intoshadow:mainfrom
Conversation
stevenengler
commented
May 17, 2025
Also changed a `vals.iter().all(|val| *val != compare)` to `!vals.contains(&compare)` for consistency, even though it wasn't part of the warning. ```text warning: using `contains()` instead of `iter().any()` is more efficient --> test/socket/socket/test_socket.rs:15:33 | 15 | Cond::Only(vals) => vals.iter().any(|val| *val == compare), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `vals.contains(&compare)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains = note: `#[warn(clippy::manual_contains)]` on by default ```
```text warning: replacing a value of type `T` with `T::default()` is better expressed using `std::mem::take` --> main/core/sim_stats.rs:95:31 | 95 | alloc_counts: std::mem::replace( | _______________________________^ 96 | | &mut stats.alloc_counts.lock().unwrap(), 97 | | Counter::new(), 98 | | ), | |_________________^ help: consider using: `std::mem::take(&mut stats.alloc_counts.lock().unwrap())` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default = note: `#[warn(clippy::mem_replace_with_default)]` on by default ```
```text
warning: large size difference between variants
--> main/host/process.rs:815:1
|
815 | / enum ProcessState {
816 | | Runnable(RunnableProcess),
| | ------------------------- the largest variant contains at least 360 bytes
817 | | Zombie(ZombieProcess),
| | --------------------- the second-largest variant contains at least 88 bytes
818 | | }
| |_^ the entire enum is at least 360 bytes
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
= note: `#[warn(clippy::large_enum_variant)]` on by default
help: consider boxing the large fields to reduce the total size of the enum
|
816 - Runnable(RunnableProcess),
816 + Runnable(Box<RunnableProcess>),
```
b271a51 to
e32fd4d
Compare
sporksmith
approved these changes
May 19, 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.
Fixes clippy warnings in rust 1.87, and upgrades the rust version in CI.
When running clippy with rust 1.88-beta, we get "'shadow-rs' (lib test) generated 152 warnings", so we have that to look forward to in 6 weeks :)