about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-05 15:14:55 -0400
committerOneirical <manchot@videotron.ca>2024-07-12 10:57:58 -0400
commit87c7a42ba92d341c6d4a330a5d4c02b839158c1e (patch)
tree3c45864c59e8173cf64e35fc18c1d62a95990055
parentf768db6ba6d8415fab3bd51ec85ebf41f2209f7e (diff)
downloadrust-87c7a42ba92d341c6d4a330a5d4c02b839158c1e.tar.gz
rust-87c7a42ba92d341c6d4a330a5d4c02b839158c1e.zip
rewrite rustc-macro-dep-files to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/rustc-macro-dep-files/Makefile11
-rw-r--r--tests/run-make/rustc-macro-dep-files/rmake.rs13
3 files changed, 13 insertions, 12 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 33120cf93f9..22edea79adf 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -116,7 +116,6 @@ run-make/return-non-c-like-enum-from-c/Makefile
 run-make/rlib-format-packed-bundled-libs-2/Makefile
 run-make/rlib-format-packed-bundled-libs-3/Makefile
 run-make/rlib-format-packed-bundled-libs/Makefile
-run-make/rustc-macro-dep-files/Makefile
 run-make/sanitizer-cdylib-link/Makefile
 run-make/sanitizer-dylib-link/Makefile
 run-make/sanitizer-staticlib-link/Makefile
diff --git a/tests/run-make/rustc-macro-dep-files/Makefile b/tests/run-make/rustc-macro-dep-files/Makefile
deleted file mode 100644
index 76d713c4bb3..00000000000
--- a/tests/run-make/rustc-macro-dep-files/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-include ../tools.mk
-
-# FIXME(eddyb) provide `HOST_RUSTC` and `TARGET_RUSTC`
-# instead of hardcoding them everywhere they're needed.
-ifeq ($(IS_MUSL_HOST),1)
-ADDITIONAL_ARGS := $(RUSTFLAGS)
-endif
-all:
-	$(BARE_RUSTC) $(ADDITIONAL_ARGS) foo.rs --out-dir $(TMPDIR)
-	$(RUSTC) bar.rs --target $(TARGET) --emit dep-info
-	$(CGREP) -v "proc-macro source" < $(TMPDIR)/bar.d
diff --git a/tests/run-make/rustc-macro-dep-files/rmake.rs b/tests/run-make/rustc-macro-dep-files/rmake.rs
new file mode 100644
index 00000000000..b90e719b7d6
--- /dev/null
+++ b/tests/run-make/rustc-macro-dep-files/rmake.rs
@@ -0,0 +1,13 @@
+// --emit dep-info used to print all macro-generated code it could
+// find as if it was part of a nonexistent file named "proc-macro source",
+// which is not a valid path. After this was fixed in #36776, this test checks
+// that macro code is not falsely seen as coming from a different file in dep-info.
+// See https://github.com/rust-lang/rust/issues/36625
+
+use run_make_support::{fs_wrapper, rustc, target};
+
+fn main() {
+    rustc().input("foo.rs").run();
+    rustc().input("bar.rs").target(target()).emit("dep-info").run();
+    assert!(!fs_wrapper::read_to_string("bar.d").contains("proc-macro source"));
+}