diff options
| author | Michael Goulet <michael@errs.io> | 2025-02-24 19:21:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-24 19:21:47 -0500 |
| commit | 8f729e9cff08e6a4c1c1b341cd4a1bf4d85e06c4 (patch) | |
| tree | 67b0387df6d7bbc1eeefbdb50678a254a4e09fec /src | |
| parent | 828a3a41b3f18d183f4487701abfd9cd39bced3a (diff) | |
| parent | 6eea027aa9453b685ac636ea40fc826267afab2a (diff) | |
| download | rust-8f729e9cff08e6a4c1c1b341cd4a1bf4d85e06c4.tar.gz rust-8f729e9cff08e6a4c1c1b341cd4a1bf4d85e06c4.zip | |
Rollup merge of #137489 - RalfJung:no-more-rustc_intrinsic_must_be_overridden, r=oli-obk
remove `#[rustc_intrinsic_must_be_overridde]` In https://github.com/rust-lang/rust/pull/135031, we gained support for just leaving away the body. Now that the bootstrap compiler got bumped, stop using the old style and remove support for it. r? `@oli-obk` There are a few more mentions of this attribute in RA code that I didn't touch; Cc `@rust-lang/rust-analyzer`
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/unstable-book/src/language-features/intrinsics.md | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/doc/unstable-book/src/language-features/intrinsics.md b/src/doc/unstable-book/src/language-features/intrinsics.md index 13a6814d31b..975b400447e 100644 --- a/src/doc/unstable-book/src/language-features/intrinsics.md +++ b/src/doc/unstable-book/src/language-features/intrinsics.md @@ -62,13 +62,19 @@ These must be implemented by all backends. ### `#[rustc_intrinsic]` declarations -These are written like intrinsics with fallback bodies, but the body is irrelevant. -Use `loop {}` for the body or call the intrinsic recursively and add -`#[rustc_intrinsic_must_be_overridden]` to the function to ensure that backends don't -invoke the body. +These are written without a body: +```rust +#![feature(intrinsics)] +#![allow(internal_features)] + +#[rustc_intrinsic] +pub fn abort() -> !; +``` ### Legacy extern ABI based intrinsics +*This style is deprecated, always prefer the above form.* + These are imported as if they were FFI functions, with the special `rust-intrinsic` ABI. For example, if one was in a freestanding context, but wished to be able to `transmute` between types, and |
