Skip to content

Bump rust to 1.97.1 - #1186

Open
papertigers wants to merge 3 commits into
masterfrom
spr/papertigers/bump-rust-to-1971
Open

Bump rust to 1.97.1#1186
papertigers wants to merge 3 commits into
masterfrom
spr/papertigers/bump-rust-to-1971

Conversation

@papertigers

@papertigers papertigers commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Bump rust-toolchain.toml to Rust version 1.97.1, and bump the MSRV to 1.93 so that we can drop the VecDequeExt trait which shamelessly copied the pop_front_if method from the rust standard library.

@papertigers
papertigers requested a review from iximeow July 28, 2026 19:51
Comment thread lib/propolis/Cargo.toml
license = "MPL-2.0"
edition = "2021"
rust-version = "1.90"
rust-version = "1.93"

@papertigers papertigers Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this we get the following at the pop_front_if call site

warning: current MSRV (Minimum Supported Rust Version) is `1.90.0` but this item is stable since `1.93.0`

@iximeow iximeow left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks

.. though clippy has more words for phd, apparently

match state {
State::Run if first_boot => {
tokio::runtime::Handle::current().block_on(async {
for (_name, be) in guard.inventory.block.iter() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now that's a good lint

false => ChainBuf::Readable(GuestAddr(desc.addr), desc.len),
};

count += 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems wrong, or at least an existing bug, where count == self.size() isn't considered past this point?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is an existing bug, yeah

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we fix it here or in a PR stacked on top of this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "fix" is here #1188, however we really need to go do #1190 to address all of the issues in this code path.

}
(ty, subtype) => {
bail!(
"Device path type/subtype unsupported: ({ty:#02x}/{subtype:#02x})"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm surprised by this one, does :#02x not format as 0x and "ty" as two hex digits padded with 0?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was actually curious about this one as well, because the output was not what I expected.

This is a rust 1.97 lint I believe and didn't trigger on macOS with 1.96

sherma scratch
❯ cat src/main.rs
fn main() {
    let ty = 4u8;
    println!("{:#x}", ty);
    println!("{:#0x}", ty);
    println!("{:#02x}", ty);
    println!("{:#04x}", ty);
}

sherma scratch
❯ cargo clippy
    Checking scratch v0.1.0 (/Users/link/src/scratch)
warning: format width has no effect on the output for this format trait
 --> src/main.rs:5:15
  |
5 |     println!("{:#02x}", ty);
  |               ^^^^^^^
  |
  = help: consider removing the width or increasing it to at least 4
  = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.97.0/index.html#unused_format_specs
  = note: `#[warn(clippy::unused_format_specs)]` on by default

warning: `scratch` (bin "scratch") generated 1 warning
    Finished [`dev` profile [unoptimized + debuginfo]](https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles) target(s) in 0.04s

sherma scratch
❯ cargo r
    Finished [`dev` profile [unoptimized + debuginfo]](https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles) target(s) in 0.03s
     Running `target/debug/scratch`
0x4
0x4
0x4
0x04

When used together with the # flag, a similar rule applies: padding zeros are inserted after the prefix but before the digits. The prefix is included in the total width.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this preserves the old behavior but we could change it if you want.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i've written so many buggy format statements then. lmao. either way you want to take this here is fine imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants