]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-9129.rs
Merge commit '27afd6ade4bb1123a8bf82001629b69d23d62aff' into clippyup
[rust.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 #![allow(deprecated)] // llvm_asm!
6 // ignore-pretty unreported
7
8 #![feature(box_syntax)]
9
10 pub trait bomb { fn boom(&self, _: Ident); }
11 pub struct S;
12 impl bomb for S { fn boom(&self, _: Ident) { } }
13
14 pub struct Ident { name: usize }
15
16 // macro_rules! int3 { () => ( unsafe { llvm_asm!( "int3" ); } ) }
17 macro_rules! int3 { () => ( { } ) }
18
19 fn Ident_new() -> Ident {
20     int3!();
21     Ident {name: 0x6789ABCD }
22 }
23
24 pub fn light_fuse(fld: Box<dyn bomb>) {
25     int3!();
26     let f = || {
27         int3!();
28         fld.boom(Ident_new()); // *** 1
29     };
30     f();
31 }
32
33 pub fn main() {
34     let b = box S as Box<dyn bomb>;
35     light_fuse(b);
36 }