@@ -66,7 +66,7 @@ macro_rules! thir_with_elements {
66
66
/// A container for a THIR body.
67
67
///
68
68
/// This can be indexed directly by any THIR index (e.g. [`ExprId`]).
69
- #[ derive( Debug , HashStable ) ]
69
+ #[ derive( Debug , HashStable , Clone ) ]
70
70
pub struct Thir <' tcx> {
71
71
$(
72
72
pub $name: IndexVec <$id, $value>,
@@ -106,7 +106,7 @@ pub enum LintLevel {
106
106
Explicit ( hir:: HirId ) ,
107
107
}
108
108
109
- #[ derive( Debug , HashStable ) ]
109
+ #[ derive( Clone , Debug , HashStable ) ]
110
110
pub struct Block {
111
111
/// Whether the block itself has a label. Used by `label: {}`
112
112
/// and `try` blocks.
@@ -125,7 +125,7 @@ pub struct Block {
125
125
pub safety_mode : BlockSafety ,
126
126
}
127
127
128
- #[ derive( Debug , HashStable ) ]
128
+ #[ derive( Clone , Debug , HashStable ) ]
129
129
pub struct Adt < ' tcx > {
130
130
/// The ADT we're constructing.
131
131
pub adt_def : AdtDef < ' tcx > ,
@@ -151,13 +151,13 @@ pub enum BlockSafety {
151
151
ExplicitUnsafe ( hir:: HirId ) ,
152
152
}
153
153
154
- #[ derive( Debug , HashStable ) ]
154
+ #[ derive( Clone , Debug , HashStable ) ]
155
155
pub struct Stmt < ' tcx > {
156
156
pub kind : StmtKind < ' tcx > ,
157
157
pub opt_destruction_scope : Option < region:: Scope > ,
158
158
}
159
159
160
- #[ derive( Debug , HashStable ) ]
160
+ #[ derive( Clone , Debug , HashStable ) ]
161
161
pub enum StmtKind < ' tcx > {
162
162
/// An expression with a trailing semicolon.
163
163
Expr {
@@ -196,7 +196,7 @@ pub enum StmtKind<'tcx> {
196
196
rustc_data_structures:: static_assert_size!( Expr <' _>, 104 ) ;
197
197
198
198
/// A THIR expression.
199
- #[ derive( Debug , HashStable ) ]
199
+ #[ derive( Clone , Debug , HashStable ) ]
200
200
pub struct Expr < ' tcx > {
201
201
/// The type of this expression
202
202
pub ty : Ty < ' tcx > ,
@@ -212,7 +212,7 @@ pub struct Expr<'tcx> {
212
212
pub kind : ExprKind < ' tcx > ,
213
213
}
214
214
215
- #[ derive( Debug , HashStable ) ]
215
+ #[ derive( Clone , Debug , HashStable ) ]
216
216
pub enum ExprKind < ' tcx > {
217
217
/// `Scope`s are used to explicitly mark destruction scopes,
218
218
/// and to track the `HirId` of the expressions within the scope.
@@ -461,20 +461,20 @@ impl<'tcx> ExprKind<'tcx> {
461
461
/// Represents the association of a field identifier and an expression.
462
462
///
463
463
/// This is used in struct constructors.
464
- #[ derive( Debug , HashStable ) ]
464
+ #[ derive( Clone , Debug , HashStable ) ]
465
465
pub struct FieldExpr {
466
466
pub name : Field ,
467
467
pub expr : ExprId ,
468
468
}
469
469
470
- #[ derive( Debug , HashStable ) ]
470
+ #[ derive( Clone , Debug , HashStable ) ]
471
471
pub struct FruInfo < ' tcx > {
472
472
pub base : ExprId ,
473
473
pub field_types : Box < [ Ty < ' tcx > ] > ,
474
474
}
475
475
476
476
/// A `match` arm.
477
- #[ derive( Debug , HashStable ) ]
477
+ #[ derive( Clone , Debug , HashStable ) ]
478
478
pub struct Arm < ' tcx > {
479
479
pub pattern : Pat < ' tcx > ,
480
480
pub guard : Option < Guard < ' tcx > > ,
@@ -485,7 +485,7 @@ pub struct Arm<'tcx> {
485
485
}
486
486
487
487
/// A `match` guard.
488
- #[ derive( Debug , HashStable ) ]
488
+ #[ derive( Clone , Debug , HashStable ) ]
489
489
pub enum Guard < ' tcx > {
490
490
If ( ExprId ) ,
491
491
IfLet ( Pat < ' tcx > , ExprId ) ,
@@ -499,7 +499,7 @@ pub enum LogicalOp {
499
499
Or ,
500
500
}
501
501
502
- #[ derive( Debug , HashStable ) ]
502
+ #[ derive( Clone , Debug , HashStable ) ]
503
503
pub enum InlineAsmOperand < ' tcx > {
504
504
In {
505
505
reg : InlineAsmRegOrRegClass ,
0 commit comments