The following should be stopped by the const sanity check: ```rust #![feature(never_type, const_transmute)] use std::mem; const TEST: [!; 1] = unsafe { mem::transmute(()) }; ``` But it [is not](https://play.rust-lang.org/?gist=3cba3b15ec33782d4f8a542c06b7b3b1&version=nightly&mode=debug&edition=2015). The issue is that the sanity check calls `is_zst()` to skip arrays that could be immediate, but some of those arrays are uninhabited... Cc @oli-obk
Activity
oli-obk commentedon Oct 2, 2018
lolwat. That should not even pass WF checks, right? Statics and constants should not be allowed to have uninhabited types.
RalfJung commentedon Oct 2, 2018
That's just a bandaid though, WF checks won't catch the same thing wrapped in an
Option
(andSome
).RalfJung commentedon Oct 2, 2018
I will fix this as part of my work for preparing validation for miri usage.
fix validating arrays of ZSTs
Auto merge of #54762 - RalfJung:miri-validate, r=<try>
fix validating arrays of ZSTs
Auto merge of #54762 - RalfJung:miri-validate, r=oli-obk