Skip to content

Commit eab2f93

Browse files
committed
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
1 parent 57d14e4 commit eab2f93

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

.cargo/config.toml

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

0 commit comments

Comments
 (0)