rust/tests/debuginfo/recursive-enum.rs
bjorn3 ae2f8d9216 Remove the omit_gdb_pretty_printer_section attribute
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.
2025-08-01 20:04:59 +00:00

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)),
});
}