]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-9129.rs
New upstream version 1.38.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-9129.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(non_camel_case_types)]
4 #![allow(non_snake_case)]
5 // ignore-pretty unreported
6
7 #![feature(box_syntax)]
8
9 pub trait bomb { fn boom(&self, _: Ident); }
10 pub struct S;
11 impl bomb for S { fn boom(&self, _: Ident) { } }
12
13 pub struct Ident { name: usize }
14
15 // macro_rules! int3 { () => ( unsafe { asm!( "int3" ); } ) }
16 macro_rules! int3 { () => ( { } ) }
17
18 fn Ident_new() -> Ident {
19 int3!();
20 Ident {name: 0x6789ABCD }
21 }
22
23 pub fn light_fuse(fld: Box<dyn bomb>) {
24 int3!();
25 let f = || {
26 int3!();
27 fld.boom(Ident_new()); // *** 1
28 };
29 f();
30 }
31
32 pub fn main() {
33 let b = box S as Box<dyn bomb>;
34 light_fuse(b);
35 }