about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-08 13:54:04 -0400
committerOneirical <manchot@videotron.ca>2024-07-17 15:33:06 -0400
commita795d8998d6715044a4e28ffda90a251a780eae1 (patch)
tree0d94a8ad1835ae38233821b82e3b8c191fe07e4d
parenta47ca1913469e574369e6ddc28f124e5c9e9e13a (diff)
downloadrust-a795d8998d6715044a4e28ffda90a251a780eae1.tar.gz
rust-a795d8998d6715044a4e28ffda90a251a780eae1.zip
rewrite and rename issue-25581
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/extern-fn-slice-no-ice/rmake.rs17
-rw-r--r--tests/run-make/extern-fn-slice-no-ice/test.c (renamed from tests/run-make/issue-25581/test.c)0
-rw-r--r--tests/run-make/extern-fn-slice-no-ice/test.rs (renamed from tests/run-make/issue-25581/test.rs)0
-rw-r--r--tests/run-make/issue-25581/Makefile6
5 files changed, 17 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 e016d3f1139..5a7fe935e70 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -44,7 +44,6 @@ run-make/issue-107094/Makefile
 run-make/issue-14698/Makefile
 run-make/issue-15460/Makefile
 run-make/issue-22131/Makefile
-run-make/issue-25581/Makefile
 run-make/issue-26006/Makefile
 run-make/issue-28595/Makefile
 run-make/issue-33329/Makefile
diff --git a/tests/run-make/extern-fn-slice-no-ice/rmake.rs b/tests/run-make/extern-fn-slice-no-ice/rmake.rs
new file mode 100644
index 00000000000..1f1bbd33127
--- /dev/null
+++ b/tests/run-make/extern-fn-slice-no-ice/rmake.rs
@@ -0,0 +1,17 @@
+// Slices were broken when implicated in foreign-function interface (FFI) with
+// a C library, with something as simple as measuring the length or returning
+// an item at a certain index of a slice would cause an internal compiler error (ICE).
+// This was fixed in #25653, and this test checks that slices in Rust-C FFI can be part
+// of a program that compiles and executes successfully.
+// See https://github.com/rust-lang/rust/issues/25581
+
+//@ 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("test.rs").run();
+    run("test");
+}
diff --git a/tests/run-make/issue-25581/test.c b/tests/run-make/extern-fn-slice-no-ice/test.c
index 52fbf78510a..52fbf78510a 100644
--- a/tests/run-make/issue-25581/test.c
+++ b/tests/run-make/extern-fn-slice-no-ice/test.c
diff --git a/tests/run-make/issue-25581/test.rs b/tests/run-make/extern-fn-slice-no-ice/test.rs
index ba6749c9722..ba6749c9722 100644
--- a/tests/run-make/issue-25581/test.rs
+++ b/tests/run-make/extern-fn-slice-no-ice/test.rs
diff --git a/tests/run-make/issue-25581/Makefile b/tests/run-make/issue-25581/Makefile
deleted file mode 100644
index 3cbbf383996..00000000000
--- a/tests/run-make/issue-25581/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-all: $(call NATIVE_STATICLIB,test)
-	$(RUSTC) test.rs
-	$(call RUN,test) || exit 1