@@ -18,50 +18,51 @@ use rustc_target::abi::VariantIdx;
1818use rustc_target:: asm:: InlineAsmRegOrRegClass ;
1919
2020crate mod constant;
21+
2122crate mod cx;
23+ pub use cx:: build_thir;
2224
2325crate 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 } ;
2627
2728mod arena;
28- crate use arena:: Arena ;
29+ pub use arena:: Arena ;
2930
3031mod util;
3132
3233#[ derive( Copy , Clone , Debug ) ]
33- crate enum LintLevel {
34+ pub enum LintLevel {
3435 Inherited ,
3536 Explicit ( hir:: HirId ) ,
3637}
3738
3839#[ 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 ,
4748}
4849
4950#[ derive( Copy , Clone , Debug ) ]
50- crate enum BlockSafety {
51+ pub enum BlockSafety {
5152 Safe ,
5253 ExplicitUnsafe ( hir:: HirId ) ,
5354 PushUnsafe ,
5455 PopUnsafe ,
5556}
5657
5758#[ 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 > ,
6162}
6263
6364#[ derive( Debug ) ]
64- crate enum StmtKind < ' thir , ' tcx > {
65+ pub enum StmtKind < ' thir , ' tcx > {
6566 Expr {
6667 /// scope for this statement; may be used as lifetime of temporaries
6768 scope : region:: Scope ,
@@ -111,23 +112,23 @@ rustc_data_structures::static_assert_size!(Expr<'_, '_>, 144);
111112/// example, method calls and overloaded operators are absent: they are
112113/// expected to be converted into `Expr::Call` instances.
113114#[ derive( Debug ) ]
114- crate struct Expr < ' thir , ' tcx > {
115+ pub struct Expr < ' thir , ' tcx > {
115116 /// type of this expression
116- crate ty : Ty < ' tcx > ,
117+ pub ty : Ty < ' tcx > ,
117118
118119 /// lifetime of this expression if it should be spilled into a
119120 /// temporary; should be None only if in a constant context
120- crate temp_lifetime : Option < region:: Scope > ,
121+ pub temp_lifetime : Option < region:: Scope > ,
121122
122123 /// span of the expression in the source
123- crate span : Span ,
124+ pub span : Span ,
124125
125126 /// kind of expression
126- crate kind : ExprKind < ' thir , ' tcx > ,
127+ pub kind : ExprKind < ' thir , ' tcx > ,
127128}
128129
129130#[ derive( Debug ) ]
130- crate enum ExprKind < ' thir , ' tcx > {
131+ pub enum ExprKind < ' thir , ' tcx > {
131132 Scope {
132133 region_scope : region:: Scope ,
133134 lint_level : LintLevel ,
@@ -316,41 +317,41 @@ crate enum ExprKind<'thir, 'tcx> {
316317}
317318
318319#[ 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 > ,
322323}
323324
324325#[ 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 > ] ,
328329}
329330
330331#[ 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 ,
338339}
339340
340341#[ derive( Debug ) ]
341- crate enum Guard < ' thir , ' tcx > {
342+ pub enum Guard < ' thir , ' tcx > {
342343 If ( & ' thir Expr < ' thir , ' tcx > ) ,
343344 IfLet ( Pat < ' tcx > , & ' thir Expr < ' thir , ' tcx > ) ,
344345}
345346
346347#[ derive( Copy , Clone , Debug ) ]
347- crate enum LogicalOp {
348+ pub enum LogicalOp {
348349 And ,
349350 Or ,
350351}
351352
352353#[ derive( Debug ) ]
353- crate enum InlineAsmOperand < ' thir , ' tcx > {
354+ pub enum InlineAsmOperand < ' thir , ' tcx > {
354355 In {
355356 reg : InlineAsmRegOrRegClass ,
356357 expr : & ' thir Expr < ' thir , ' tcx > ,
0 commit comments