File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 88// option. This file may not be copied, modified, or distributed
99// except according to those terms.
1010
11+ // NOTE Instantiating an empty enum is UB. This test may break in the future.
12+
1113// LLDB can't handle zero-sized values
1214// ignore-lldb
1315
2527
2628#![ allow( unused_variables) ]
2729#![ feature( omit_gdb_pretty_printer_section) ]
30+ #![ feature( maybe_uninit) ]
2831#![ omit_gdb_pretty_printer_section]
2932
33+ use std:: mem:: MaybeUninit ;
34+
3035enum ANilEnum { }
3136enum AnotherNilEnum { }
3237
@@ -35,8 +40,8 @@ enum AnotherNilEnum {}
3540// The error from gdbr is expected since nil enums are not supposed to exist.
3641fn main ( ) {
3742 unsafe {
38- let first: ANilEnum = :: std :: mem :: zeroed ( ) ;
39- let second: AnotherNilEnum = :: std :: mem :: zeroed ( ) ;
43+ let first: ANilEnum = MaybeUninit :: uninitialized ( ) . into_inner ( ) ;
44+ let second: AnotherNilEnum = MaybeUninit :: uninitialized ( ) . into_inner ( ) ;
4045
4146 zzz ( ) ; // #break
4247 }
You can’t perform that action at this time.
0 commit comments