We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a50275 commit 39fb820Copy full SHA for 39fb820
src/librustc_target/abi/mod.rs
@@ -694,11 +694,7 @@ impl FieldPlacement {
694
695
pub fn offset(&self, i: usize) -> Size {
696
match *self {
697
- FieldPlacement::Union(count) => {
698
- assert!(i < count,
699
- "Tried to access field {} of union with {} fields", i, count);
700
- Size::ZERO
701
- },
+ FieldPlacement::Union(_) => Size::ZERO,
702
FieldPlacement::Array { stride, count } => {
703
let i = i as u64;
704
assert!(i < count);
src/test/ui/issues/issue-65462.rs
@@ -0,0 +1,15 @@
1
+// build-pass
2
+
3
+enum Empty {}
4
+enum Enum {
5
+ Empty( Empty )
6
+}
7
8
+fn foobar() -> Option< Enum > {
9
+ let value: Option< Empty > = None;
10
+ Some( Enum::Empty( value? ) )
11
12
13
+fn main() {
14
+ foobar();
15
0 commit comments