]> git.proxmox.com Git - rustc.git/blob - src/test/codegen-units/item-collection/transitive-drop-glue.rs
Merge tag 'upstream/1.18.0+dfsg1' into debian/experimental
[rustc.git] / src / test / codegen-units / item-collection / transitive-drop-glue.rs
1 // Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 // ignore-tidy-linelength
12 // compile-flags:-Zprint-trans-items=eager
13
14 #![deny(dead_code)]
15
16 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Root[0]> @@ transitive_drop_glue.cgu-0[Internal]
17 struct Root(Intermediate);
18 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Intermediate[0]> @@ transitive_drop_glue.cgu-0[Internal]
19 struct Intermediate(Leaf);
20 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::Leaf[0]> @@ transitive_drop_glue.cgu-0[Internal]
21 struct Leaf;
22
23 impl Drop for Leaf {
24 //~ TRANS_ITEM fn transitive_drop_glue::{{impl}}[0]::drop[0]
25 fn drop(&mut self) {}
26 }
27
28 struct RootGen<T>(IntermediateGen<T>);
29 struct IntermediateGen<T>(LeafGen<T>);
30 struct LeafGen<T>(T);
31
32 impl<T> Drop for LeafGen<T> {
33 fn drop(&mut self) {}
34 }
35
36 //~ TRANS_ITEM fn transitive_drop_glue::main[0]
37 fn main() {
38
39 let _ = Root(Intermediate(Leaf));
40
41 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::RootGen[0]<u32>> @@ transitive_drop_glue.cgu-0[Internal]
42 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::IntermediateGen[0]<u32>> @@ transitive_drop_glue.cgu-0[Internal]
43 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::LeafGen[0]<u32>> @@ transitive_drop_glue.cgu-0[Internal]
44 //~ TRANS_ITEM fn transitive_drop_glue::{{impl}}[1]::drop[0]<u32>
45 let _ = RootGen(IntermediateGen(LeafGen(0u32)));
46
47 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::RootGen[0]<i16>> @@ transitive_drop_glue.cgu-0[Internal]
48 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::IntermediateGen[0]<i16>> @@ transitive_drop_glue.cgu-0[Internal]
49 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<transitive_drop_glue::LeafGen[0]<i16>> @@ transitive_drop_glue.cgu-0[Internal]
50 //~ TRANS_ITEM fn transitive_drop_glue::{{impl}}[1]::drop[0]<i16>
51 let _ = RootGen(IntermediateGen(LeafGen(0i16)));
52 }