]> git.lizzy.rs Git - rust.git/commitdiff
Make -Zsimulate-remapped-rust-src-base reproducible on CI
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 7 Dec 2022 10:36:08 +0000 (10:36 +0000)
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>
Wed, 7 Dec 2022 10:36:08 +0000 (10:36 +0000)
src/test/ui/consts/missing_span_in_backtrace.rs
src/test/ui/consts/missing_span_in_backtrace.stderr
src/test/ui/span/issue-71363.rs
src/test/ui/span/issue-71363.stderr
src/tools/compiletest/src/runtest.rs

index 2db54db4af1ca5dccaafa2ca9176df5f9ad23afb..c4930b73aaab8996def56ae74f102f09f8c823a4 100644 (file)
@@ -1,4 +1,4 @@
-// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/xyz -Z translate-remapped-path-to-local-path=no -Z ui-testing=no
+// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ui-testing=no
 // normalize-stderr-test "alloc[0-9]+" -> "ALLOC_ID"
 
 #![feature(const_swap)]
index 579c8da1e8f97571b02fc8fec0fa6d9616a2502f..e6d3d51990dd502f5748ab7e47a583ff961c359e 100644 (file)
@@ -1,18 +1,18 @@
 error[E0080]: evaluation of constant value failed
-  --> /rustc/xyz/library/core/src/ptr/mod.rs:1135:9
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
    |
    = note: unable to copy parts of a pointer from memory at ALLOC_ID
    |
    = help: this code performed an operation that depends on the underlying bytes representing a pointer
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 note: inside `std::ptr::read::<MaybeUninit<MaybeUninit<u8>>>`
-  --> /rustc/xyz/library/core/src/ptr/mod.rs:1135:9
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
 note: inside `mem::swap_simple::<MaybeUninit<MaybeUninit<u8>>>`
-  --> /rustc/xyz/library/core/src/mem/mod.rs:773:17
+  --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
 note: inside `ptr::swap_nonoverlapping_simple_untyped::<MaybeUninit<u8>>`
-  --> /rustc/xyz/library/core/src/ptr/mod.rs:944:9
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
 note: inside `swap_nonoverlapping::<MaybeUninit<u8>>`
-  --> /rustc/xyz/library/core/src/ptr/mod.rs:925:14
+  --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
 note: inside `X`
   --> $DIR/missing_span_in_backtrace.rs:17:9
    |
index bbb4a93623b144b8d182c675c292b2f3a4e25511..f187d0efa8451abe60bfae1fe0f013ac6439b06d 100644 (file)
@@ -1,4 +1,4 @@
-// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/xyz -Z translate-remapped-path-to-local-path=no -Z ui-testing=no
+// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ui-testing=no
 
 struct MyError;
 impl std::error::Error for MyError {}
index 789a386bf66d1c6abff43351c1b82674308db56a..0370e46e6ceb749c82ae6166a7de3f06aaff7da6 100644 (file)
@@ -7,7 +7,7 @@ error[E0277]: `MyError` doesn't implement `std::fmt::Display`
   = help: the trait `std::fmt::Display` is not implemented for `MyError`
   = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
 note: required by a bound in `std::error::Error`
- --> /rustc/xyz/library/core/src/error.rs:31:26
+ --> $SRC_DIR/core/src/error.rs:LL:COL
   |
   = note: required by this bound in `std::error::Error`
 
@@ -20,7 +20,7 @@ error[E0277]: `MyError` doesn't implement `Debug`
   = help: the trait `Debug` is not implemented for `MyError`
   = note: add `#[derive(Debug)]` to `MyError` or manually `impl Debug for MyError`
 note: required by a bound in `std::error::Error`
- --> /rustc/xyz/library/core/src/error.rs:31:18
+ --> $SRC_DIR/core/src/error.rs:LL:COL
   |
   = note: required by this bound in `std::error::Error`
 help: consider annotating `MyError` with `#[derive(Debug)]`
index e07b71a7c47802b07e5be842899be0f3706cb896..1542b1c17ad112006df87805d19e354b82bd6fc8 100644 (file)
@@ -3542,6 +3542,8 @@ fn normalize_output(&self, output: &str, custom_rules: &[(String, String)]) -> S
             option_env!("CFG_VIRTUAL_RUST_SOURCE_BASE_DIR").map(PathBuf::from),
             // Virtual `/rustc/$sha` coming from download-rustc:
             std::env::var_os("FAKE_DOWNLOAD_RUSTC_PREFIX").map(PathBuf::from),
+            // Tests using -Zsimulate-remapped-rust-src-base should use this fake path
+            Some("/rustc/FAKE_PREFIX".into()),
         ];
         for base_dir in source_bases {
             if let Some(base_dir) = base_dir {