Undefined behavior in safe rust using rustc_layout_scalar_valid_range_start
#115284
Labels
C-bug
Category: This is a bug.
F-rustc_attrs
Internal rustc attributes gated on the `#[rustc_attrs]` feature gate.
requires-internal-features
This issue requires the use of internal features.
Given the following struct:
trying to initialise it directly with
NonZeroAndOneU8(1)
(rightfully) results in the error:But
Some(1).map(NonZeroAndOneU8).unwrap()
compiles just fine returningNonZeroAndOneU8(1)
which is an invalid state (link to the playground).The text was updated successfully, but these errors were encountered: