about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/static-extern-type/Makefile6
-rw-r--r--tests/run-make/static-extern-type/rmake.rs16
3 files changed, 16 insertions, 7 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 2f2af6b8bc1..51614f84ec3 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -108,7 +108,6 @@ run-make/simd-ffi/Makefile
 run-make/split-debuginfo/Makefile
 run-make/stable-symbol-names/Makefile
 run-make/static-dylib-by-default/Makefile
-run-make/static-extern-type/Makefile
 run-make/staticlib-blank-lib/Makefile
 run-make/staticlib-dylib-linkage/Makefile
 run-make/symbol-mangling-hashed/Makefile
diff --git a/tests/run-make/static-extern-type/Makefile b/tests/run-make/static-extern-type/Makefile
deleted file mode 100644
index 77897154322..00000000000
--- a/tests/run-make/static-extern-type/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all: $(call NATIVE_STATICLIB,define-foo)
-	$(RUSTC) -ldefine-foo use-foo.rs
-	$(call RUN,use-foo) || exit 1
diff --git a/tests/run-make/static-extern-type/rmake.rs b/tests/run-make/static-extern-type/rmake.rs
new file mode 100644
index 00000000000..d30153f9c68
--- /dev/null
+++ b/tests/run-make/static-extern-type/rmake.rs
@@ -0,0 +1,16 @@
+// Static variables coming from a C library through foreign function interface (FFI) are unsized
+// at compile time - and assuming they are sized used to cause an internal compiler error (ICE).
+// After this was fixed in #58192, this test checks that external statics can be safely used in
+// a program that both compiles and executes successfully.
+// See https://github.com/rust-lang/rust/issues/57876
+
+//@ 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("define-foo");
+    rustc().arg("-ldefine-foo").input("use-foo.rs").run();
+    run("use-foo");
+}