Skip to content

Commit 1867394

Browse files
saethlinRalfJung
andauthored
Update library/core/src/intrinsics.rs
Co-authored-by: Ralf Jung <[email protected]>
1 parent 9942dd7 commit 1867394

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/core/src/intrinsics.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -2573,7 +2573,10 @@ extern "rust-intrinsic" {
25732573
/// macro expansion.
25742574
///
25752575
/// This always returns `false` in const eval and Miri. The interpreter provides better
2576-
/// diagnostics than the checks that this is used to implement.
2576+
/// diagnostics than the checks that this is used to implement. However, this means
2577+
/// you should only be using this intrinsic to guard requirements that, if violated,
2578+
/// immediately lead to UB. Otherwise, const-eval and Miri will miss out on those
2579+
/// checks entirely.
25772580
///
25782581
/// Since this is evaluated after monomorphization, branching on this value can be used to
25792582
/// implement debug assertions that are included in the precompiled standard library, but can

0 commit comments

Comments
 (0)