]> git.proxmox.com Git - rustc.git/blob - src/test/codegen-units/partitioning/local-drop-glue.rs
New upstream version 1.22.1+dfsg1
[rustc.git] / src / test / codegen-units / partitioning / local-drop-glue.rs
1 // Copyright 2016 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 // We specify -Z incremental here because we want to test the partitioning for
13 // incremental compilation
14 // compile-flags:-Zprint-trans-items=lazy -Zincremental=tmp/partitioning-tests/local-drop-glue
15 // compile-flags:-Zinline-in-all-cgus
16
17 #![allow(dead_code)]
18 #![crate_type="lib"]
19
20 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<local_drop_glue::Struct[0]> @@ local_drop_glue[Internal] local_drop_glue-mod1[Internal]
21 struct Struct {
22 _a: u32
23 }
24
25 impl Drop for Struct {
26 //~ TRANS_ITEM fn local_drop_glue::{{impl}}[0]::drop[0] @@ local_drop_glue[External]
27 fn drop(&mut self) {}
28 }
29
30 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<local_drop_glue::Outer[0]> @@ local_drop_glue[Internal]
31 struct Outer {
32 _a: Struct
33 }
34
35 //~ TRANS_ITEM fn local_drop_glue::user[0] @@ local_drop_glue[Internal]
36 fn user()
37 {
38 let _ = Outer {
39 _a: Struct {
40 _a: 0
41 }
42 };
43 }
44
45 mod mod1
46 {
47 use super::Struct;
48
49 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<local_drop_glue::mod1[0]::Struct2[0]> @@ local_drop_glue-mod1[Internal]
50 struct Struct2 {
51 _a: Struct,
52 //~ TRANS_ITEM fn core::ptr[0]::drop_in_place[0]<(u32, local_drop_glue::Struct[0])> @@ local_drop_glue-mod1[Internal]
53 _b: (u32, Struct),
54 }
55
56 //~ TRANS_ITEM fn local_drop_glue::mod1[0]::user[0] @@ local_drop_glue-mod1[Internal]
57 fn user()
58 {
59 let _ = Struct2 {
60 _a: Struct { _a: 0 },
61 _b: (0, Struct { _a: 0 }),
62 };
63 }
64 }