about summary refs log tree commit diff
path: root/tests/ui/error-codes
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-11-07 08:59:43 +0100
committerRalf Jung <post@ralfj.de>2024-11-08 09:16:00 +0100
commite3010e84dbf2e06424c91c5a3d4206c1911813bd (patch)
treee79c95932b5c88f5313d5eb5e45b3c3c41ed7b9f /tests/ui/error-codes
parent78bb5ee79e0261e8e47476b631da02acc1cb03ef (diff)
downloadrust-e3010e84dbf2e06424c91c5a3d4206c1911813bd.tar.gz
rust-e3010e84dbf2e06424c91c5a3d4206c1911813bd.zip
remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead
Diffstat (limited to 'tests/ui/error-codes')
-rw-r--r--tests/ui/error-codes/E0094.rs13
-rw-r--r--tests/ui/error-codes/E0094.stderr6
-rw-r--r--tests/ui/error-codes/E0308.rs11
-rw-r--r--tests/ui/error-codes/E0308.stderr10
4 files changed, 21 insertions, 19 deletions
diff --git a/tests/ui/error-codes/E0094.rs b/tests/ui/error-codes/E0094.rs
index 97ebcff99dc..da59d3decac 100644
--- a/tests/ui/error-codes/E0094.rs
+++ b/tests/ui/error-codes/E0094.rs
@@ -1,9 +1,10 @@
-#![feature(intrinsics, rustc_attrs)]
+#![feature(intrinsics)]
 
-extern "rust-intrinsic" {
-    #[rustc_safe_intrinsic]
-    fn size_of<T, U>() -> usize; //~ ERROR E0094
+#[rustc_intrinsic]
+#[rustc_intrinsic_must_be_overridden]
+fn size_of<T, U>() -> usize {
+    //~^ ERROR E0094
+    loop {}
 }
 
-fn main() {
-}
+fn main() {}
diff --git a/tests/ui/error-codes/E0094.stderr b/tests/ui/error-codes/E0094.stderr
index 1bad5bd950e..e45cc0ea063 100644
--- a/tests/ui/error-codes/E0094.stderr
+++ b/tests/ui/error-codes/E0094.stderr
@@ -1,8 +1,8 @@
 error[E0094]: intrinsic has wrong number of type parameters: found 2, expected 1
-  --> $DIR/E0094.rs:5:15
+  --> $DIR/E0094.rs:5:11
    |
-LL |     fn size_of<T, U>() -> usize;
-   |               ^^^^^^ expected 1 type parameter
+LL | fn size_of<T, U>() -> usize {
+   |           ^^^^^^ expected 1 type parameter
 
 error: aborting due to 1 previous error
 
diff --git a/tests/ui/error-codes/E0308.rs b/tests/ui/error-codes/E0308.rs
index dd9e0b284ea..f8f93d49a8e 100644
--- a/tests/ui/error-codes/E0308.rs
+++ b/tests/ui/error-codes/E0308.rs
@@ -1,10 +1,11 @@
 #![feature(intrinsics)]
 #![feature(rustc_attrs)]
 
-extern "rust-intrinsic" {
-    #[rustc_safe_intrinsic]
-    fn size_of<T>(); //~ ERROR E0308
+#[rustc_intrinsic]
+#[rustc_intrinsic_must_be_overridden]
+fn size_of<T>() {
+    //~^ ERROR E0308
+    loop {}
 }
 
-fn main() {
-}
+fn main() {}
diff --git a/tests/ui/error-codes/E0308.stderr b/tests/ui/error-codes/E0308.stderr
index 709b3119276..77e5c06e06a 100644
--- a/tests/ui/error-codes/E0308.stderr
+++ b/tests/ui/error-codes/E0308.stderr
@@ -1,11 +1,11 @@
 error[E0308]: intrinsic has wrong type
-  --> $DIR/E0308.rs:6:20
+  --> $DIR/E0308.rs:6:16
    |
-LL |     fn size_of<T>();
-   |                    ^ expected `usize`, found `()`
+LL | fn size_of<T>() {
+   |                ^ expected `usize`, found `()`
    |
-   = note: expected signature `extern "rust-intrinsic" fn() -> usize`
-              found signature `extern "rust-intrinsic" fn() -> ()`
+   = note: expected signature `fn() -> usize`
+              found signature `fn() -> ()`
 
 error: aborting due to 1 previous error