rust/tests/debuginfo/recursive-enum.rs
Martin Nordholts 5b57d02e9f compiletest: Use //@ prefixes also for debuginfo test directives
So that when we later add support for revisions we can use the same
syntax for revisions as elsewhere.

This also prevents people from making typos for commands since
`src/tools/compiletest/src/directives/directive_names.rs` will catch such
typos now.

Note that we one FIXME for a non-trivial change for later:
```
// FIXME(148097): Change `// cdb-checksimple_closure` to `//@ cdb-check:simple_closure`
```
2025-11-25 06:13:45 +01:00

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