]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-9129.rs
Auto merge of #100245 - matthiaskrgr:rollup-tfoo650, r=matthiaskrgr
[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 // ignore-pretty unreported
6
7 pub trait bomb { fn boom(&self, _: Ident); }
8 pub struct S;
9 impl bomb for S { fn boom(&self, _: Ident) { } }
10
11 pub struct Ident { name: usize }
12
13 macro_rules! int3 { () => ( { } ) }
14
15 fn Ident_new() -> Ident {
16     int3!();
17     Ident {name: 0x6789ABCD }
18 }
19
20 pub fn light_fuse(fld: Box<dyn bomb>) {
21     int3!();
22     let f = || {
23         int3!();
24         fld.boom(Ident_new()); // *** 1
25     };
26     f();
27 }
28
29 pub fn main() {
30     let b = Box::new(S) as Box<dyn bomb>;
31     light_fuse(b);
32 }