Skip to content

Commit

Permalink
Make -Zsimulate-remapped-rust-src-base reproducible on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Dec 7, 2022
1 parent 8aff391 commit 717fdb5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/test/ui/consts/missing_span_in_backtrace.rs
Original file line number Diff line number Diff line change
@@ -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)]
Expand Down
10 changes: 5 additions & 5 deletions src/test/ui/consts/missing_span_in_backtrace.stderr
Original file line number Diff line number Diff line change
@@ -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
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/span/issue-71363.rs
Original file line number Diff line number Diff line change
@@ -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 {}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/span/issue-71363.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand All @@ -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)]`
Expand Down
2 changes: 2 additions & 0 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3542,6 +3542,8 @@ impl<'test> TestCx<'test> {
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 {
Expand Down

0 comments on commit 717fdb5

Please sign in to comment.