Skip to content

feat!: bump supported Rust version to 1.85.0 and edition to 2024#244

Merged
bavshin-f5 merged 4 commits intonginx:mainfrom
bavshin-f5:msrv-bump
Jan 28, 2026
Merged

feat!: bump supported Rust version to 1.85.0 and edition to 2024#244
bavshin-f5 merged 4 commits intonginx:mainfrom
bavshin-f5:msrv-bump

Conversation

@bavshin-f5
Copy link
Member

See #96 (comment).

Includes #200.

@bavshin-f5 bavshin-f5 requested a review from Copilot January 27, 2026 21:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the Rust toolchain to version 1.85.0 and migrates the codebase to Rust edition 2024, which introduces new unsafe operation requirements and import sorting conventions.

Changes:

  • Updated minimum supported Rust version from 1.81.0 to 1.85.0
  • Migrated from Rust edition 2021 to 2024
  • Wrapped unsafe operations in unsafe blocks as required by edition 2024

Reviewed changes

Copilot reviewed 39 out of 39 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Cargo.toml Updated edition and rust-version, added workspace lints for 2024 compatibility
rustfmt.toml Changed edition from 2021 to 2024
README.md Updated minimum Rust version requirement in documentation
src/lib.rs Updated documentation and changed #[no_mangle] to #[unsafe(no_mangle)]
src/sync.rs Removed empty documentation line
src/log.rs Reordered imports to follow convention
src/core/*.rs Wrapped unsafe operations in unsafe blocks
src/http/*.rs Wrapped unsafe operations in unsafe blocks, reformatted code
src/collections/*.rs Wrapped unsafe operations in unsafe blocks
src/async_/*.rs Wrapped unsafe operations in unsafe blocks, reordered imports
nginx-sys/src/*.rs Wrapped unsafe operations in unsafe blocks
nginx-sys/build/main.rs Added rust_edition and wrap_unsafe_ops configuration
nginx-sys/Cargo.toml Added workspace lints
nginx-src/*.rs Code formatting adjustments
examples/*.rs Wrapped unsafe operations, updated #[no_mangle] attributes, reordered imports

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@xeioex xeioex left a comment

Choose a reason for hiding this comment

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

Looks good.

pchickey and others added 4 commits January 27, 2026 17:19
enforced by workspace level lints, now specified in each Cargo.toml,
except nginx-sys, because bindgen can't be set to Edition2024 until MSRV
hits 1.85

this change set is created automatically by `cargo fix --edition --all`,
then with manual fixes afterwards:

* Back out any use of unsafe(no_mangle) for plain no_mangle, since 1.81
  wont accept it
* remove uses of expr_2021 in macros, which is not available in the
  MSRV.
* Manual fix to ngx_container_of! macro for safety rules in 2024,
  these weren't migrated automatically by `cargo fix`
* Manual fixes to several other macros that created an &mut Request in an
  expression, Rust 2024 is stricter about taking &mut of temporaries, so
  instead the request is let-bound first.
@bavshin-f5 bavshin-f5 merged commit ac0dc04 into nginx:main Jan 28, 2026
15 checks passed
@bavshin-f5 bavshin-f5 deleted the msrv-bump branch January 28, 2026 18:16
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.

5 participants