Upgrade to compatibility with rust edition 2024
Proposed changes
We can't actually upgrade to edition 2024, because the MSRV is currently stuck on 1.81 for LTS linux packaging, and 2024 shipped in 1.85. But, in order to have a consistent set of rules (especially around unsafe) to follow across Rust projects with a newer MSRV, make this source tree forwards-compatible to 2024.
Automatically make changes to source of all crates using cargo fix --edition --all, then all of the manual fixes required after that.
Add workspace level lints for rust-2024-compatibility, allowing the expr fragment specifier case which I don't expect to matter and is unstable when building with 1.81
Checklist
Before creating a PR, run through this checklist and mark each as complete.
- [x] I have written my commit messages in the Conventional Commits format.
- [x] I have read the CONTRIBUTING doc
- [x] I have added tests (when possible) that prove my fix is effective or that my feature works
- [x] I have checked that all unit tests pass after adding my changes
- [x] I have updated necessary documentation
- [x] I have rebased my branch onto main
- [x] I will ensure my PR is targeting the main branch and pulling from my branch from my own fork
Does that effectively bump nginx-acme (future releases) Rust toolchain requirement to 1.85.0?
Yes, it would. Is that a problem?
We don't have to land this now - it could wait, or we could make a separate CI build that modifies it to 2024 and then runs checks while actually keeping it at 2021 - but remembering there are different edition rules across related projects is a mental overhead I'm trying to resolve.
Yes, it would. Is that a problem?
We want to support Rust toolchains avaliable in RHEL, Alpine and Ubuntu LTS, to allow building distribution packages of ngx-rust based modules. Currently, that limits us to 1.82.0.
OK: I will remove the upgrade of edition and msrv, I will switch this to lint that the libraries are compatible with the 2024 edition, which keeps the upgrade delta pretty small.
@bavshin-f5 I made another pass to minimize the size of all the added unsafe {} blocks