2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(dead_code)]
|
2018-08-31 15:02:01 +02:00
|
|
|
#![allow(non_camel_case_types)]
|
|
|
|
|
#![allow(non_snake_case)]
|
2013-12-16 17:04:02 -08:00
|
|
|
|
2017-06-25 05:29:10 +03:00
|
|
|
pub trait bomb { fn boom(&self, _: Ident); }
|
2013-12-16 17:04:02 -08:00
|
|
|
pub struct S;
|
2014-02-07 00:38:33 +02:00
|
|
|
impl bomb for S { fn boom(&self, _: Ident) { } }
|
2013-12-16 17:04:02 -08:00
|
|
|
|
2015-03-25 17:06:52 -07:00
|
|
|
pub struct Ident { name: usize }
|
2013-12-16 17:04:02 -08:00
|
|
|
|
2015-01-02 14:44:21 -08:00
|
|
|
macro_rules! int3 { () => ( { } ) }
|
2013-12-16 17:04:02 -08:00
|
|
|
|
|
|
|
|
fn Ident_new() -> Ident {
|
|
|
|
|
int3!();
|
|
|
|
|
Ident {name: 0x6789ABCD }
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-28 14:47:21 -04:00
|
|
|
pub fn light_fuse(fld: Box<dyn bomb>) {
|
2013-12-16 17:04:02 -08:00
|
|
|
int3!();
|
2015-02-01 12:44:15 -05:00
|
|
|
let f = || {
|
2013-12-16 17:04:02 -08:00
|
|
|
int3!();
|
|
|
|
|
fld.boom(Ident_new()); // *** 1
|
|
|
|
|
};
|
|
|
|
|
f();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub fn main() {
|
2022-07-07 04:36:10 +02:00
|
|
|
let b = Box::new(S) as Box<dyn bomb>;
|
2013-12-16 17:04:02 -08:00
|
|
|
light_fuse(b);
|
|
|
|
|
}
|