2018-05-08 16:10:16 +03:00
|
|
|
//@ compile-flags:-Zprint-mono-items=eager
|
2024-12-05 12:51:19 -05:00
|
|
|
//@ compile-flags: -O
|
2015-11-02 14:46:39 +01:00
|
|
|
|
|
|
|
#![deny(dead_code)]
|
2024-12-14 09:13:12 +01:00
|
|
|
#![crate_type = "lib"]
|
2015-11-02 14:46:39 +01:00
|
|
|
|
2021-02-14 16:42:38 -05:00
|
|
|
//~ MONO_ITEM fn std::ptr::drop_in_place::<StructWithDrop> - shim(Some(StructWithDrop)) @@ non_generic_drop_glue-cgu.0[Internal]
|
2015-11-02 14:46:39 +01:00
|
|
|
struct StructWithDrop {
|
2024-05-29 14:25:55 +10:00
|
|
|
x: i32,
|
2015-11-02 14:46:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Drop for StructWithDrop {
|
2020-08-28 14:31:03 +01:00
|
|
|
//~ MONO_ITEM fn <StructWithDrop as std::ops::Drop>::drop
|
2015-11-02 14:46:39 +01:00
|
|
|
fn drop(&mut self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct StructNoDrop {
|
2024-05-29 14:25:55 +10:00
|
|
|
x: i32,
|
2015-11-02 14:46:39 +01:00
|
|
|
}
|
|
|
|
|
2021-02-14 16:42:38 -05:00
|
|
|
//~ MONO_ITEM fn std::ptr::drop_in_place::<EnumWithDrop> - shim(Some(EnumWithDrop)) @@ non_generic_drop_glue-cgu.0[Internal]
|
2015-11-02 14:46:39 +01:00
|
|
|
enum EnumWithDrop {
|
2024-05-29 14:25:55 +10:00
|
|
|
A(i32),
|
2015-11-02 14:46:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Drop for EnumWithDrop {
|
2020-08-28 14:31:03 +01:00
|
|
|
//~ MONO_ITEM fn <EnumWithDrop as std::ops::Drop>::drop
|
2015-11-02 14:46:39 +01:00
|
|
|
fn drop(&mut self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
enum EnumNoDrop {
|
2024-05-29 14:25:55 +10:00
|
|
|
A(i32),
|
2015-11-02 14:46:39 +01:00
|
|
|
}
|
|
|
|
|
2020-08-28 14:31:03 +01:00
|
|
|
//~ MONO_ITEM fn start
|
2024-12-14 09:13:12 +01:00
|
|
|
#[no_mangle]
|
|
|
|
pub fn start(_: isize, _: *const *const u8) -> isize {
|
2015-11-02 14:46:39 +01:00
|
|
|
let _ = StructWithDrop { x: 0 }.x;
|
|
|
|
let _ = StructNoDrop { x: 0 }.x;
|
|
|
|
let _ = match EnumWithDrop::A(0) {
|
2024-05-29 14:25:55 +10:00
|
|
|
EnumWithDrop::A(x) => x,
|
2015-11-02 14:46:39 +01:00
|
|
|
};
|
|
|
|
let _ = match EnumNoDrop::A(0) {
|
2024-05-29 14:25:55 +10:00
|
|
|
EnumNoDrop::A(x) => x,
|
2015-11-02 14:46:39 +01:00
|
|
|
};
|
2017-12-22 15:31:51 +01:00
|
|
|
|
|
|
|
0
|
2015-11-02 14:46:39 +01:00
|
|
|
}
|