Skip to content

Update the repo toolchain to Rust 1.99.1 [Rebase & FF] - #1869

Merged
makubacki merged 9 commits into
OpenDevicePartnership:mainfrom
makubacki:rust_1_99
Oct 16, 2026
Merged

makubacki merged 9 commits into
OpenDevicePartnership:mainfrom
makubacki:rust_1_99

Conversation

@makubacki

@makubacki makubacki commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Updates the repo to Rust 1.99.1 from Rust 1.95. Does not change the Rust 1.90.0 MSRV.

https://releases.rs/docs/1.99.0/

Resolves #1797


Keep the 1.90 MSRV building with 1.99 API changes


Use as_chunks instead of chunks_exact

The chunks_exact_to_as_chunks clippy lint in Rust 1.99 flags
chunks_exact(N) when called with a compile-time constant size.

as_chunks has been stable since 1.88, so it is fine for the current
MSRV of Rust 1.90.0.

See: https://doc.rust-lang.org/1.99.0/core/primitive.slice.html#method.as_chunks


Fix the other new 1.99 clippy lints

Resolves new clippy lint issues after updating to Rust 1.99.

Lints involved:

  • clone_on_copy
  • uninlined_format_args
  • useless_borrows_in_formatting
  • byte_char_slices
  • drain_collect
  • question_mark

Allow the redundant_field_names lint

The Pread/Pwrite derives currently output field: field
initializers that are flagged in clippy with Rust 1.99.

To prevent every site having to allow this lint individually, it is
allowed globally with a note that it can be disallowed again if the
derive code in the scroll crate is updated.


Switch tests to assert_eq and allow assert_is_empty

Rust 1.97.0 added the manual_assert_eq lint to the pedantic group.

https://rust-lang.github.io/rust-clippy/master/index.html?groups=pedantic

This updates the code to pass this lint (pedantic is enabled).

Purpose:

Checks for assert! and debug_assert! usage that consist of only an
(in)equality check.

Why it's bad:

assert_{eq,ne}! and debug_assert_{eq,ne}! achieve the same goal
and provide some additional debug information.

Note: The char8/char16 test modules keep == and != on purpose
since they test the PartialEq impls.

Also, assert_is_empty is allowed workspace-wide because its suggested
form is harder to read.


Fix unused footnote in close_event docs

rustdoc in 1.99 produces an error on a footnote definition with no
reference, so make it a plain note.


Rust 1.90.0 clippy updates

These were found when running cargo clippy with Rust 1.90.0
(the current MSRV). A warning remains for clippy::assert_is_empty
being an unknown lint. Errors and actual issues were addressed.


docs: Ignore incomplete documentation snippets

After updating to Rust 1.99.0, these documentation blocks are failing
to compile with error: expected item after doc comment errors.

Since they're incomplete code examples that are still helpful for
demonstration purposes, this marks them to be ignored.


Bump the toolchain to Rust 1.99.1

Updates the examples in docs/src/dev/rust_version_update_process.md
so they are easier to understand by reflecting the current toolchain
being used.


  • Impacts functionality?
  • Impacts security?
  • Breaking change?
  • Includes tests?
  • Includes documentation?

How This Was Tested

  • cargo make all (with Rust 1.99.1)
  • MSRV check at Rust 1.90.0

Integration Instructions

  • While Rust 1.90.0 is still supported, Rust 1.99.1 can be used now.

@makubacki makubacki self-assigned this Oct 12, 2026
@patina-automation

patina-automation Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ QEMU Validation Passed

All QEMU validation jobs completed successfully.

Note: Q35 is only built on Windows hosts (QEMU boot is disabled due to a QEMU vfat issue).

Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/38313328431

Boot Time to EFI Shell

Platform Elapsed
ArmVirt (Linux Host) 22.4s
Q35 (Linux Host) 29.1s

Dependencies

Repository Ref
patina 50cb5d7
patina-dxe-core-qemu 93ef089
patina-fw-patcher a450500
patina-qemu firmware v4.1.2
patina-qemu build script f170bda

This comment was automatically generated by the Patina QEMU PR Validation Post workflow.

@github-actions github-actions Bot added the type:documentation Improvements or additions to documentation label Oct 12, 2026
@makubacki

Copy link
Copy Markdown
Collaborator Author

Note: Slightly related to this, I'm going to file a tracking issue for updating the MSRV to 1.95.0 sometime in the near future as a 1.95.0 to 1.99.0 window still provides a bit of room and allows picking up some useful new features without backward compat.

@makubacki

Copy link
Copy Markdown
Collaborator Author

I will push an update for mdbook soon.

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.60759% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
patina_dxe_core/src/protocols.rs 42.86% 4 Missing ⚠️
sdk/patina_ffs/src/volume.rs 80.00% 4 Missing ⚠️
core/patina_internal_cpu/src/mp/x64.rs 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@os-d os-d left a comment

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.

I see you said you'd file an issue for updating the MSRV, I do think we should have a tracking issue for the items we have some odd staging for in order to handle the MSRV so that we don't forget to undo it later, e.g. tracking the va_arg! macro to remove after the MSRV is 1.99.

@makubacki

Copy link
Copy Markdown
Collaborator Author

