@@ -18,50 +18,51 @@ use rustc_target::abi::VariantIdx;
18
18
use rustc_target:: asm:: InlineAsmRegOrRegClass ;
19
19
20
20
crate mod constant;
21
+
21
22
crate mod cx;
23
+ pub use cx:: build_thir;
22
24
23
25
crate mod pattern;
24
- crate use self :: pattern:: PatTyProj ;
25
- crate use self :: pattern:: { BindingMode , FieldPat , Pat , PatKind , PatRange } ;
26
+ pub use self :: pattern:: { Ascription , BindingMode , FieldPat , Pat , PatKind , PatRange , PatTyProj } ;
26
27
27
28
mod arena;
28
- crate use arena:: Arena ;
29
+ pub use arena:: Arena ;
29
30
30
31
mod util;
31
32
32
33
#[ derive( Copy , Clone , Debug ) ]
33
- crate enum LintLevel {
34
+ pub enum LintLevel {
34
35
Inherited ,
35
36
Explicit ( hir:: HirId ) ,
36
37
}
37
38
38
39
#[ derive( Debug ) ]
39
- crate struct Block < ' thir , ' tcx > {
40
- crate targeted_by_break : bool ,
41
- crate region_scope : region:: Scope ,
42
- crate opt_destruction_scope : Option < region:: Scope > ,
43
- crate span : Span ,
44
- crate stmts : & ' thir [ Stmt < ' thir , ' tcx > ] ,
45
- crate expr : Option < & ' thir Expr < ' thir , ' tcx > > ,
46
- crate safety_mode : BlockSafety ,
40
+ pub struct Block < ' thir , ' tcx > {
41
+ pub targeted_by_break : bool ,
42
+ pub region_scope : region:: Scope ,
43
+ pub opt_destruction_scope : Option < region:: Scope > ,
44
+ pub span : Span ,
45
+ pub stmts : & ' thir [ Stmt < ' thir , ' tcx > ] ,
46
+ pub expr : Option < & ' thir Expr < ' thir , ' tcx > > ,
47
+ pub safety_mode : BlockSafety ,
47
48
}
48
49
49
50
#[ derive( Copy , Clone , Debug ) ]
50
- crate enum BlockSafety {
51
+ pub enum BlockSafety {
51
52
Safe ,
52
53
ExplicitUnsafe ( hir:: HirId ) ,
53
54
PushUnsafe ,
54
55
PopUnsafe ,
55
56
}
56
57
57
58
#[ derive( Debug ) ]
58
- crate struct Stmt < ' thir , ' tcx > {
59
- crate kind : StmtKind < ' thir , ' tcx > ,
60
- crate opt_destruction_scope : Option < region:: Scope > ,
59
+ pub struct Stmt < ' thir , ' tcx > {
60
+ pub kind : StmtKind < ' thir , ' tcx > ,
61
+ pub opt_destruction_scope : Option < region:: Scope > ,
61
62
}
62
63
63
64
#[ derive( Debug ) ]
64
- crate enum StmtKind < ' thir , ' tcx > {
65
+ pub enum StmtKind < ' thir , ' tcx > {
65
66
Expr {
66
67
/// scope for this statement; may be used as lifetime of temporaries
67
68
scope : region:: Scope ,
@@ -111,23 +112,23 @@ rustc_data_structures::static_assert_size!(Expr<'_, '_>, 144);
111
112
/// example, method calls and overloaded operators are absent: they are
112
113
/// expected to be converted into `Expr::Call` instances.
113
114
#[ derive( Debug ) ]
114
- crate struct Expr < ' thir , ' tcx > {
115
+ pub struct Expr < ' thir , ' tcx > {
115
116
/// type of this expression
116
- crate ty : Ty < ' tcx > ,
117
+ pub ty : Ty < ' tcx > ,
117
118
118
119
/// lifetime of this expression if it should be spilled into a
119
120
/// temporary; should be None only if in a constant context
120
- crate temp_lifetime : Option < region:: Scope > ,
121
+ pub temp_lifetime : Option < region:: Scope > ,
121
122
122
123
/// span of the expression in the source
123
- crate span : Span ,
124
+ pub span : Span ,
124
125
125
126
/// kind of expression
126
- crate kind : ExprKind < ' thir , ' tcx > ,
127
+ pub kind : ExprKind < ' thir , ' tcx > ,
127
128
}
128
129
129
130
#[ derive( Debug ) ]
130
- crate enum ExprKind < ' thir , ' tcx > {
131
+ pub enum ExprKind < ' thir , ' tcx > {
131
132
Scope {
132
133
region_scope : region:: Scope ,
133
134
lint_level : LintLevel ,
@@ -316,41 +317,41 @@ crate enum ExprKind<'thir, 'tcx> {
316
317
}
317
318
318
319
#[ derive( Debug ) ]
319
- crate struct FieldExpr < ' thir , ' tcx > {
320
- crate name : Field ,
321
- crate expr : & ' thir Expr < ' thir , ' tcx > ,
320
+ pub struct FieldExpr < ' thir , ' tcx > {
321
+ pub name : Field ,
322
+ pub expr : & ' thir Expr < ' thir , ' tcx > ,
322
323
}
323
324
324
325
#[ derive( Debug ) ]
325
- crate struct FruInfo < ' thir , ' tcx > {
326
- crate base : & ' thir Expr < ' thir , ' tcx > ,
327
- crate field_types : & ' thir [ Ty < ' tcx > ] ,
326
+ pub struct FruInfo < ' thir , ' tcx > {
327
+ pub base : & ' thir Expr < ' thir , ' tcx > ,
328
+ pub field_types : & ' thir [ Ty < ' tcx > ] ,
328
329
}
329
330
330
331
#[ derive( Debug ) ]
331
- crate struct Arm < ' thir , ' tcx > {
332
- crate pattern : Pat < ' tcx > ,
333
- crate guard : Option < Guard < ' thir , ' tcx > > ,
334
- crate body : & ' thir Expr < ' thir , ' tcx > ,
335
- crate lint_level : LintLevel ,
336
- crate scope : region:: Scope ,
337
- crate span : Span ,
332
+ pub struct Arm < ' thir , ' tcx > {
333
+ pub pattern : Pat < ' tcx > ,
334
+ pub guard : Option < Guard < ' thir , ' tcx > > ,
335
+ pub body : & ' thir Expr < ' thir , ' tcx > ,
336
+ pub lint_level : LintLevel ,
337
+ pub scope : region:: Scope ,
338
+ pub span : Span ,
338
339
}
339
340
340
341
#[ derive( Debug ) ]
341
- crate enum Guard < ' thir , ' tcx > {
342
+ pub enum Guard < ' thir , ' tcx > {
342
343
If ( & ' thir Expr < ' thir , ' tcx > ) ,
343
344
IfLet ( Pat < ' tcx > , & ' thir Expr < ' thir , ' tcx > ) ,
344
345
}
345
346
346
347
#[ derive( Copy , Clone , Debug ) ]
347
- crate enum LogicalOp {
348
+ pub enum LogicalOp {
348
349
And ,
349
350
Or ,
350
351
}
351
352
352
353
#[ derive( Debug ) ]
353
- crate enum InlineAsmOperand < ' thir , ' tcx > {
354
+ pub enum InlineAsmOperand < ' thir , ' tcx > {
354
355
In {
355
356
reg : InlineAsmRegOrRegClass ,
356
357
expr : & ' thir Expr < ' thir , ' tcx > ,
0 commit comments