Skip to content

Commit 348e528

Browse files
committed
Fix assert_unsafe_precondition doc typos
1 parent 73de723 commit 348e528

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

library/core/src/intrinsics.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
use crate::marker::DiscriminantKind;
5858
use crate::marker::Tuple;
5959
use crate::mem::align_of;
60+
#[cfg(doc)]
61+
use core::mem;
6062

6163
pub mod mir;
6264
pub mod simd;
@@ -2597,7 +2599,7 @@ pub(crate) const fn debug_assertions() -> bool {
25972599
/// These checks are behind a condition which is evaluated at codegen time, not expansion time like
25982600
/// [`debug_assert`]. This means that a standard library built with optimizations and debug
25992601
/// assertions disabled will have these checks optimized out of its monomorphizations, but if a
2600-
/// a caller of the standard library has debug assertions enabled and monomorphizes an expansion of
2602+
/// caller of the standard library has debug assertions enabled and monomorphizes an expansion of
26012603
/// this macro, that monomorphization will contain the check.
26022604
///
26032605
/// Since these checks cannot be optimized out in MIR, some care must be taken in both call and
@@ -2606,8 +2608,8 @@ pub(crate) const fn debug_assertions() -> bool {
26062608
/// combination of properties ensures that the code for the checks is only compiled once, and has a
26072609
/// minimal impact on the caller's code size.
26082610
///
2609-
/// Caller should also introducing any other `let` bindings or any code outside this macro in order
2610-
/// to call it. Since the precompiled standard library is built with full debuginfo and these
2611+
/// Callers should also avoid introducing any other `let` bindings or any code outside this macro in
2612+
/// order to call it. Since the precompiled standard library is built with full debuginfo and these
26112613
/// variables cannot be optimized out in MIR, an innocent-looking `let` can produce enough
26122614
/// debuginfo to have a measurable compile-time impact on debug builds.
26132615
///

0 commit comments

Comments
 (0)