summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates/feature-gate-abi.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /tests/ui/feature-gates/feature-gate-abi.rs
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/feature-gates/feature-gate-abi.rs')
-rw-r--r--tests/ui/feature-gates/feature-gate-abi.rs60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/ui/feature-gates/feature-gate-abi.rs b/tests/ui/feature-gates/feature-gate-abi.rs
new file mode 100644
index 000000000..712655f97
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-abi.rs
@@ -0,0 +1,60 @@
+// gate-test-intrinsics
+// gate-test-platform_intrinsics
+// compile-flags: --crate-type=rlib
+
+#![feature(no_core, lang_items)]
+#![no_core]
+
+#[lang="sized"]
+trait Sized { }
+
+#[lang="tuple_trait"]
+trait Tuple { }
+
+// Functions
+extern "rust-intrinsic" fn f1() {} //~ ERROR intrinsics are subject to change
+ //~^ ERROR intrinsic must be in
+extern "platform-intrinsic" fn f2() {} //~ ERROR platform intrinsics are experimental
+ //~^ ERROR intrinsic must be in
+extern "rust-call" fn f4(_: ()) {} //~ ERROR rust-call ABI is subject to change
+
+// Methods in trait definition
+trait Tr {
+ extern "rust-intrinsic" fn m1(); //~ ERROR intrinsics are subject to change
+ //~^ ERROR intrinsic must be in
+ extern "platform-intrinsic" fn m2(); //~ ERROR platform intrinsics are experimental
+ //~^ ERROR intrinsic must be in
+ extern "rust-call" fn m4(_: ()); //~ ERROR rust-call ABI is subject to change
+
+ extern "rust-call" fn dm4(_: ()) {} //~ ERROR rust-call ABI is subject to change
+}
+
+struct S;
+
+// Methods in trait impl
+impl Tr for S {
+ extern "rust-intrinsic" fn m1() {} //~ ERROR intrinsics are subject to change
+ //~^ ERROR intrinsic must be in
+ extern "platform-intrinsic" fn m2() {} //~ ERROR platform intrinsics are experimental
+ //~^ ERROR intrinsic must be in
+ extern "rust-call" fn m4(_: ()) {} //~ ERROR rust-call ABI is subject to change
+}
+
+// Methods in inherent impl
+impl S {
+ extern "rust-intrinsic" fn im1() {} //~ ERROR intrinsics are subject to change
+ //~^ ERROR intrinsic must be in
+ extern "platform-intrinsic" fn im2() {} //~ ERROR platform intrinsics are experimental
+ //~^ ERROR intrinsic must be in
+ extern "rust-call" fn im4(_: ()) {} //~ ERROR rust-call ABI is subject to change
+}
+
+// Function pointer types
+type A1 = extern "rust-intrinsic" fn(); //~ ERROR intrinsics are subject to change
+type A2 = extern "platform-intrinsic" fn(); //~ ERROR platform intrinsics are experimental
+type A4 = extern "rust-call" fn(_: ()); //~ ERROR rust-call ABI is subject to change
+
+// Foreign modules
+extern "rust-intrinsic" {} //~ ERROR intrinsics are subject to change
+extern "platform-intrinsic" {} //~ ERROR platform intrinsics are experimental
+extern "rust-call" {} //~ ERROR rust-call ABI is subject to change