Skip to content

Commit 717fdb5

Browse files
committed
Make -Zsimulate-remapped-rust-src-base reproducible on CI
1 parent 8aff391 commit 717fdb5

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

Diff for: src/test/ui/consts/missing_span_in_backtrace.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/xyz -Z translate-remapped-path-to-local-path=no -Z ui-testing=no
1+
// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ui-testing=no
22
// normalize-stderr-test "alloc[0-9]+" -> "ALLOC_ID"
33

44
#![feature(const_swap)]

Diff for: src/test/ui/consts/missing_span_in_backtrace.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
error[E0080]: evaluation of constant value failed
2-
--> /rustc/xyz/library/core/src/ptr/mod.rs:1135:9
2+
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
33
|
44
= note: unable to copy parts of a pointer from memory at ALLOC_ID
55
|
66
= help: this code performed an operation that depends on the underlying bytes representing a pointer
77
= help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
88
note: inside `std::ptr::read::<MaybeUninit<MaybeUninit<u8>>>`
9-
--> /rustc/xyz/library/core/src/ptr/mod.rs:1135:9
9+
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
1010
note: inside `mem::swap_simple::<MaybeUninit<MaybeUninit<u8>>>`
11-
--> /rustc/xyz/library/core/src/mem/mod.rs:773:17
11+
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
1212
note: inside `ptr::swap_nonoverlapping_simple_untyped::<MaybeUninit<u8>>`
13-
--> /rustc/xyz/library/core/src/ptr/mod.rs:944:9
13+
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
1414
note: inside `swap_nonoverlapping::<MaybeUninit<u8>>`
15-
--> /rustc/xyz/library/core/src/ptr/mod.rs:925:14
15+
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
1616
note: inside `X`
1717
--> $DIR/missing_span_in_backtrace.rs:17:9
1818
|

Diff for: src/test/ui/span/issue-71363.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/xyz -Z translate-remapped-path-to-local-path=no -Z ui-testing=no
1+
// compile-flags: -Z simulate-remapped-rust-src-base=/rustc/FAKE_PREFIX -Z translate-remapped-path-to-local-path=no -Z ui-testing=no
22

33
struct MyError;
44
impl std::error::Error for MyError {}

Diff for: src/test/ui/span/issue-71363.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ error[E0277]: `MyError` doesn't implement `std::fmt::Display`
77
= help: the trait `std::fmt::Display` is not implemented for `MyError`
88
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
99
note: required by a bound in `std::error::Error`
10-
--> /rustc/xyz/library/core/src/error.rs:31:26
10+
--> $SRC_DIR/core/src/error.rs:LL:COL
1111
|
1212
= note: required by this bound in `std::error::Error`
1313

@@ -20,7 +20,7 @@ error[E0277]: `MyError` doesn't implement `Debug`
2020
= help: the trait `Debug` is not implemented for `MyError`
2121
= note: add `#[derive(Debug)]` to `MyError` or manually `impl Debug for MyError`
2222
note: required by a bound in `std::error::Error`
23-
--> /rustc/xyz/library/core/src/error.rs:31:18
23+
--> $SRC_DIR/core/src/error.rs:LL:COL
2424
|
2525
= note: required by this bound in `std::error::Error`
2626
help: consider annotating `MyError` with `#[derive(Debug)]`

Diff for: src/tools/compiletest/src/runtest.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3542,6 +3542,8 @@ impl<'test> TestCx<'test> {
35423542
option_env!("CFG_VIRTUAL_RUST_SOURCE_BASE_DIR").map(PathBuf::from),
35433543
// Virtual `/rustc/$sha` coming from download-rustc:
35443544
std::env::var_os("FAKE_DOWNLOAD_RUSTC_PREFIX").map(PathBuf::from),
3545+
// Tests using -Zsimulate-remapped-rust-src-base should use this fake path
3546+
Some("/rustc/FAKE_PREFIX".into()),
35453547
];
35463548
for base_dir in source_bases {
35473549
if let Some(base_dir) = base_dir {

0 commit comments

Comments
 (0)