Skip to content
Permalink
Browse files

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

  • Loading branch information
oli-obk committed Nov 10, 2019
1 parent 5a50275 commit 39fb82082042040863a958b1e246ecb5ef5cefdf
Showing with 16 additions and 5 deletions.
  1. +1 −5 src/librustc_target/abi/mod.rs
  2. +15 −0 src/test/ui/issues/issue-65462.rs
@@ -694,11 +694,7 @@ impl FieldPlacement {

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);
@@ -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();
}

0 comments on commit 39fb820

Please sign in to comment.
You can’t perform that action at this time.