Skip to content

Commit 0c18da5

Browse files
committed
Improve documentation of assume intrinsic.
1 parent 0525bb7 commit 0c18da5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libcore/intrinsics.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,11 @@ extern "rust-intrinsic" {
259259
/// Inform the optimizer that a condition is always true.
260260
/// If the condition is false, the behavior is undefined.
261261
///
262-
/// No code is generated for this intrisic.
262+
/// No code is generated for this intrinsic, but the optimizer will try
263+
/// to preserve it (and its condition) between passes, which may interfere
264+
/// with optimization of surrounding code and reduce performance. It should
265+
/// not be used if the invariant can be discovered by the optimizer on its
266+
/// own, or if it does not enable any significant optimizations.
263267
#[cfg(not(stage0))]
264268
pub fn assume(b: bool);
265269

0 commit comments

Comments
 (0)