]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
0bf4aa26 | 2 | #![allow(dead_code)] |
b7449926 | 3 | #![allow(non_camel_case_types)] |
1a4d82fc JJ |
4 | #![feature(box_syntax)] |
5 | ||
c34b1796 | 6 | //type t = { a: isize }; |
223e47cc LB |
7 | // type t = { a: bool }; |
8 | type t = bool; | |
9 | ||
10 | trait it { | |
11 | fn f(&self); | |
12 | } | |
13 | ||
14 | impl it for t { | |
15 | fn f(&self) { } | |
16 | } | |
17 | ||
18 | pub fn main() { | |
85aaf69f SL |
19 | // let x = ({a: 4} as it); |
20 | // let y = box ({a: 4}); | |
21 | // let z = box ({a: 4} as it); | |
1a4d82fc | 22 | // let z = box ({a: true} as it); |
dc9dc135 | 23 | let z: Box<_> = box (box true as Box<dyn it>); |
223e47cc LB |
24 | // x.f(); |
25 | // y.f(); | |
26 | // (*z).f(); | |
1a4d82fc | 27 | println!("ok so far..."); |
223e47cc LB |
28 | z.f(); //segfault |
29 | } |