File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1
1
//! Compiler intrinsics.
2
2
//!
3
3
//! 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.
4
20
//!
5
21
//! # Volatiles
6
22
//!
You can’t perform that action at this time.
0 commit comments