File tree Expand file tree Collapse file tree 2 files changed +124
-0
lines changed Expand file tree Collapse file tree 2 files changed +124
-0
lines changed Original file line number Diff line number Diff line change
1
+ // check-pass
2
+ // compile-flags: -Zhir-stats
3
+ // only-x86_64
4
+
5
+ // The aim here is to include at least one of every different type of AST/HIR
6
+ // node reported by `-Zhir-stats`.
7
+
8
+ #![ allow( dead_code) ]
9
+
10
+ use std:: arch:: asm;
11
+ use std:: fmt:: Debug ;
12
+ use std:: ffi:: c_void;
13
+
14
+ extern "C" { fn f ( p : * mut c_void ) ; }
15
+
16
+ /// An enum.
17
+ enum E < ' a , T : Copy > { A { t : T } , B ( & ' a u32 ) }
18
+
19
+ trait Go {
20
+ type G : Debug ;
21
+ fn go ( self ) -> u32 ;
22
+ }
23
+
24
+ impl < ' a , T : Copy > Go for E < ' a , T > {
25
+ type G = bool ;
26
+ fn go ( self ) -> u32 {
27
+ 99
28
+ }
29
+ }
30
+
31
+ fn f2 < T > ( t : T ) where T : Debug { }
32
+
33
+ fn main ( ) {
34
+ let x = E :: A { t : 3 } ;
35
+ match x {
36
+ E :: A { .. } => { }
37
+ _ => { }
38
+ }
39
+
40
+ unsafe { asm ! ( "mov rdi, 1" ) ; }
41
+ }
Original file line number Diff line number Diff line change
1
+
2
+ PRE EXPANSION AST STATS
3
+
4
+ Name Accumulated Size Count Item Size
5
+ ----------------------------------------------------------------
6
+ Lifetime 32 2 16
7
+ MacCall 64 1 64
8
+ Local 72 1 72
9
+ Arm 96 2 48
10
+ FieldDef 160 2 80
11
+ ForeignItem 160 1 160
12
+ Stmt 160 5 32
13
+ FnDecl 200 5 40
14
+ Variant 240 2 120
15
+ Block 288 6 48
16
+ Attribute 304 2 152
17
+ ImplItem 320 2 160
18
+ TraitItem 320 2 160
19
+ GenericBound 352 4 88
20
+ PathSegment 720 30 24
21
+ Expr 832 8 104
22
+ Pat 840 7 120
23
+ Ty 1_344 14 96
24
+ Item 1_800 9 200
25
+ ----------------------------------------------------------------
26
+ Total 8_304
27
+
28
+
29
+ POST EXPANSION AST STATS
30
+
31
+ Name Accumulated Size Count Item Size
32
+ ----------------------------------------------------------------
33
+ Lifetime 32 2 16
34
+ Local 72 1 72
35
+ Arm 96 2 48
36
+ FieldDef 160 2 80
37
+ ForeignItem 160 1 160
38
+ Stmt 160 5 32
39
+ FnDecl 200 5 40
40
+ Variant 240 2 120
41
+ Block 288 6 48
42
+ ImplItem 320 2 160
43
+ TraitItem 320 2 160
44
+ GenericBound 352 4 88
45
+ Attribute 608 4 152
46
+ PathSegment 792 33 24
47
+ Pat 840 7 120
48
+ Expr 936 9 104
49
+ Ty 1_344 14 96
50
+ Item 2_200 11 200
51
+ ----------------------------------------------------------------
52
+ Total 9_120
53
+
54
+
55
+ HIR STATS
56
+
57
+ Name Accumulated Size Count Item Size
58
+ ----------------------------------------------------------------
59
+ Param 64 2 32
60
+ Local 64 1 64
61
+ ForeignItem 72 1 72
62
+ FieldDef 96 2 48
63
+ Arm 96 2 48
64
+ Stmt 96 3 32
65
+ FnDecl 120 3 40
66
+ Lifetime 128 4 32
67
+ Variant 160 2 80
68
+ ImplItem 176 2 88
69
+ GenericBound 192 4 48
70
+ TraitItem 192 2 96
71
+ WherePredicate 216 3 72
72
+ Block 288 6 48
73
+ QPath 408 17 24
74
+ Pat 440 5 88
75
+ Attribute 608 4 152
76
+ Expr 672 12 56
77
+ Item 960 12 80
78
+ Ty 1_152 16 72
79
+ Path 1_296 27 48
80
+ PathSegment 2_240 40 56
81
+ ----------------------------------------------------------------
82
+ Total 9_736
83
+
You can’t perform that action at this time.
0 commit comments