mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 18:27:37 +00:00

Disabling loading of pretty printers in the debugger itself is more reliable. Before this commit the .gdb_debug_scripts section couldn't be included in dylibs or rlibs as otherwise there is no way to disable the section anymore without recompiling the entire standard library.
38 lines
815 B
Rust
38 lines
815 B
Rust
//@ ignore-lldb
|
|
|
|
//@ compile-flags:-g
|
|
//@ disable-gdb-pretty-printers
|
|
// gdb-command:run
|
|
|
|
// Test whether compiling a recursive enum definition crashes debug info generation. The test case
|
|
// is taken from issue #11083 and #135093.
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
pub struct Window<'a> {
|
|
callbacks: WindowCallbacks<'a>
|
|
}
|
|
|
|
struct WindowCallbacks<'a> {
|
|
pos_callback: Option<Box<FnMut(&Window, i32, i32) + 'a>>,
|
|
}
|
|
|
|
enum ExpandingRecursive<T> {
|
|
Recurse(Indirect<T>),
|
|
Item(T),
|
|
}
|
|
|
|
struct Indirect<U> {
|
|
rec: *const ExpandingRecursive<Option<U>>,
|
|
}
|
|
|
|
|
|
fn main() {
|
|
let x = WindowCallbacks { pos_callback: None };
|
|
|
|
// EXPANDING RECURSIVE
|
|
let expanding_recursive: ExpandingRecursive<u64> = ExpandingRecursive::Recurse(Indirect {
|
|
rec: &ExpandingRecursive::Item(Option::Some(42)),
|
|
});
|
|
}
|