]> git.lizzy.rs Git - rust.git/blob - src/test/debuginfo/trait-pointers.rs
Rollup merge of #77368 - est31:apfloat_fix, r=varkor
[rust.git] / src / test / 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(box_syntax)]
9 #![feature(omit_gdb_pretty_printer_section)]
10 #![omit_gdb_pretty_printer_section]
11
12 trait Trait {
13     fn method(&self) -> isize { 0 }
14 }
15
16 struct Struct {
17     a: isize,
18     b: f64
19 }
20
21 impl Trait for Struct {}
22
23 // There is no real test here yet. Just make sure that it compiles without crashing.
24 fn main() {
25     let stack_struct = Struct { a:0, b: 1.0 };
26     let reference: &Trait = &stack_struct as &Trait;
27     let unique: Box<Trait> = box Struct { a:2, b: 3.0 } as Box<Trait>;
28 }