Skip to content

Set edition = "2021" for all Rust targets#28137

Open
korran wants to merge 1 commit into
protocolbuffers:mainfrom
korran:fix/rust-edition-2021
Open

Set edition = "2021" for all Rust targets#28137
korran wants to merge 1 commit into
protocolbuffers:mainfrom
korran:fix/rust-edition-2021

Conversation

@korran

@korran korran commented Jun 22, 2026

Copy link
Copy Markdown

Explicitly set edition to "2021" for all Rust libraries, tests, and binaries. This prevents build failures when the default toolchain uses a different edition (like 2024) which is incompatible with these files.

Explicitly set edition to "2021" for all Rust libraries, tests, and
binaries.  This prevents build failures when the default toolchain uses
a different edition (like 2024) which is incompatible with these files.
@korran korran force-pushed the fix/rust-edition-2021 branch from 877f016 to 25f437d Compare June 22, 2026 06:46
@korran korran changed the title fix(rust): set edition = "2021" for all Rust targets Set edition = "2021" for all Rust targets Jun 22, 2026
@esrauchg

Copy link
Copy Markdown
Contributor

Google Cloud minimum supported rustc is 1.85.0 which is when Edition 2024 was introduced so I think we could bump to 2024 here.

Google internally is on 2021 by default today still which is why 2024 issues could slip through, but I looked at what breaks if we just bump to edition="2024" instead and I didn't get any breakages on either our internal or external CI (External version of the change: #28140)

Can you clarify what issue you saw with a 2024-default toolchain that caused you to send this PR? I want to make sure I understand if we have missing CI coverage or something as well.

Thanks!

@esrauchg esrauchg self-assigned this Jun 22, 2026
@esrauchg

Copy link
Copy Markdown
Contributor

Actually looking closer I think our setting to 2024 in the toolchain setup in our bzlmod file is what is supposed to take care of this.

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.

2 participants