Repository navigation
Bump Rust toolchains - #23136
Bump Rust toolchains#23136
Conversation
e5ec4c6 to
815be6b
Compare
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
815be6b to
c04c331
Compare
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
e199b13 to
162fd74
Compare
| result.include_directories, | ||
| vec![path.clone(), path.join("dir2")] | ||
| ); | ||
| assert!(!result.unresolvable.is_empty()); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
🟡 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
encodingandchalk-irdependencies, 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)
|
|
||
| [toolchain] | ||
| channel = "1.98" | ||
| channel = "1.100.0" |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
A few comments about the lints, but otherwise this looks good to me. 👍
| translation_failure("cannot eagerly translate a capture of the matched rule root"); | ||
| } | ||
| self.translate(ast, output, user_ctx, id) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
[...] So now when you see an
if-elseyou know that thetruebranch 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()); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Yes, it's because the error that'll get printed on assertion failure is much more informative.

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.