Undo an assert causing an ICE until we fix the problem properly

This commit is contained in:
Oliver Scherer 2019-11-10 11:15:34 +01:00
parent 5a5027519a
commit 39fb820820
2 changed files with 16 additions and 5 deletions

View File

@ -694,11 +694,7 @@ pub fn count(&self) -> usize {
pub fn offset(&self, i: usize) -> Size {
match *self {
FieldPlacement::Union(count) => {
assert!(i < count,
"Tried to access field {} of union with {} fields", i, count);
Size::ZERO
},
FieldPlacement::Union(_) => Size::ZERO,
FieldPlacement::Array { stride, count } => {
let i = i as u64;
assert!(i < count);

View File

@ -0,0 +1,15 @@
// build-pass
enum Empty {}
enum Enum {
Empty( Empty )
}
fn foobar() -> Option< Enum > {
let value: Option< Empty > = None;
Some( Enum::Empty( value? ) )
}
fn main() {
foobar();
}