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