summaryrefslogtreecommitdiffstats
path: root/src/tools/cargo/tests/build-std
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /src/tools/cargo/tests/build-std
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/cargo/tests/build-std')
-rw-r--r--src/tools/cargo/tests/build-std/main.rs45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/tools/cargo/tests/build-std/main.rs b/src/tools/cargo/tests/build-std/main.rs
index 47a4bb671..c905deb49 100644
--- a/src/tools/cargo/tests/build-std/main.rs
+++ b/src/tools/cargo/tests/build-std/main.rs
@@ -18,6 +18,8 @@
//! `CARGO_RUN_BUILD_STD_TESTS` env var to be set to actually run these tests.
//! Otherwise the tests are skipped.
+#![allow(clippy::disallowed_methods)]
+
use cargo_test_support::*;
use std::env;
use std::path::Path;
@@ -227,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 /rustc/[..]/library/std/src/[..]")
+ .with_stderr_contains("[..]at src/main.rs:3[..]")
+ .with_stderr_contains("[..]at /rustc/[..]/library/core/src/[..]")
+ .run();
+}