diff options
| author | bors <bors@rust-lang.org> | 2025-04-07 12:58:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-04-07 12:58:15 +0000 |
| commit | e643f59f6da3a84f43e75dea99afaa5b041ea6bf (patch) | |
| tree | a5449e907bcfbb64285463eaa9ab0d29775f8fe6 /src/doc | |
| parent | 8fb32ab8e563124fe0968a2878b7f5b5d0e8d722 (diff) | |
| parent | 6e0b67419c71b0adcd6108d268d7eda5330bd392 (diff) | |
| download | rust-e643f59f6da3a84f43e75dea99afaa5b041ea6bf.tar.gz rust-e643f59f6da3a84f43e75dea99afaa5b041ea6bf.zip | |
Auto merge of #139482 - Zalathar:rollup-h2ht1y6, r=Zalathar
Rollup of 9 pull requests Successful merges: - #139035 (Add new `PatKind::Missing` variants) - #139108 (Simplify `thir::PatKind::ExpandedConstant`) - #139112 (Implement `super let`) - #139365 (Default auto traits: fix perf) - #139397 (coverage: Build the CGU's global file table as late as possible) - #139455 ( Remove support for `extern "rust-intrinsic"` blocks) - #139461 (Stop calling `source_span` query in significant drop order code) - #139465 (add sret handling for scalar autodiff) - #139466 (Trivial tweaks to stop tracking source span directly) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/unstable-book/src/language-features/intrinsics.md | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/doc/unstable-book/src/language-features/intrinsics.md b/src/doc/unstable-book/src/language-features/intrinsics.md index 975b400447e..a0e38f340f5 100644 --- a/src/doc/unstable-book/src/language-features/intrinsics.md +++ b/src/doc/unstable-book/src/language-features/intrinsics.md @@ -52,9 +52,8 @@ with any regular function. Various intrinsics have native MIR operations that they correspond to. Instead of requiring backends to implement both the intrinsic and the MIR operation, the `lower_intrinsics` pass will convert the calls to the MIR operation. Backends do not need to know about these intrinsics -at all. These intrinsics only make sense without a body, and can either be declared as a "rust-intrinsic" -or as a `#[rustc_intrinsic]`. The body is never used, as calls to the intrinsic do not exist -anymore after MIR analyses. +at all. These intrinsics only make sense without a body, and can be declared as a `#[rustc_intrinsic]`. +The body is never used, as calls to the intrinsic do not exist anymore after MIR analyses. ## Intrinsics without fallback logic @@ -70,28 +69,3 @@ These are written without a body: #[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 -perform efficient pointer arithmetic, one would import those functions -via a declaration like - -```rust -#![feature(intrinsics)] -#![allow(internal_features)] -# fn main() {} - -extern "rust-intrinsic" { - fn transmute<T, U>(x: T) -> U; - - fn arith_offset<T>(dst: *const T, offset: isize) -> *const T; -} -``` - -As with any other FFI functions, these are by default always `unsafe` to call. -You can add `#[rustc_safe_intrinsic]` to the intrinsic to make it safe to call. |
