You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
doc: mention that intrinsics should not be called in user code
Intrinsic functions declared in `std::intrinsics` are an implementation
detail and should not be called directly by the user. The compiler
explicitly warns against their use in user code:
```
warning: the feature `core_intrinsics` is internal to the compiler or standard library
--> src/lib.rs:1:12
|
1 | #![feature(core_intrinsics)]
| ^^^^^^^^^^^^^^^
|
= note: using it is strongly discouraged
= note: `#[warn(internal_features)]` on by default
```
[**Playground link**]
This PR documents what the compiler warning says: these intrinsics should
not be called outside the standard library.
[**Playground link**]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=1c893b0698291f550bbdde0151fd221b
Copy file name to clipboardExpand all lines: library/core/src/intrinsics/mod.rs
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,9 @@
6
6
//! and <https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_llvm/src/intrinsic.rs>,
7
7
//! and for const evaluation in <https://github.com/rust-lang/rust/blob/master/compiler/rustc_const_eval/src/interpret/intrinsics.rs>.
8
8
//!
9
+
//! The functions in this module are implementation details of `core` and should
10
+
//! not be used outside of the standard library.
11
+
//!
9
12
//! # Const intrinsics
10
13
//!
11
14
//! In order to make an intrinsic unstable usable at compile-time, copy the implementation from
0 commit comments