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