File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 11//! Compiler intrinsics.
22//!
33//! The corresponding definitions are in `librustc_codegen_llvm/intrinsic.rs`.
4+ //! The corresponding const implementations are in `librustc_mir/interpret/intrinsics.rs`
5+ //!
6+ //! # Const intrinsics
7+ //!
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+ //! In order to make an intrinsic usable at compile-time, one needs to copy the implementation
12+ //! from https://github.com/rust-lang/miri/blob/master/src/shims/intrinsics.rs to
13+ //! `librustc_mir/interpret/intrinsics.rs` and add a
14+ //! `#[rustc_const_unstable(feature = "foo", issue = "01234")]` to the intrinsic.
15+ //!
16+ //! If an intrinsic is supposed to be used from a `const fn` with a `rustc_const_stable` attribute,
17+ //! the intrinsic's attribute must be `rustc_const_stable`, too. Such a change should not be done
18+ //! without T-lang consulation, because it bakes a feature into the language that cannot be
19+ //! replicated in user code without compiler support.
420//!
521//! # Volatiles
622//!
You can’t perform that action at this time.
0 commit comments