|
1 | | -// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT |
2 | | -// file at the top-level directory of this distribution and at |
3 | | -// http://rust-lang.org/COPYRIGHT. |
4 | | -// |
5 | | -// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
6 | | -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
7 | | -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
8 | | -// option. This file may not be copied, modified, or distributed |
9 | | -// except according to those terms. |
10 | | - |
11 | 1 | // NOTE Instantiating an empty enum is UB. This test may break in the future. |
12 | | - |
13 | | -// LLDB can't handle zero-sized values |
| 2 | +// |
| 3 | +// LLDB can't handle zero-sized values. |
14 | 4 | // ignore-lldb |
15 | 5 |
|
16 | | - |
17 | 6 | // compile-flags:-g |
18 | 7 | // gdb-command:run |
19 | 8 |
|
20 | | -// gdb-command:print first |
| 9 | +// gdb-command:print *first |
21 | 10 | // gdbg-check:$1 = {<No data fields>} |
22 | 11 | // gdbr-check:$1 = <error reading variable> |
23 | 12 |
|
24 | | -// gdb-command:print second |
25 | | -// gdbg-check:$2 = {<No data fields>} |
26 | | -// gdbr-check:$2 = <error reading variable> |
27 | | - |
28 | 13 | #![allow(unused_variables)] |
29 | 14 | #![feature(omit_gdb_pretty_printer_section)] |
30 | | -#![feature(maybe_uninit)] |
31 | 15 | #![omit_gdb_pretty_printer_section] |
32 | 16 |
|
33 | | -use std::mem::MaybeUninit; |
34 | | - |
35 | | -enum ANilEnum {} |
36 | | -enum AnotherNilEnum {} |
| 17 | +enum Void {} |
37 | 18 |
|
38 | | -// This test relies on gdbg printing the string "{<No data fields>}" for empty |
39 | | -// structs (which may change some time) |
40 | | -// The error from gdbr is expected since nil enums are not supposed to exist. |
41 | 19 | fn main() { |
42 | | - unsafe { |
43 | | - let first: ANilEnum = MaybeUninit::uninitialized().into_inner(); |
44 | | - let second: AnotherNilEnum = MaybeUninit::uninitialized().into_inner(); |
| 20 | + let first: *const Void = 1 as *const _; |
45 | 21 |
|
46 | | - zzz(); // #break |
47 | | - } |
| 22 | + zzz(); // #break |
48 | 23 | } |
49 | 24 |
|
50 | | -fn zzz() {()} |
| 25 | +fn zzz() {} |
0 commit comments