Undo an assert causing an ICE until we fix the problem properly
This commit is contained in:
parent
5a5027519a
commit
39fb820820
@ -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);
|
||||
|
15
src/test/ui/issues/issue-65462.rs
Normal file
15
src/test/ui/issues/issue-65462.rs
Normal 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();
|
||||
}
|
Loading…
Reference in New Issue
Block a user