]> git.lizzy.rs Git - rust.git/blob - tests/debuginfo/trait-pointers.rs
Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into sync_cg_clif-2023-02-09
[rust.git] / tests / debuginfo / trait-pointers.rs
1 // min-lldb-version: 310
2
3 // compile-flags:-g
4 // gdb-command:run
5 // lldb-command:run
6
7 #![allow(unused_variables)]
8 #![feature(omit_gdb_pretty_printer_section)]
9 #![omit_gdb_pretty_printer_section]
10
11 trait Trait {
12     fn method(&self) -> isize { 0 }
13 }
14
15 struct Struct {
16     a: isize,
17     b: f64
18 }
19
20 impl Trait for Struct {}
21
22 // There is no real test here yet. Just make sure that it compiles without crashing.
23 fn main() {
24     let stack_struct = Struct { a:0, b: 1.0 };
25     let reference: &Trait = &stack_struct as &Trait;
26     let unique: Box<Trait> = Box::new(Struct { a:2, b: 3.0 }) as Box<Trait>;
27 }