rewrite error-writing-dependencies to rmake

This commit is contained in:
Oneirical 2024-06-19 16:43:22 -04:00
parent 75ee1d74a9
commit f22b5afa6a
3 changed files with 17 additions and 9 deletions

View File

@ -34,7 +34,6 @@ run-make/emit-shared-files/Makefile
run-make/emit-stack-sizes/Makefile
run-make/emit-to-stdout/Makefile
run-make/env-dep-info/Makefile
run-make/error-writing-dependencies/Makefile
run-make/export-executable-symbols/Makefile
run-make/extern-diff-internal-name/Makefile
run-make/extern-flag-disambiguates/Makefile

View File

@ -1,8 +0,0 @@
include ../tools.mk
all:
# Let's get a nice error message
$(BARE_RUSTC) foo.rs --emit dep-info --out-dir foo/bar/baz 2>&1 | \
$(CGREP) "error writing dependencies"
# Make sure the filename shows up
$(BARE_RUSTC) foo.rs --emit dep-info --out-dir foo/bar/baz 2>&1 | $(CGREP) "baz"

View File

@ -0,0 +1,17 @@
// Invalid paths passed to rustc used to cause internal compilation errors
// alongside an obscure error message. This was turned into a standard error,
// and this test checks that the cleaner error message is printed instead.
// See https://github.com/rust-lang/rust/issues/13517
use run_make_support::rustc;
// NOTE: This cannot be a UI test due to the --out-dir flag, which is
// already present by default in UI testing.
fn main() {
let out = rustc().input("foo.rs").emit("dep-info").out_dir("foo/bar/baz").run_fail();
// The error message should be informative.
out.assert_stderr_contains("error writing dependencies");
// The filename should appear.
out.assert_stderr_contains("baz");
}