Yeah, I'll file an issue for each of those. 1.95.0 was released in April 2026 so I'm not sure it makes sense to go there quite yet, but I'll file an issue for each of the items waiting on something.

@makubacki

Copy link
Copy Markdown
Collaborator Author

I will push an update for mdbook soon.

Pushed

@makubacki

Copy link
Copy Markdown
Collaborator Author

I'll file an issue for each of those...

Done

@makubacki makubacki mentioned this pull request Oct 12, 2026
4 of 5 tasks
vineelkovvuri
vineelkovvuri approved these changes Oct 14, 2026 •

@vineelko vineelko left a comment

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.

idt_page.as_chunks_mut::<{ core::mem::size_of::<IdtEntry>() }>()

Passing const value like this(in blocks) is new to me.

Apparently even below seems to be working(not related to the code change) as long as it can be compile time evaluated.

idt_page.as_chunks_mut::<{ let x = 10; x + core::mem::size_of::<IdtEntry>() }>()

but not this :-)

idt_page.as_chunks_mut::<{ let x = 10; println!("asdfasdf");  core::mem::size_of::<IdtEntry>() }>()

@makubacki makubacki changed the title Update the repo toolchain to Rust 1.99.0 [Rebase & FF] Update the repo toolchain to Rust 1.99.1 [Rebase & FF] Oct 15, 2026
@makubacki

Copy link
Copy Markdown
Collaborator Author

Revised to update to Rust 1.99.1 instead of 1.99.0 to pick up fixes for the issues in https://blog.rust-lang.org/2026/10/15/Rust-1.99.1/.

- `VaList::arg` became `next_arg` in 1.99, so pick the right one with
  rustversion.

  See: https://doc.rust-lang.org/std/ffi/struct.VaList.html#method.next_arg

- `fetch_update` was deprecated in favor of `try_update` in Rust 1.99.
  For now, continue using `fetch_update` while maintaining
  compatibility with Rust 1.95 and later.

  See:
    - https://doc.rust-lang.org/1.99.0/core/sync/atomic/struct.Atomic.html#method.fetch_update
    - https://doc.rust-lang.org/1.99.0/core/sync/atomic/struct.Atomic.html#method.try_update

- `feature(c_variadic)` became stable in Rust 1.99. However, because
  it is a crate-level inner attribute, it must be placed at the top of
  the crate (patina_dxe_core/src/lib.rs) to support < 1.99.

  To support this in Rust 1.99, an `allow(stable_features)` attribute
  was added with a note it can be removed when the MSRV is increased
  to >= 1.99. `cfg_version` could be used to conditionally add the
  feature, but `cfg_version` itself is currently unstable, not an
  allowed unstable feature in our current list, and it was not deemed
  necessary to enable it just for this case.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
The `chunks_exact_to_as_chunks` clippy lint in Rust 1.99 flags
`chunks_exact(N)` when called with a compile-time constant size.

`as_chunks` has been stable since 1.88, so it is fine for the current
MSRV of Rust 1.90.0.

See: https://doc.rust-lang.org/1.99.0/core/primitive.slice.html#method.as_chunks

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Resolves new clippy lint issues after updating to Rust 1.99.

Lints involved:

- `clone_on_copy`
- `uninlined_format_args`
- `useless_borrows_in_formatting`
- `byte_char_slices`
- `drain_collect`
- `question_mark`

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
The `Pread`/`Pwrite` derives currently output `field: field`
initializers that are flagged in clippy with Rust 1.99.

To prevent every site having to allow this lint individually, it is
allowed globally with a note that it can be disallowed again if the
derive code in the scroll crate is updated.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Rust 1.97.0 added the `manual_assert_eq` lint to the pedantic group.

https://rust-lang.github.io/rust-clippy/master/index.html?groups=pedantic

This updates the code to pass this lint (pedantic is enabled).

Purpose:

Checks for `assert!` and `debug_assert!` usage that consist of only an
(in)equality check.

Why it's bad:

`assert_{eq,ne}!` and `debug_assert_{eq,ne}!` achieve the same goal
and provide some additional debug information.

Note: The `char8`/`char16` test modules keep `==` and `!=` on purpose
since they test the `PartialEq` impls.

Also, `assert_is_empty` is allowed workspace-wide because its suggested
form is harder to read.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
rustdoc in 1.99 produces an error on a footnote definition with no
reference, so make it a plain note.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
These were found when running `cargo clippy` with Rust 1.90.0
(the current MSRV). A warning remains for `clippy::assert_is_empty`
being an unknown lint. Errors and actual issues were addressed.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
After updating to Rust 1.99.0, these documentation blocks are failing
to compile with `error: expected item after doc comment` errors.

Since they're incomplete code examples that are still helpful for
demonstration purposes, this marks them to be ignored.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Updates the examples in docs/src/dev/rust_version_update_process.md
so they are easier to understand by reflecting the current toolchain
being used.

Note: Rust 1.99.1 is used here specifically to include two relevant
fixes in that release, see https://blog.rust-lang.org/2026/10/15/Rust-1.99.1/.

- Missing symbol wcslen
- Miscompilation of FFI bool return values on x86_64

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
@makubacki
makubacki merged commit 1df7109 into OpenDevicePartnership:main Oct 16, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Requires older 1.95 toolchain (update to Rust 1.99)

5 participants