about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-12 15:24:18 -0400
committerOneirical <manchot@videotron.ca>2024-07-19 12:27:47 -0400
commit8a09f2231d91fad0ff09ec4d4b3a89ff0376f860 (patch)
tree179048c193e743f723070f8b5605695b6a4e0d3f
parent1a4fba5eb089d0c5413ed615c6e276eb76969535 (diff)
downloadrust-8a09f2231d91fad0ff09ec4d4b3a89ff0376f860.tar.gz
rust-8a09f2231d91fad0ff09ec4d4b3a89ff0376f860.zip
rewrite extern-fn-generic to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/extern-fn-generic/Makefile7
-rw-r--r--tests/run-make/extern-fn-generic/rmake.rs15
3 files changed, 15 insertions, 8 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 0defdb37363..ef18b6f16a2 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -20,7 +20,6 @@ run-make/emit-to-stdout/Makefile
 run-make/export-executable-symbols/Makefile
 run-make/extern-diff-internal-name/Makefile
 run-make/extern-flag-disambiguates/Makefile
-run-make/extern-fn-generic/Makefile
 run-make/extern-fn-reachable/Makefile
 run-make/extern-fn-with-union/Makefile
 run-make/extern-multiple-copies/Makefile
diff --git a/tests/run-make/extern-fn-generic/Makefile b/tests/run-make/extern-fn-generic/Makefile
deleted file mode 100644
index 7dceea6cb88..00000000000
--- a/tests/run-make/extern-fn-generic/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all: $(call NATIVE_STATICLIB,test)
-	$(RUSTC) testcrate.rs
-	$(RUSTC) test.rs
-	$(call RUN,test) || exit 1
diff --git a/tests/run-make/extern-fn-generic/rmake.rs b/tests/run-make/extern-fn-generic/rmake.rs
new file mode 100644
index 00000000000..3dee1e20544
--- /dev/null
+++ b/tests/run-make/extern-fn-generic/rmake.rs
@@ -0,0 +1,15 @@
+// Generic types in foreign-function interfaces were introduced in #15831 - this
+// test simply runs a Rust program containing generics that is also reliant on
+// a C library, and checks that compilation and execution are successful.
+// See https://github.com/rust-lang/rust/pull/15831
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+use run_make_support::{build_native_static_lib, run, rustc};
+
+fn main() {
+    build_native_static_lib("test");
+    rustc().input("testcrate.rs").run();
+    rustc().input("test.rs").run();
+    run("test");
+}