File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -517,6 +517,9 @@ impl AsciiChar {
517517 /// when writing code using this method, since the implementation doesn't
518518 /// need something really specific, not to make those other arguments do
519519 /// something useful. It might be tightened before stabilization.)
520+ // Only `d < 64` is required for safety as described above, but we use `d < 10` as
521+ // in the `assert_unsafe_precondition` inside. See https://github.com/rust-lang/rust/pull/129374
522+ // for some context about the discrepancy.
520523 #[ cfg_attr( flux, flux:: spec( fn ( d: u8 { d < 10 } ) -> Self ) ) ]
521524 #[ unstable( feature = "ascii_char" , issue = "110998" ) ]
522525 #[ inline]
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ macro_rules! define_valid_range_type {
5353 /// Immediate language UB if `val` is not within the valid range for this
5454 /// type, as it violates the validity invariant.
5555 #[ 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) } ] ) ) ]
5757 pub const unsafe fn new_unchecked( val: $int) -> Self {
5858 // SAFETY: Caller promised that `val` is within the valid range.
5959 unsafe { $name( val) }
You can’t perform that action at this time.
0 commit comments