Prevent local paths into libstd from leaking into ui tests
This commit is contained in:
parent
5a7fc9b33a
commit
849c565e2f
@ -34,7 +34,7 @@ error[E0643]: method `hash` has incompatible signature for trait
|
||||
LL | fn hash(&self, hasher: &mut impl Hasher) {}
|
||||
| ^^^^^^^^^^^ expected generic parameter, found `impl Trait`
|
||||
|
|
||||
::: /home/oliver/Projects/rust/rust3/src/libcore/hash/mod.rs:185:13
|
||||
::: $SRC_DIR/libcore/hash/mod.rs:185:13
|
||||
|
|
||||
LL | fn hash<H: Hasher>(&self, state: &mut H);
|
||||
| - declaration in trait here
|
||||
|
@ -2861,6 +2861,15 @@ impl<'test> TestCx<'test> {
|
||||
|
||||
let mut normalized = output.replace(&parent_dir_str, "$DIR");
|
||||
|
||||
// Paths into the libstd/libcore
|
||||
let src_dir = self.config.src_base.parent().unwrap().parent().unwrap();
|
||||
let src_dir_str = if json {
|
||||
src_dir.display().to_string().replace("\\", "\\\\")
|
||||
} else {
|
||||
src_dir.display().to_string()
|
||||
};
|
||||
normalized = normalized.replace(&src_dir_str, "$SRC_DIR");
|
||||
|
||||
if json {
|
||||
// escaped newlines in json strings should be readable
|
||||
// in the stderr files. There's no point int being correct,
|
||||
|
Loading…
x
Reference in New Issue
Block a user