Commit 2327942 1 parent e6d0fb7 commit 2327942 Copy full SHA for 2327942
File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
+ // NOTE Instantiating an empty enum is UB. This test may break in the future.
12
+
11
13
// LLDB can't handle zero-sized values
12
14
// ignore-lldb
13
15
25
27
26
28
#![ allow( unused_variables) ]
27
29
#![ feature( omit_gdb_pretty_printer_section) ]
30
+ #![ feature( maybe_uninit) ]
28
31
#![ omit_gdb_pretty_printer_section]
29
32
33
+ use std:: mem:: MaybeUninit ;
34
+
30
35
enum ANilEnum { }
31
36
enum AnotherNilEnum { }
32
37
@@ -35,8 +40,8 @@ enum AnotherNilEnum {}
35
40
// The error from gdbr is expected since nil enums are not supposed to exist.
36
41
fn main ( ) {
37
42
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 ( ) ;
40
45
41
46
zzz ( ) ; // #break
42
47
}
You can’t perform that action at this time.
0 commit comments