Skip to content

Bump Rust toolchains - #23136

Merged
paldepind merged 4 commits into
mainfrom
rust/update-toolchains-1.100
Nov 16, 2026
Merged

paldepind merged 4 commits into
mainfrom
rust/update-toolchains-1.100

Conversation

@paldepind

@paldepind paldepind commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Bump the Rust toolchain and the dev toolchain pinned in Bazel.

Fix some changes to linting. Cargo can now report unused dependencies, and that lead to the removal of a few dependencies.

@github-actions github-actions Bot added C++ Ruby Rust Pull requests that update Rust code Unified labels Nov 16, 2026
@paldepind
paldepind force-pushed the rust/update-toolchains-1.100 branch from e5ec4c6 to 815be6b Compare November 16, 2026 10:39
paldepind and others added 3 commits November 16, 2026 11:45
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7f912f98-5361-47d2-b1f3-46af0843e5e0
Fix diagnostics introduced by Rust 1.100.0 Clippy and rustfmt. Leave pre-existing lint and formatting findings unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7f912f98-5361-47d2-b1f3-46af0843e5e0
@paldepind
paldepind force-pushed the rust/update-toolchains-1.100 branch from 815be6b to c04c331 Compare November 16, 2026 11:31
@paldepind paldepind changed the title Rust: Update stable and nightly toolchains Rust: Update development and build toolchains Nov 16, 2026
@paldepind paldepind changed the title Rust: Update development and build toolchains Bump Rust toolchains Nov 16, 2026
With Rust 1.100 Cargo now includes a lint for unused dependencies:
https://blog.rust-lang.org/2026/11/12/Rust-1.100.0/#reporting-unused-dependencies-in-cargo

Fix all results from the lint.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 7f912f98-5361-47d2-b1f3-46af0843e5e0
@paldepind
paldepind force-pushed the rust/update-toolchains-1.100 branch from e199b13 to 162fd74 Compare November 16, 2026 13:05
@paldepind
paldepind marked this pull request as ready for review November 16, 2026 13:12
@paldepind
paldepind requested review from a team as code owners November 16, 2026 13:12
Copilot AI adaptive review requested due to automatic review settings November 16, 2026 13:12
result.include_directories,
vec![path.clone(), path.join("dir2")]
);
assert!(!result.unresolvable.is_empty());

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.

This is an instance of this rule.

It might look weird to just remove the assert, but the assert_eq! right below makes it unnecessary and that one will print nicer output if it fails.

Copilot AI 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.

🟡 Changes recommended

The Rust toolchain change lacks DCA results for the final revision, so potential changed alerts or regressions have not been assessed.

1 open issue
What changed in this PR

Updates the repository’s Rust toolchains and applies lint-driven cleanup across Rust sources, dependency manifests, lockfiles, and generated Bazel metadata.

Changes:

  • Bumps the stable Rust toolchain to 1.100.0 and Bazel’s pinned nightly toolchain to 2026-11-16.
  • Simplifies optional-value handling and applies related ownership, borrowing, assertion, and formatting updates.
  • Removes unused encoding and chalk-ir dependencies, including associated lockfile and Bazel metadata.
