Skip to content

Commit

Permalink
test(trim-paths): demonstrate not work properly with -Zbuild-std
Browse files Browse the repository at this point in the history
  • Loading branch information
weihanglo committed Nov 28, 2023
1 parent b4c2bef commit d6b46bf
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tests/build-std/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,46 @@ fn custom_test_framework() {
.build_std_arg("core")
.run();
}

// Fixing rust-lang/rust#117839.
// on macOS it never gets remapped.
// Might be a separate issue, so only run on Linux.
#[cargo_test(build_std_real)]
#[cfg(target_os = "linux")]
fn remap_path_scope() {
let p = project()
.file(
"src/main.rs",
"
fn main() {
panic!(\"remap to /rustc/<hash>\");
}
",
)
.file(
".cargo/config.toml",
"
[profile.release]
debug = \"line-tables-only\"
",
)
.build();

p.cargo("run --release -Ztrim-paths")
.masquerade_as_nightly_cargo(&["-Ztrim-paths"])
.env("RUST_BACKTRACE", "1")
.build_std()
.target_host()
.with_status(101)
.with_stderr_contains(
"\
[FINISHED] release [optimized + debuginfo] [..]
[RUNNING] [..]
[..]thread '[..]' panicked at [..]src/main.rs:3:[..]",
)
.with_stderr_contains("remap to /rustc/<hash>")
.with_stderr_contains("[..]at std-0.0.0/src/[..]")
.with_stderr_contains("[..]at src/main.rs:3[..]")
.with_stderr_contains("[..]at core-0.0.0/src/[..]")
.run();
}

0 comments on commit d6b46bf

Please sign in to comment.