]> git.proxmox.com Git - rustc.git/blob - src/test/codegen-units/item-collection/transitive-drop-glue.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / codegen-units / item-collection / transitive-drop-glue.rs
1 // ignore-tidy-linelength
2 // compile-flags:-Zprint-mono-items=eager
3 // compile-flags:-Zinline-in-all-cgus
4
5 #![deny(dead_code)]
6 #![feature(start)]
7
8 //~ MONO_ITEM fn std::ptr::drop_in_place::<Root> - shim(Some(Root)) @@ transitive_drop_glue-cgu.0[Internal]
9 struct Root(Intermediate);
10 //~ MONO_ITEM fn std::ptr::drop_in_place::<Intermediate> - shim(Some(Intermediate)) @@ transitive_drop_glue-cgu.0[Internal]
11 struct Intermediate(Leaf);
12 //~ MONO_ITEM fn std::ptr::drop_in_place::<Leaf> - shim(Some(Leaf)) @@ transitive_drop_glue-cgu.0[Internal]
13 struct Leaf;
14
15 impl Drop for Leaf {
16 //~ MONO_ITEM fn <Leaf as std::ops::Drop>::drop
17 fn drop(&mut self) {}
18 }
19
20 struct RootGen<T>(IntermediateGen<T>);
21 struct IntermediateGen<T>(LeafGen<T>);
22 struct LeafGen<T>(T);
23
24 impl<T> Drop for LeafGen<T> {
25 fn drop(&mut self) {}
26 }
27
28 //~ MONO_ITEM fn start
29 #[start]
30 fn start(_: isize, _: *const *const u8) -> isize {
31 let _ = Root(Intermediate(Leaf));
32
33 //~ MONO_ITEM fn std::ptr::drop_in_place::<RootGen<u32>> - shim(Some(RootGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal]
34 //~ MONO_ITEM fn std::ptr::drop_in_place::<IntermediateGen<u32>> - shim(Some(IntermediateGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal]
35 //~ MONO_ITEM fn std::ptr::drop_in_place::<LeafGen<u32>> - shim(Some(LeafGen<u32>)) @@ transitive_drop_glue-cgu.0[Internal]
36 //~ MONO_ITEM fn <LeafGen<u32> as std::ops::Drop>::drop
37 let _ = RootGen(IntermediateGen(LeafGen(0u32)));
38
39 //~ MONO_ITEM fn std::ptr::drop_in_place::<RootGen<i16>> - shim(Some(RootGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal]
40 //~ MONO_ITEM fn std::ptr::drop_in_place::<IntermediateGen<i16>> - shim(Some(IntermediateGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal]
41 //~ MONO_ITEM fn std::ptr::drop_in_place::<LeafGen<i16>> - shim(Some(LeafGen<i16>)) @@ transitive_drop_glue-cgu.0[Internal]
42 //~ MONO_ITEM fn <LeafGen<i16> as std::ops::Drop>::drop
43 let _ = RootGen(IntermediateGen(LeafGen(0i16)));
44
45 0
46 }