File Description
unified/​extractor/​tests/​corpus_tests.rs Removes an unnecessary clone when preparing corpus input.
unified/​extractor/​src/​languages/​swift/​swift.rs Uses map_or_default for optional Swift operator markers.
unified/​extractor/​src/​languages/​swift/​adapter.rs Simplifies optional JSON object handling.
unified/​extractor/​Cargo.toml Removes the unused encoding dependency.
shared/​yeast/​src/​lib.rs Simplifies control flow after the divergent translation failure.
shared/​tree-sitter-extractor/​src/​diagnostics.rs Simplifies mutable writer handling for lint compatibility.
shared/​tree-sitter-extractor/​Cargo.toml Removes the unused encoding dependency.
rust/​extractor/​src/​translate/​base.rs Uses map_or_default for optional macro paths.
rust/​extractor/​Cargo.toml Removes the unused chalk-ir dependency.
rust-toolchain.toml Bumps the stable Rust toolchain to 1.100.0.
ruby/​extractor/​src/​extractor.rs Reformats the overlay documentation comment.
MODULE.bazel Updates the pinned Bazel nightly toolchain and removes the chalk-ir repository.
misc/​bazel/​3rdparty/​rust_workspace_deps/​crates.bzl Removes unused dependency mappings and generated repositories.
misc/​bazel/​3rdparty/​rust_workspace_deps/​chalk-ir/​BUILD.bazel Removes the obsolete chalk-ir alias.
misc/​bazel/​3rdparty/​rust_workspace_deps/​chalk-ir-0.104.0/​BUILD.bazel Removes the obsolete versioned chalk-ir alias.
misc/​bazel/​3rdparty/​rust_workspace_deps/​BUILD.chalk-ir-0.104.0.bazel Removes generated build metadata for chalk-ir.
misc/​bazel/​3rdparty/​rust_workspace_deps/​BUILD.chalk-derive-0.104.0.bazel Removes generated build metadata for chalk-derive.
misc/​bazel/​3rdparty/​rust_workspace_deps/​BUILD.bazel Removes obsolete chalk-ir aliases.
cpp/​extractor/​bmn/​src/​include_finder.rs Adjusts assertions to remove redundancy and make emptiness explicit.
cpp/​extractor/​bmn/​src/​directory_tree.rs Uses map_or_default when deriving matching directories.
Cargo.lock Removes lockfile entries for unused dependencies.

Review effort: Lite (dynamic)

Comment thread rust-toolchain.toml

[toolchain]
channel = "1.98"
channel = "1.100.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.

It's very unlikely that bumping the compiler version causes things to break (especially in a way where CI is still green). But I've started a Unified and a Rust DCA run for good measure.

@tausbn tausbn 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.

A few comments about the lints, but otherwise this looks good to me. 👍

Comment thread shared/yeast/src/lib.rs
Comment on lines +1187 to +1189
translation_failure("cannot eagerly translate a capture of the matched rule root");
}
self.translate(ast, output, user_ctx, id)

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 is yet another instance where I don't quite agree with the lint. Yes, translation_failure cannot return, so moving the else branch to the top level is safe, but to know this, you have to be aware of the return type in the first place. The original code made it clear that no matter what translation_failure does, no translation takes place (at the small cost of a } else { line).

This is not to say that we need to change the code back. I just think some of these lints aren't actually as universally useful as we might want them to be.

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 see your point and I'm not necessarily disagreeing. But, if I where to try and steelman this lint I'd say the following: When a function never returns it's out of the ordinary control flow and that should always be clear from it's name/use. Otherwise the old code would also be unclear: one might think that translation_failure returned a value. And with that assumption, this rewrite shouldn't make the code less clear. Additionally, error checks are often of the "early return" kind where the rest of the block (after the error) is not indented and this rewrite make the code fit that pattern.

But, again, I see your point and it's hard to argue in a vacuum that this particular change is doing much.

To me it's probably neutral and when a lint rule's effect is neutral I tend to think of it as an improvement, because it reduces overall variance in the code. Previously both the code before and after this diff where allowed, now only the new version is allowed. So now when you see an if-else you know that the true branch is not diverging.

That's a more general argument, but again, for this particular rule I don't have strong feelings.

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.

[...] So now when you see an if-else you know that the true branch is not diverging.

Woah, that's huge! Rust has actually solved the halting problem!?

// This is empty since `foo.h` is in `system_files` and hence satisfied by
// `compiler_defaults`.
assert!(result.include_directories.is_empty());
assert_eq!(result.include_directories, Vec::<PathBuf>::new());

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'm a bit curious as to why this is the better way to write this assertion. I guess assert_eq perhaps gives more information in the case of a failure, but on the other hand we're creating a new empty vector only to test for equality, and we have to explicitly specify the type of its elements.

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.

Yes, it's because the error that'll get printed on assertion failure is much more informative.

@paldepind
paldepind merged commit 7c9518b into main Nov 16, 2026
98 of 101 checks passed
@paldepind
paldepind deleted the rust/update-toolchains-1.100 branch November 16, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ Ruby Rust Pull requests that update Rust code Unified

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants