Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalized paths in stderr files #4

Closed
winksaville opened this issue May 18, 2022 · 1 comment
Closed

Normalized paths in stderr files #4

winksaville opened this issue May 18, 2022 · 1 comment

Comments

@winksaville
Copy link
Contributor

I spent a little time looking at why when I run TRYBUILD=overwrite carto test the *.stderr files do not have $DIR/xxx in the output. My conclusion is the compiler use to include the $DIR/xxx output, but now outputs the actual path.

You can see that in this change on trybuild the stderr test files were updated and they do not have the $DIR/xxx:

wink@3900x 22-05-18T00:16:29.992Z:~/prgs/rust/clones/dtolnay-trybuild (master)
$ git diff 6cbc5a2843a66dfe934479cf2cf31afbe4b4dbb3^ 6cbc5a2843a66dfe934479cf2cf31afbe4b4dbb3
diff --git a/tests/ui/compile-fail-2.stderr b/tests/ui/compile-fail-2.stderr
index a59ae39..daa33d4 100644
--- a/tests/ui/compile-fail-2.stderr
+++ b/tests/ui/compile-fail-2.stderr
@@ -1,5 +1,5 @@
 error: ERROR
- --> $DIR/compile-fail-2.rs:1:1
+ --> tests/ui/compile-fail-2.rs:1:1
   |
 1 | compile_error!("ERROR");
   | ^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/compile-fail-3.stderr b/tests/ui/compile-fail-3.stderr
index 27619cf..7fc2291 100644
--- a/tests/ui/compile-fail-3.stderr
+++ b/tests/ui/compile-fail-3.stderr
@@ -1,5 +1,5 @@
 error[E0277]: `*mut _` cannot be shared between threads safely
-   --> $DIR/compile-fail-3.rs:7:5
+   --> tests/ui/compile-fail-3.rs:7:5
     |
 7   |     thread::spawn(|| {
     |     ^^^^^^^^^^^^^ `*mut _` cannot be shared between threads safely
wink@3900x 22-05-18T00:16:44.332Z:~/prgs/rust/clones/dtolnay-trybuild (master)

So my suggestion is that in the future we don't manually add the $DIR/ and instead use the generated files as is. If you'd like I can create another PR with the those unmodified files.

@japaric
Copy link
Contributor

japaric commented May 20, 2022

thanks for the report. I'd like to keep the content of this repo in line with the content of the blog post and not modify either so, I have pinned the compiler version and dependencies in e431fcd . This way others should be able to reproduce the results regardless of what their default toolchain is.

@japaric japaric closed this as completed May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants