diff options
| author | Ralf Jung <post@ralfj.de> | 2024-11-07 08:59:43 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-11-08 09:16:00 +0100 |
| commit | e3010e84dbf2e06424c91c5a3d4206c1911813bd (patch) | |
| tree | e79c95932b5c88f5313d5eb5e45b3c3c41ed7b9f /compiler/rustc_error_codes | |
| parent | 78bb5ee79e0261e8e47476b631da02acc1cb03ef (diff) | |
| download | rust-e3010e84dbf2e06424c91c5a3d4206c1911813bd.tar.gz rust-e3010e84dbf2e06424c91c5a3d4206c1911813bd.zip | |
remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead
Diffstat (limited to 'compiler/rustc_error_codes')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0094.md | 22 | ||||
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0211.md | 10 |
2 files changed, 17 insertions, 15 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0094.md b/compiler/rustc_error_codes/src/error_codes/E0094.md index d8c1a3cb55c..efbfa0851a8 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0094.md +++ b/compiler/rustc_error_codes/src/error_codes/E0094.md @@ -3,13 +3,15 @@ An invalid number of generic parameters was passed to an intrinsic function. Erroneous code example: ```compile_fail,E0094 -#![feature(intrinsics, rustc_attrs)] +#![feature(intrinsics)] #![allow(internal_features)] -extern "rust-intrinsic" { - #[rustc_safe_intrinsic] - fn size_of<T, U>() -> usize; // error: intrinsic has wrong number - // of type parameters +#[rustc_intrinsic] +#[rustc_intrinsic_must_be_overridden] +fn size_of<T, U>() -> usize // error: intrinsic has wrong number + // of type parameters +{ + loop {} } ``` @@ -18,11 +20,13 @@ and verify with the function declaration in the Rust source code. Example: ``` -#![feature(intrinsics, rustc_attrs)] +#![feature(intrinsics)] #![allow(internal_features)] -extern "rust-intrinsic" { - #[rustc_safe_intrinsic] - fn size_of<T>() -> usize; // ok! +#[rustc_intrinsic] +#[rustc_intrinsic_must_be_overridden] +fn size_of<T>() -> usize // ok! +{ + loop {} } ``` diff --git a/compiler/rustc_error_codes/src/error_codes/E0211.md b/compiler/rustc_error_codes/src/error_codes/E0211.md index 19a482f6c93..7aa42628549 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0211.md +++ b/compiler/rustc_error_codes/src/error_codes/E0211.md @@ -4,12 +4,11 @@ You used a function or type which doesn't fit the requirements for where it was used. Erroneous code examples: ```compile_fail -#![feature(intrinsics, rustc_attrs)] +#![feature(intrinsics)] #![allow(internal_features)] extern "rust-intrinsic" { - #[rustc_safe_intrinsic] - fn size_of<T>(); // error: intrinsic has wrong type + fn unreachable(); // error: intrinsic has wrong type } // or: @@ -41,12 +40,11 @@ impl Foo { For the first code example, please check the function definition. Example: ``` -#![feature(intrinsics, rustc_attrs)] +#![feature(intrinsics)] #![allow(internal_features)] extern "rust-intrinsic" { - #[rustc_safe_intrinsic] - fn size_of<T>() -> usize; // ok! + fn unreachable() -> !; // ok! } ``` |
