We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4b55fe1 commit 4c7c9deCopy full SHA for 4c7c9de
library/core/src/num/niche_types.rs
@@ -46,11 +46,11 @@ macro_rules! define_valid_range_type {
46
/// primitive without checking whether its zero.
47
///
48
/// # Safety
49
- /// Immediate language UB if `val == 0`, as it violates the validity
50
- /// invariant of this type.
+ /// Immediate language UB if `val` is not within the valid range for this
+ /// type, as it violates the validity invariant.
51
#[inline]
52
pub const unsafe fn new_unchecked(val: $int) -> Self {
53
- // SAFETY: Caller promised that `val` is non-zero.
+ // SAFETY: Caller promised that `val` is within the valid range.
54
unsafe { $name(val) }
55
}
56
0 commit comments