Skip to content

feat(test): Make CARGO_BIN_EXE_ available at runtime #16421

Merged
weihanglo merged 7 commits intorust-lang:masterfrom
epage:test
Jan 7, 2026
Merged

feat(test): Make CARGO_BIN_EXE_ available at runtime #16421
weihanglo merged 7 commits intorust-lang:masterfrom
epage:test

Conversation

@epage
Copy link
Copy Markdown
Contributor

@epage epage commented Dec 19, 2025

This also makes artifact deps available for consistency purposes.

What does this PR try to resolve?

I originally proposed this for when moving Cargo off of Cargo's own
internals but went with a different solution.

Re-visiting this because assert_cmd has 2300+ dependents and it seems
like making assert_cmd::cargo_bin work would be a better use of time
than migrating all of those users to assert_cmd::cargo_bin!.
For example, within the top 130 dependents (100,000 downloads or more),
I found 66 that used assert_cmd::cargo_bin
(rust-lang/rust#149852).

The reason to make CARGO_BIN_EXE set only at build-time was to
address the concern of manually running the test executable.
It's not
too common for tests to look at any runtime environment variables
(that I know of), so it usually just works (like running
gdb target/debug/.../test-xxx).
The concern was that if it were set at
runtime it would move more down the path where directly running the test
executable doesn't "just work".

See https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/cargo_bin_exe.20and.20tests/near/513638220

However,

How to test and review this PR?

The CARGO_BIN_EXE_ code now also runs during

  • cargo rustdoc --test <name>
  • build scripts
  • doctests

For build scripts and doctests, the unit filter means that nothing has changed.

For cargo rustdoc --test <name>, this technically fixes a bug where running that on a test that calls env!("CARGO_BIN_EXE_foo") would fail. However, --test is broken more generally and we've talked about removing it (#13427) so I didn't add tests to cover this.

Seeing as this is an implicit artifact

At this new location,
it will now run as part of `cargo rustdoc --test <name>`
which technically fixes a bug
but `--test` is not really supported (rust-lang#13427)
so I didn't mark this as a `fix` nor did I add tests.
This now runs in build scripts and doctests *but* the unit check should
prevent any side effects from happening.
This also makes artifact deps available for consistency purposes.

I originally proposed this for when moving Cargo off of Cargo's own
internals but went with a different solution.

Re-visiting this because `assert_cmd` has 2300+ dependents and it seems
like making `assert_cmd::cargo_bin` work would be a better use of time
than migrating all of those users to `assert_cmd::cargo_bin!`.
For example, within the top 130 dependents (100,000 downloads or more),
I found 66 that used `assert_cmd::cargo_bin`
(rust-lang/rust#149852).

> The reason to make `CARGO_BIN_EXE` set only at build-time was to
> address the concern of manually running the test executable.
> It's not
> too common for tests to look at any runtime environment variables
> (that I know of), so it usually just works (like running
> `gdb target/debug/.../test-xxx`).
> The concern was that if it were set at
> runtime it would move more down the path where directly running the test
> executable doesn't "just work".

See https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/cargo_bin_exe.20and.20tests/near/513638220

However,
- This is user opt-in
- Users can run with `-vv` to see the env variables that are set
- Users can run `CARGO_TARGET_..._RUNNER=gdb`
- We can notify the `cargo nextest`, the main third-party test runner,
  about this.  It should be easy to support as they have their own
  version of this, see https://nexte.st/docs/configuration/env-vars/?h=nextest_bin_exe#environment-variables-nextest-sets
@epage epage added the T-cargo Team: Cargo label Dec 19, 2025
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Dec 19, 2025

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-build-execution Area: anything dealing with executing the compiler A-build-scripts Area: build.rs scripts Command-run Command-test S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 19, 2025
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 will need an FCP

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was a bit confused. The "Make CARGO_BIN_EXE_ available at runtime" itself needs FCP, not this specific refactor commit, right?

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

@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@epage
Copy link
Copy Markdown
Contributor Author

epage commented Dec 26, 2025

CC @sunshowers

@sunshowers
Copy link
Copy Markdown
Contributor

sunshowers commented Dec 26, 2025

Thanks, excited about this. One thing I'd note is that many environments such as shells silently drop environment variables which have hyphens in them -- for those environments (e.g. under Cargo target runners or nextest wrapper scripts), I make a version of these variables available that replaces hyphens with underscores. Would recommend both variables also be made available in Cargo.

@epage
Copy link
Copy Markdown
Contributor Author

epage commented Dec 26, 2025

Thanks for noting that. That seems orthogonal to this and would be good for an issue to be opened to discuss and track that.

@sunshowers
Copy link
Copy Markdown
Contributor

Thanks for noting that. That seems orthogonal to this and would be good for an issue to be opened to discuss and track that.

#16438

Copy link
Copy Markdown
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks for the fix.

View changes since this review

@weihanglo
Copy link
Copy Markdown
Member

Users can run with -vv to see the env variables that are set

Unrelated but this reminds me that we might also want to print the working directory in verbose mode (or -vvv) for prosperity reason.

@rustbot

This comment has been minimized.

@ehuss ehuss moved this to FCP merge in Cargo status tracker Jan 6, 2026
@rust-rfcbot rust-rfcbot added final-comment-period FCP — a period for last comments before action is taken and removed proposed-final-comment-period An FCP proposal has started, but not yet signed off. labels Jan 6, 2026
@rust-rfcbot
Copy link
Copy Markdown
Collaborator

🔔 This is now entering its final comment period, as per the review above. 🔔

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Jan 7, 2026

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

Copy link
Copy Markdown
Member

@weihanglo weihanglo left a comment

Choose a reason for hiding this comment

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

As this is more an addition and less controversial, merge it now so we can get feedback sooner before beta branch off.

View changes since this review

@weihanglo weihanglo added this pull request to the merge queue Jan 7, 2026
Merged via the queue into rust-lang:master with commit 29154a6 Jan 7, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 7, 2026
rust-bors bot added a commit to rust-lang/rust that referenced this pull request Jan 8, 2026
Update cargo submodule

24 commits in 94c368ad2b9db0f0da5bdd8421cea13786ce4412..fc4c92b64d1e0046b66cbdc747cc1c17af8b35a0
2025-12-26 19:39:15 +0000 to 2026-01-08 06:54:56 +0000
- Fixed incorrect version comparision during build script dependency selection (rust-lang/cargo#16486)
- refactor: new type for unit index (rust-lang/cargo#16485)
- feat(test): Make CARGO_BIN_EXE_ available at runtime  (rust-lang/cargo#16421)
- fix(package): detect dirty files when run from workspace member (rust-lang/cargo#16479)
- fix(timing)!: remove `--timings=<FMT>` optional format values (rust-lang/cargo#16420)
- docs(unstable): expand docs for `-Zbuild-analysis` (rust-lang/cargo#16476)
- test: add `-Zunstable-options` with custom targets (rust-lang/cargo#16467)
- feat(report): add cargo report rebuilds  (rust-lang/cargo#16456)
- feat(test-support): Use test name for dir when running tests (rust-lang/cargo#16121)
- refactor: Migrate some cases to expect/reason (rust-lang/cargo#16461)
- docs(build-script): clarify OUT_DIR is not cleaned between builds (rust-lang/cargo#16437)
- chore: Update dependencies (rust-lang/cargo#16460)
- Update handlebars to 6.4.0 (rust-lang/cargo#16457)
- chore(deps): update alpine docker tag to v3.23 (rust-lang/cargo#16454)
- Any build scripts can now use cargo::metadata=KEY=VALUE (rust-lang/cargo#16436)
- fix(log): add `dependencies` field to `UnitRegistered` (rust-lang/cargo#16448)
- Implement fine grain locking for `build-dir` (rust-lang/cargo#16155)
- feat(resolver): List features when no close match (rust-lang/cargo#16445)
- feat(report): new command `cargo report sessions` (rust-lang/cargo#16428)
- feat (patch): Display where the patch was defined in patch-related error messages (rust-lang/cargo#16407)
- test(build-rs): Reduce from 'build' to 'check' where possible (rust-lang/cargo#16444)
- feat(toml): TOML 1.1 parse support (rust-lang/cargo#16415)
- feat(report): support --manifest-path in `cargo report timings` (rust-lang/cargo#16441)
- fix(vendor): recursively filter git files in subdirectories (rust-lang/cargo#16439)
rust-bors bot added a commit to rust-lang/rust that referenced this pull request Jan 9, 2026
Update cargo submodule

27 commits in 94c368ad2b9db0f0da5bdd8421cea13786ce4412..8c133afcd5e0d69932fe11f5907683723f8d361d
2025-12-26 19:39:15 +0000 to 2026-01-09 03:50:15 +0000
- Isolate build script metadata progation between std and non-std crates (rust-lang/cargo#16489)
- Add Clippy like lint groups (rust-lang/cargo#16464)
- feat: in-memory only `Manifest` (rust-lang/cargo#16409)
- Fixed incorrect version comparision during build script dependency selection (rust-lang/cargo#16486)
- refactor: new type for unit index (rust-lang/cargo#16485)
- feat(test): Make CARGO_BIN_EXE_ available at runtime  (rust-lang/cargo#16421)
- fix(package): detect dirty files when run from workspace member (rust-lang/cargo#16479)
- fix(timing)!: remove `--timings=&lt;FMT&gt;` optional format values (rust-lang/cargo#16420)
- docs(unstable): expand docs for `-Zbuild-analysis` (rust-lang/cargo#16476)
- test: add `-Zunstable-options` with custom targets (rust-lang/cargo#16467)
- feat(report): add cargo report rebuilds  (rust-lang/cargo#16456)
- feat(test-support): Use test name for dir when running tests (rust-lang/cargo#16121)
- refactor: Migrate some cases to expect/reason (rust-lang/cargo#16461)
- docs(build-script): clarify OUT_DIR is not cleaned between builds (rust-lang/cargo#16437)
- chore: Update dependencies (rust-lang/cargo#16460)
- Update handlebars to 6.4.0 (rust-lang/cargo#16457)
- chore(deps): update alpine docker tag to v3.23 (rust-lang/cargo#16454)
- Any build scripts can now use cargo::metadata=KEY=VALUE (rust-lang/cargo#16436)
- fix(log): add `dependencies` field to `UnitRegistered` (rust-lang/cargo#16448)
- Implement fine grain locking for `build-dir` (rust-lang/cargo#16155)
- feat(resolver): List features when no close match (rust-lang/cargo#16445)
- feat(report): new command `cargo report sessions` (rust-lang/cargo#16428)
- feat (patch): Display where the patch was defined in patch-related error messages (rust-lang/cargo#16407)
- test(build-rs): Reduce from 'build' to 'check' where possible (rust-lang/cargo#16444)
- feat(toml): TOML 1.1 parse support (rust-lang/cargo#16415)
- feat(report): support --manifest-path in `cargo report timings` (rust-lang/cargo#16441)
- fix(vendor): recursively filter git files in subdirectories (rust-lang/cargo#16439)
@epage epage deleted the test branch January 9, 2026 17:12
@rustbot rustbot added this to the 1.94.0 milestone Jan 9, 2026
github-actions bot pushed a commit to rust-lang/rust-analyzer that referenced this pull request Jan 12, 2026
Update cargo submodule

27 commits in 94c368ad2b9db0f0da5bdd8421cea13786ce4412..8c133afcd5e0d69932fe11f5907683723f8d361d
2025-12-26 19:39:15 +0000 to 2026-01-09 03:50:15 +0000
- Isolate build script metadata progation between std and non-std crates (rust-lang/cargo#16489)
- Add Clippy like lint groups (rust-lang/cargo#16464)
- feat: in-memory only `Manifest` (rust-lang/cargo#16409)
- Fixed incorrect version comparision during build script dependency selection (rust-lang/cargo#16486)
- refactor: new type for unit index (rust-lang/cargo#16485)
- feat(test): Make CARGO_BIN_EXE_ available at runtime  (rust-lang/cargo#16421)
- fix(package): detect dirty files when run from workspace member (rust-lang/cargo#16479)
- fix(timing)!: remove `--timings=&lt;FMT&gt;` optional format values (rust-lang/cargo#16420)
- docs(unstable): expand docs for `-Zbuild-analysis` (rust-lang/cargo#16476)
- test: add `-Zunstable-options` with custom targets (rust-lang/cargo#16467)
- feat(report): add cargo report rebuilds  (rust-lang/cargo#16456)
- feat(test-support): Use test name for dir when running tests (rust-lang/cargo#16121)
- refactor: Migrate some cases to expect/reason (rust-lang/cargo#16461)
- docs(build-script): clarify OUT_DIR is not cleaned between builds (rust-lang/cargo#16437)
- chore: Update dependencies (rust-lang/cargo#16460)
- Update handlebars to 6.4.0 (rust-lang/cargo#16457)
- chore(deps): update alpine docker tag to v3.23 (rust-lang/cargo#16454)
- Any build scripts can now use cargo::metadata=KEY=VALUE (rust-lang/cargo#16436)
- fix(log): add `dependencies` field to `UnitRegistered` (rust-lang/cargo#16448)
- Implement fine grain locking for `build-dir` (rust-lang/cargo#16155)
- feat(resolver): List features when no close match (rust-lang/cargo#16445)
- feat(report): new command `cargo report sessions` (rust-lang/cargo#16428)
- feat (patch): Display where the patch was defined in patch-related error messages (rust-lang/cargo#16407)
- test(build-rs): Reduce from 'build' to 'check' where possible (rust-lang/cargo#16444)
- feat(toml): TOML 1.1 parse support (rust-lang/cargo#16415)
- feat(report): support --manifest-path in `cargo report timings` (rust-lang/cargo#16441)
- fix(vendor): recursively filter git files in subdirectories (rust-lang/cargo#16439)
github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Jan 12, 2026
Update cargo submodule

27 commits in 94c368ad2b9db0f0da5bdd8421cea13786ce4412..8c133afcd5e0d69932fe11f5907683723f8d361d
2025-12-26 19:39:15 +0000 to 2026-01-09 03:50:15 +0000
- Isolate build script metadata progation between std and non-std crates (rust-lang/cargo#16489)
- Add Clippy like lint groups (rust-lang/cargo#16464)
- feat: in-memory only `Manifest` (rust-lang/cargo#16409)
- Fixed incorrect version comparision during build script dependency selection (rust-lang/cargo#16486)
- refactor: new type for unit index (rust-lang/cargo#16485)
- feat(test): Make CARGO_BIN_EXE_ available at runtime  (rust-lang/cargo#16421)
- fix(package): detect dirty files when run from workspace member (rust-lang/cargo#16479)
- fix(timing)!: remove `--timings=&lt;FMT&gt;` optional format values (rust-lang/cargo#16420)
- docs(unstable): expand docs for `-Zbuild-analysis` (rust-lang/cargo#16476)
- test: add `-Zunstable-options` with custom targets (rust-lang/cargo#16467)
- feat(report): add cargo report rebuilds  (rust-lang/cargo#16456)
- feat(test-support): Use test name for dir when running tests (rust-lang/cargo#16121)
- refactor: Migrate some cases to expect/reason (rust-lang/cargo#16461)
- docs(build-script): clarify OUT_DIR is not cleaned between builds (rust-lang/cargo#16437)
- chore: Update dependencies (rust-lang/cargo#16460)
- Update handlebars to 6.4.0 (rust-lang/cargo#16457)
- chore(deps): update alpine docker tag to v3.23 (rust-lang/cargo#16454)
- Any build scripts can now use cargo::metadata=KEY=VALUE (rust-lang/cargo#16436)
- fix(log): add `dependencies` field to `UnitRegistered` (rust-lang/cargo#16448)
- Implement fine grain locking for `build-dir` (rust-lang/cargo#16155)
- feat(resolver): List features when no close match (rust-lang/cargo#16445)
- feat(report): new command `cargo report sessions` (rust-lang/cargo#16428)
- feat (patch): Display where the patch was defined in patch-related error messages (rust-lang/cargo#16407)
- test(build-rs): Reduce from 'build' to 'check' where possible (rust-lang/cargo#16444)
- feat(toml): TOML 1.1 parse support (rust-lang/cargo#16415)
- feat(report): support --manifest-path in `cargo report timings` (rust-lang/cargo#16441)
- fix(vendor): recursively filter git files in subdirectories (rust-lang/cargo#16439)
@rust-rfcbot rust-rfcbot added finished-final-comment-period FCP complete to-announce and removed final-comment-period FCP — a period for last comments before action is taken labels Jan 16, 2026
github-actions bot pushed a commit to rust-lang/compiler-builtins that referenced this pull request Jan 29, 2026
Update cargo submodule

27 commits in 94c368ad2b9db0f0da5bdd8421cea13786ce4412..8c133afcd5e0d69932fe11f5907683723f8d361d
2025-12-26 19:39:15 +0000 to 2026-01-09 03:50:15 +0000
- Isolate build script metadata progation between std and non-std crates (rust-lang/cargo#16489)
- Add Clippy like lint groups (rust-lang/cargo#16464)
- feat: in-memory only `Manifest` (rust-lang/cargo#16409)
- Fixed incorrect version comparision during build script dependency selection (rust-lang/cargo#16486)
- refactor: new type for unit index (rust-lang/cargo#16485)
- feat(test): Make CARGO_BIN_EXE_ available at runtime  (rust-lang/cargo#16421)
- fix(package): detect dirty files when run from workspace member (rust-lang/cargo#16479)
- fix(timing)!: remove `--timings=&lt;FMT&gt;` optional format values (rust-lang/cargo#16420)
- docs(unstable): expand docs for `-Zbuild-analysis` (rust-lang/cargo#16476)
- test: add `-Zunstable-options` with custom targets (rust-lang/cargo#16467)
- feat(report): add cargo report rebuilds  (rust-lang/cargo#16456)
- feat(test-support): Use test name for dir when running tests (rust-lang/cargo#16121)
- refactor: Migrate some cases to expect/reason (rust-lang/cargo#16461)
- docs(build-script): clarify OUT_DIR is not cleaned between builds (rust-lang/cargo#16437)
- chore: Update dependencies (rust-lang/cargo#16460)
- Update handlebars to 6.4.0 (rust-lang/cargo#16457)
- chore(deps): update alpine docker tag to v3.23 (rust-lang/cargo#16454)
- Any build scripts can now use cargo::metadata=KEY=VALUE (rust-lang/cargo#16436)
- fix(log): add `dependencies` field to `UnitRegistered` (rust-lang/cargo#16448)
- Implement fine grain locking for `build-dir` (rust-lang/cargo#16155)
- feat(resolver): List features when no close match (rust-lang/cargo#16445)
- feat(report): new command `cargo report sessions` (rust-lang/cargo#16428)
- feat (patch): Display where the patch was defined in patch-related error messages (rust-lang/cargo#16407)
- test(build-rs): Reduce from 'build' to 'check' where possible (rust-lang/cargo#16444)
- feat(toml): TOML 1.1 parse support (rust-lang/cargo#16415)
- feat(report): support --manifest-path in `cargo report timings` (rust-lang/cargo#16441)
- fix(vendor): recursively filter git files in subdirectories (rust-lang/cargo#16439)
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Mar 7, 2026
Pkgsrc changes:
 * Update version & checksums.
 * Adapt patches to new vendored crates.

This has so far just been verified to build on NetBSD/amd64.

Upstream changes relative to 1.93.1:

Version 1.94.0 (2026-03-05)
==========================

Language
--------
- [Impls and impl items inherit `dead_code` lint level of the
  corresponding traits and trait items]
  (rust-lang/rust#144113)
- [Stabilize additional 29 RISC-V target features including large
  portions of the RVA22U64 / RVA23U64 profiles]
  (rust-lang/rust#145948)
- [Add warn-by-default `unused_visibilities` lint for visibility
  on `const _` declarations]
  (rust-lang/rust#147136)
- [Update to Unicode 17]
  (rust-lang/rust#148321)
- [Avoid incorrect lifetime errors for closures]
  (rust-lang/rust#148329)

Platform Support
----------------
- [Add `riscv64im-unknown-none-elf` as a tier 3 target]
  (rust-lang/rust#148790)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html

Libraries
---------
- [Relax `T: Ord` bound for some `BinaryHeap<T>` methods.]
  (rust-lang/rust#149408)

Stabilized APIs
---------------
- [`<[T]>::array_windows`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.array_windows)
- [`<[T]>::element_offset`]
  (https://doc.rust-lang.org/stable/std/primitive.slice.html#method.element_offset)
- [`LazyCell::get`]
  (https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.get)
- [`LazyCell::get_mut`]
  (https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.get_mut)
- [`LazyCell::force_mut`]
  (https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.force_mut)
- [`LazyLock::get`]
  (https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.get)
- [`LazyLock::get_mut`]
  (https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.get_mut)
- [`LazyLock::force_mut`]
  (https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.force_mut)
- [`impl TryFrom<char> for usize`]
  (https://doc.rust-lang.org/stable/std/convert/trait.TryFrom.html#impl-TryFrom%3Cchar%3E-for-usize)
- [`std::iter::Peekable::next_if_map`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_map)
- [`std::iter::Peekable::next_if_map_mut`]
  (https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_map_mut)
- [x86 `avx512fp16` intrinsics]
  (rust-lang/rust#127213)
  (excluding those that depend directly on the unstable `f16` type)
- [AArch64 NEON fp16 intrinsics]
  (rust-lang/rust#136306)
  (excluding those that depend directly on the unstable `f16` type)
- [`f32::consts::EULER_GAMMA`]
  (https://doc.rust-lang.org/stable/std/f32/consts/constant.EULER_GAMMA.html)
- [`f64::consts::EULER_GAMMA`]
  (https://doc.rust-lang.org/stable/std/f64/consts/constant.EULER_GAMMA.html)
- [`f32::consts::GOLDEN_RATIO`]
  (https://doc.rust-lang.org/stable/std/f32/consts/constant.GOLDEN_RATIO.html)
- [`f64::consts::GOLDEN_RATIO`]
  (https://doc.rust-lang.org/stable/std/f64/consts/constant.GOLDEN_RATIO.html)

These previously stable APIs are now stable in const contexts:

- [`f32::mul_add`]
  (https://doc.rust-lang.org/stable/std/primitive.f32.html#method.mul_add)
- [`f64::mul_add`]
  (https://doc.rust-lang.org/stable/std/primitive.f64.html#method.mul_add)

Cargo
-----
- Stabilize the config include key. The top-level include config
  key allows loading additional config files, enabling better
  organization, sharing, and management of Cargo configurations
  across projects and environments. [docs]
  (https://doc.rust-lang.org/nightly/cargo/reference/config.html#including-extra-configuration-files)
  [#16284] (rust-lang/cargo#16284)
- Stabilize the pubtime field in registry index. This records when
  a crate version was published and enables time-based dependency
  resolution in the future. Note that crates.io will gradually backfill
  existing packages when a new version is published. Not all crates
  have pubtime yet. [#16369]
  (rust-lang/cargo#16369) [#16372]
  (rust-lang/cargo#16372)
- Cargo now parses [TOML v1.1](https://toml.io/en/v1.1.0) for
  manifests and configuration files. Note that using these features
  in Cargo.toml will raise your development MSRV, but the published
  manifest remains compatible with older parsers. [#16415]
  (rust-lang/cargo#16415)
- [Make `CARGO_BIN_EXE_<crate>` available at runtime ]
  (rust-lang/cargo#16421)

Compatibility Notes
-------------------
- [Forbid freely casting lifetime bounds of `dyn`-types]
  (rust-lang/rust#136776)
- [Make closure capturing have consistent and correct behaviour around patterns]
  (rust-lang/rust#138961)
  Some finer details of how precise closure captures get affected
  by pattern matching have been changed. In some cases, this can
  cause a non-move closure that was previously capturing an entire
  variable by move, to now capture only part of that variable by
  move, and other parts by borrow. This can cause the borrow checker
  to complain where it previously didn't, or cause `Drop` to run
  at a different point in time.
- [Standard library macros are now imported via prelude, not via injected `
  #[macro_use]`] (rust-lang/rust#139493)
  This will raise an error if macros of the same name are glob
  imported.  For example if a crate defines their own `matches`
  macro and then glob imports that, it's now ambiguous whether the
  custom or standard library `matches` is meant and an explicit
  import of the name is required to resolve the ambiguity.  One
  exception is `core::panic` and `std::panic`, if their import is
  ambiguous a new warning ([`ambiguous_panic_imports`]
  (rust-lang/rust#147319)) is raised.
  This may raise a new warning ([`ambiguous_panic_imports`]
  (rust-lang/rust#147319)) on `#![no_std]`
  code glob importing the std crate.  Both `core::panic!` and
  `std::panic!` are then in scope and which is used is ambiguous.
- [Don't strip shebang in expression-context `include!(…)`s]
  (rust-lang/rust#146377)
  This can cause previously working includes to no longer compile
  if they included files which started with a shebang.
- [Ambiguous glob reexports are now also visible cross-crate]
  (rust-lang/rust#147984)
  This unifies behavior between local and cross-crate errors on
  these exports, which may introduce new ambiguity errors.
- [Don't normalize where-clauses before checking well-formedness]
  (rust-lang/rust#148477)
- [Introduce a future compatibility warning on codegen attributes
  on body-free trait methods]
  (rust-lang/rust#148756) These attributes
  currently have no effect in this position.
- [On Windows `std::time::SystemTime::checked_sub_duration` will
  return `None` for times before the Windows epoch (1/1/1601)]
  (rust-lang/rust#148825)
- [Lifetime identifiers such as `'a` are now NFC normalized]
  (rust-lang/rust#149192).
- [Overhaul filename handling for cross-compiler consistency]
  (rust-lang/rust#149709)
  Any paths emitted by compiler now always respect the relative-ness
  of the paths and `--remap-path-prefix` given originally.  One
  side-effect of this change is that paths emitted for local crates
  in Cargo (path dependencies and workspace members) are no longer
  absolute but relative when emitted as part of a diagnostic in a
  downstream crate.

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Switch to `annotate-snippets` for error emission]
  (rust-lang/rust#150032)
  This should preserve mostly the same outputs in rustc error messages.
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Mar 11, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [rust](https://github.com/rust-lang/rust) | minor | `1.93.1` → `1.94.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>rust-lang/rust (rust)</summary>

### [`v1.94.0`](https://github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1940-2026-03-05)

[Compare Source](rust-lang/rust@1.93.1...1.94.0)

\==========================

<a id="1.94.0-Language"></a>

## Language

- [Impls and impl items inherit `dead_code` lint level of the corresponding traits and trait items](rust-lang/rust#144113)
- [Stabilize additional 29 RISC-V target features including large portions of the RVA22U64 / RVA23U64 profiles](rust-lang/rust#145948)
- [Add warn-by-default `unused_visibilities` lint for visibility on `const _` declarations](rust-lang/rust#147136)
- [Update to Unicode 17](rust-lang/rust#148321)
- [Avoid incorrect lifetime errors for closures](rust-lang/rust#148329)

<a id="1.94.0-Platform-Support"></a>

## Platform Support

- [Add `riscv64im-unknown-none-elf` as a tier 3 target](rust-lang/rust#148790)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

[platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html

<a id="1.94.0-Libraries"></a>

## Libraries

- [Relax `T: Ord` bound for some `BinaryHeap<T>` methods.](rust-lang/rust#149408)

<a id="1.94.0-Stabilized-APIs"></a>

## Stabilized APIs

- [`<[T]>::array_windows`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.array_windows)
- [`<[T]>::element_offset`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.element_offset)
- [`LazyCell::get`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.get)
- [`LazyCell::get_mut`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.get_mut)
- [`LazyCell::force_mut`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.force_mut)
- [`LazyLock::get`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.get)
- [`LazyLock::get_mut`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.get_mut)
- [`LazyLock::force_mut`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.force_mut)
- [`impl TryFrom<char> for usize`](https://doc.rust-lang.org/stable/std/convert/trait.TryFrom.html#impl-TryFrom%3Cchar%3E-for-usize)
- [`std::iter::Peekable::next_if_map`](https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_map)
- [`std::iter::Peekable::next_if_map_mut`](https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_map_mut)
- [x86 `avx512fp16` intrinsics](rust-lang/rust#127213)
  (excluding those that depend directly on the unstable `f16` type)
- [AArch64 NEON fp16 intrinsics](rust-lang/rust#136306)
  (excluding those that depend directly on the unstable `f16` type)
- [`f32::consts::EULER_GAMMA`](https://doc.rust-lang.org/stable/std/f32/consts/constant.EULER_GAMMA.html)
- [`f64::consts::EULER_GAMMA`](https://doc.rust-lang.org/stable/std/f64/consts/constant.EULER_GAMMA.html)
- [`f32::consts::GOLDEN_RATIO`](https://doc.rust-lang.org/stable/std/f32/consts/constant.GOLDEN_RATIO.html)
- [`f64::consts::GOLDEN_RATIO`](https://doc.rust-lang.org/stable/std/f64/consts/constant.GOLDEN_RATIO.html)

These previously stable APIs are now stable in const contexts:

- [`f32::mul_add`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.mul_add)
- [`f64::mul_add`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.mul_add)

<a id="1.94.0-Cargo"></a>

## Cargo

- Stabilize the config include key. The top-level include config key allows loading additional config files, enabling better organization, sharing, and management of Cargo configurations across projects and environments. [docs](https://doc.rust-lang.org/nightly/cargo/reference/config.html#including-extra-configuration-files) [#&#8203;16284](rust-lang/cargo#16284)
- Stabilize the pubtime field in registry index. This records when a crate version was published and enables time-based dependency resolution in the future. Note that crates.io will gradually backfill existing packages when a new version is published. Not all crates have pubtime yet. [#&#8203;16369](rust-lang/cargo#16369) [#&#8203;16372](rust-lang/cargo#16372)
- Cargo now parses [TOML v1.1](https://toml.io/en/v1.1.0) for manifests and configuration files. Note that using these features in Cargo.toml will raise your development MSRV, but the published manifest remains compatible with older parsers. [#&#8203;16415](rust-lang/cargo#16415)
- [Make `CARGO_BIN_EXE_<crate>` available at runtime ](rust-lang/cargo#16421)

<a id="1.94.0-Compatibility-Notes"></a>

## Compatibility Notes

- [Forbid freely casting lifetime bounds of `dyn`-types](rust-lang/rust#136776)
- [Make closure capturing have consistent and correct behaviour around patterns](rust-lang/rust#138961)
  Some finer details of how precise closure captures get affected by pattern matching have been changed. In some cases, this can cause a non-move closure that was previously capturing an entire variable by move, to now capture only part of that variable by move, and other parts by borrow. This can cause the borrow checker to complain where it previously didn't, or cause `Drop` to run at a different point in time.
- [Standard library macros are now imported via prelude, not via injected `#[macro_use]`](rust-lang/rust#139493)
  This will raise an error if macros of the same name are glob imported.
  For example if a crate defines their own `matches` macro and then glob imports that,
  it's now ambiguous whether the custom or standard library `matches` is meant and
  an explicit import of the name is required to resolve the ambiguity.
  One exception is `core::panic` and `std::panic`, if their import is ambiguous
  a new warning ([`ambiguous_panic_imports`](rust-lang/rust#147319)) is raised.
  This may raise a new warning ([`ambiguous_panic_imports`](rust-lang/rust#147319)) on `#![no_std]` code glob importing the std crate.
  Both `core::panic!` and `std::panic!` are then in scope and which is used is ambiguous.
- [Don't strip shebang in expression-context `include!(…)`s](rust-lang/rust#146377)
  This can cause previously working includes to no longer compile if they included files which started with a shebang.
- [Ambiguous glob reexports are now also visible cross-crate](rust-lang/rust#147984)
  This unifies behavior between local and cross-crate errors on these exports, which may introduce new ambiguity errors.
- [Don't normalize where-clauses before checking well-formedness](rust-lang/rust#148477)
- [Introduce a future compatibility warning on codegen attributes on body-free trait methods](rust-lang/rust#148756)
  These attributes currently have no effect in this position.
- [On Windows `std::time::SystemTime::checked_sub_duration` will return `None` for times before the Windows epoch (1/1/1601)](rust-lang/rust#148825)
- [Lifetime identifiers such as `'a` are now NFC normalized](rust-lang/rust#149192).
- [Overhaul filename handling for cross-compiler consistency](rust-lang/rust#149709)
  Any paths emitted by compiler now always respect the relative-ness of the paths and `--remap-path-prefix` given originally.
  One side-effect of this change is that paths emitted for local crates in Cargo (path dependencies and workspace members) are no longer absolute but relative when emitted as part of a diagnostic in a downstream crate.

<a id="1.94.0-Internal-Changes"></a>

## Internal Changes

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Switch to `annotate-snippets` for error emission](rust-lang/rust#150032)
  This should preserve mostly the same outputs in rustc error messages.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41NS4zIiwidXBkYXRlZEluVmVyIjoiNDMuNTUuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-build-execution Area: anything dealing with executing the compiler A-build-scripts Area: build.rs scripts A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation Command-run Command-test disposition-merge FCP with intent to merge finished-final-comment-period FCP complete T-cargo Team: Cargo to-announce

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants