Skip to content

Commit e41b2a4

Browse files
authored
Rollup merge of #139490 - RalfJung:unstable-intrinsics-docs, r=oli-obk
Update some comment/docs related to "extern intrinsic" removal Follow-up to #139455. r? `@oli-obk`
2 parents 8ba06a7 + a7400a8 commit e41b2a4

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

library/core/src/intrinsics/mod.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@
55
//!
66
//! # Const intrinsics
77
//!
8-
//! Note: any changes to the constness of intrinsics should be discussed with the language team.
9-
//! This includes changes in the stability of the constness.
10-
//!
11-
//! //FIXME(#132735) "old" style intrinsics support has been removed
12-
//! In order to make an intrinsic usable at compile-time, it needs to be declared in the "new"
13-
//! style, i.e. as a `#[rustc_intrinsic]` function, not inside an `extern` block. Then copy the
14-
//! implementation from <https://github.com/rust-lang/miri/blob/master/src/intrinsics> to
8+
//! In order to make an intrinsic unstable usable at compile-time, copy the implementation from
9+
//! <https://github.com/rust-lang/miri/blob/master/src/intrinsics> to
1510
//! <https://github.com/rust-lang/rust/blob/master/compiler/rustc_const_eval/src/interpret/intrinsics.rs>
16-
//! and make the intrinsic declaration a `const fn`.
11+
//! and make the intrinsic declaration below a `const fn`. This should be done in coordination with
12+
//! wg-const-eval.
1713
//!
1814
//! If an intrinsic is supposed to be used from a `const fn` with a `rustc_const_stable` attribute,
1915
//! `#[rustc_intrinsic_const_stable_indirect]` needs to be added to the intrinsic. Such a change requires

src/doc/unstable-book/src/language-features/intrinsics.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ Various intrinsics have native MIR operations that they correspond to. Instead o
5353
backends to implement both the intrinsic and the MIR operation, the `lower_intrinsics` pass
5454
will convert the calls to the MIR operation. Backends do not need to know about these intrinsics
5555
at all. These intrinsics only make sense without a body, and can be declared as a `#[rustc_intrinsic]`.
56-
The body is never used, as calls to the intrinsic do not exist anymore after MIR analyses.
56+
The body is never used as the lowering pass implements support for all backends, so we never have to
57+
use the fallback logic.
5758

5859
## Intrinsics without fallback logic
5960

0 commit comments

Comments
 (0)