test: Ensure snapbox works until CARGO_RUSTC_CURRENT_DIR is stabilized

Snapbox's polyfill for `CARGO_RUSTC_CURRENT_DIR` looks for the furthest
away `Cargo.toml`.
That works in our repo but won't work as a submodule in rustc.
This uses the `config.toml` hack for setting the variable.

I verified
- Without this, the polyfill is used
- With this, it is used
- Without this on nightly, the official `CARGO_RUSTC_CURRENT_DIR` is
  used
This commit is contained in:
Ed Page 2024-02-16 10:26:03 -06:00
parent 57d14e4784
commit eab2f93453
1 changed files with 5 additions and 0 deletions

View File

@ -2,3 +2,8 @@
build-man = "run --package xtask-build-man --"
stale-label = "run --package xtask-stale-label --"
bump-check = "run --package xtask-bump-check --"
[env]
# HACK: Until this is stabilized, `snapbox`s polyfill could get confused
# inside of the rust-lang/rust repo because it looks for the furthest-away `Cargo.toml`
CARGO_RUSTC_CURRENT_DIR = { value = "", relative = true }