File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -509,6 +509,9 @@ impl AsciiChar {
509
509
/// when writing code using this method, since the implementation doesn't
510
510
/// need something really specific, not to make those other arguments do
511
511
/// something useful. It might be tightened before stabilization.)
512
+ // Only `d < 64` is required for safety as described above, but we use `d < 10` as
513
+ // in the `assert_unsafe_precondition` inside. See https://github.com/rust-lang/rust/pull/129374
514
+ // for some context about the discrepancy.
512
515
#[ cfg_attr( flux, flux:: spec( fn ( d: u8 { d < 10 } ) -> Self ) ) ]
513
516
#[ unstable( feature = "ascii_char" , issue = "110998" ) ]
514
517
#[ inline]
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ macro_rules! define_valid_range_type {
53
53
/// Immediate language UB if `val == 0`, as it violates the validity
54
54
/// invariant of this type.
55
55
#[ inline]
56
- #[ cfg_attr( flux, flux:: spec( fn ( val: $int{ $low <= cast( val) && cast( val) <= $high } ) -> Self [ { val: cast( val) } ] ) ) ] // NOTE: `val == 0` comments are stale(?)
56
+ #[ cfg_attr( flux, flux:: spec( fn ( val: $int{ $low <= cast( val) && cast( val) <= $high } ) -> Self [ { val: cast( val) } ] ) ) ]
57
57
pub const unsafe fn new_unchecked( val: $int) -> Self {
58
58
// SAFETY: Caller promised that `val` is non-zero.
59
59
unsafe { $name( val) }
You can’t perform that action at this time.
0 commit comments