File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -509,6 +509,9 @@ impl AsciiChar {
509509 /// when writing code using this method, since the implementation doesn't
510510 /// need something really specific, not to make those other arguments do
511511 /// 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.
512515 #[ cfg_attr( flux, flux:: spec( fn ( d: u8 { d < 10 } ) -> Self ) ) ]
513516 #[ unstable( feature = "ascii_char" , issue = "110998" ) ]
514517 #[ 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 == 0`, as it violates the validity
5454 /// invariant of this type.
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 non-zero.
5959 unsafe { $name( val) }
You can’t perform that action at this time.
0 commit comments