@@ -86,7 +86,7 @@ impl MirPhase {
86
86
}
87
87
88
88
/// The lowered representation of a single function.
89
- #[ derive( Clone , RustcEncodable , RustcDecodable , Debug ) ]
89
+ #[ derive( Clone , RustcEncodable , RustcDecodable , Debug , TypeFoldable ) ]
90
90
pub struct Body < ' tcx > {
91
91
/// A list of basic blocks. References to basic block use a newtyped index type `BasicBlock`
92
92
/// that indexes into this vector.
@@ -446,7 +446,7 @@ impl<'tcx> IndexMut<BasicBlock> for Body<'tcx> {
446
446
}
447
447
}
448
448
449
- #[ derive( Copy , Clone , Debug , HashStable ) ]
449
+ #[ derive( Copy , Clone , Debug , HashStable , TypeFoldable ) ]
450
450
pub enum ClearCrossCrate < T > {
451
451
Clear ,
452
452
Set ( T ) ,
@@ -723,7 +723,7 @@ impl_stable_hash_for!(struct BlockTailInfo { tail_result_is_ignored });
723
723
///
724
724
/// This can be a binding declared by the user, a temporary inserted by the compiler, a function
725
725
/// argument, or the return place.
726
- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
726
+ #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable , TypeFoldable ) ]
727
727
pub struct LocalDecl < ' tcx > {
728
728
/// Whether this is a mutable minding (i.e., `let x` or `let mut x`).
729
729
///
@@ -1012,7 +1012,7 @@ impl BasicBlock {
1012
1012
///////////////////////////////////////////////////////////////////////////
1013
1013
// BasicBlockData and Terminator
1014
1014
1015
- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
1015
+ #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable , TypeFoldable ) ]
1016
1016
pub struct BasicBlockData < ' tcx > {
1017
1017
/// List of statements in this block.
1018
1018
pub statements : Vec < Statement < ' tcx > > ,
@@ -1542,7 +1542,7 @@ impl<'tcx> TerminatorKind<'tcx> {
1542
1542
///////////////////////////////////////////////////////////////////////////
1543
1543
// Statements
1544
1544
1545
- #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable ) ]
1545
+ #[ derive( Clone , RustcEncodable , RustcDecodable , HashStable , TypeFoldable ) ]
1546
1546
pub struct Statement < ' tcx > {
1547
1547
pub source_info : SourceInfo ,
1548
1548
pub kind : StatementKind < ' tcx > ,
@@ -1568,7 +1568,7 @@ impl Statement<'_> {
1568
1568
}
1569
1569
}
1570
1570
1571
- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
1571
+ #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable , TypeFoldable ) ]
1572
1572
pub enum StatementKind < ' tcx > {
1573
1573
/// Write the RHS Rvalue to the LHS Place.
1574
1574
Assign ( Box < ( Place < ' tcx > , Rvalue < ' tcx > ) > ) ,
@@ -1676,7 +1676,7 @@ pub enum FakeReadCause {
1676
1676
ForIndex ,
1677
1677
}
1678
1678
1679
- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
1679
+ #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable , TypeFoldable ) ]
1680
1680
pub struct InlineAsm < ' tcx > {
1681
1681
pub asm : HirInlineAsm ,
1682
1682
pub outputs : Box < [ Place < ' tcx > ] > ,
@@ -2418,17 +2418,11 @@ pub struct Constant<'tcx> {
2418
2418
/// The first will lead to the constraint `w: &'1 str` (for some
2419
2419
/// inferred region `'1`). The second will lead to the constraint `w:
2420
2420
/// &'static str`.
2421
- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
2421
+ #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable , TypeFoldable ) ]
2422
2422
pub struct UserTypeProjections {
2423
2423
pub ( crate ) contents : Vec < ( UserTypeProjection , Span ) > ,
2424
2424
}
2425
2425
2426
- BraceStructTypeFoldableImpl ! {
2427
- impl <' tcx> TypeFoldable <' tcx> for UserTypeProjections {
2428
- contents
2429
- }
2430
- }
2431
-
2432
2426
impl < ' tcx > UserTypeProjections {
2433
2427
pub fn none ( ) -> Self {
2434
2428
UserTypeProjections { contents : vec ! [ ] }
@@ -2737,7 +2731,7 @@ rustc_index::newtype_index! {
2737
2731
}
2738
2732
2739
2733
/// The layout of generator state.
2740
- #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable ) ]
2734
+ #[ derive( Clone , Debug , RustcEncodable , RustcDecodable , HashStable , TypeFoldable ) ]
2741
2735
pub struct GeneratorLayout < ' tcx > {
2742
2736
/// The type of every local stored inside the generator.
2743
2737
pub field_tys : IndexVec < GeneratorSavedLocal , Ty < ' tcx > > ,
@@ -2936,92 +2930,6 @@ CloneTypeFoldableAndLiftImpls! {
2936
2930
UserTypeAnnotationIndex ,
2937
2931
}
2938
2932
2939
- BraceStructTypeFoldableImpl ! {
2940
- impl <' tcx> TypeFoldable <' tcx> for Body <' tcx> {
2941
- phase,
2942
- basic_blocks,
2943
- source_scopes,
2944
- source_scope_local_data,
2945
- yield_ty,
2946
- generator_drop,
2947
- generator_layout,
2948
- local_decls,
2949
- user_type_annotations,
2950
- arg_count,
2951
- __upvar_debuginfo_codegen_only_do_not_use,
2952
- spread_arg,
2953
- control_flow_destroyed,
2954
- span,
2955
- cache,
2956
- }
2957
- }
2958
-
2959
- BraceStructTypeFoldableImpl ! {
2960
- impl <' tcx> TypeFoldable <' tcx> for GeneratorLayout <' tcx> {
2961
- field_tys,
2962
- variant_fields,
2963
- storage_conflicts,
2964
- __local_debuginfo_codegen_only_do_not_use,
2965
- }
2966
- }
2967
-
2968
- BraceStructTypeFoldableImpl ! {
2969
- impl <' tcx> TypeFoldable <' tcx> for LocalDecl <' tcx> {
2970
- mutability,
2971
- is_user_variable,
2972
- internal,
2973
- ty,
2974
- user_ty,
2975
- name,
2976
- source_info,
2977
- is_block_tail,
2978
- visibility_scope,
2979
- }
2980
- }
2981
-
2982
- BraceStructTypeFoldableImpl ! {
2983
- impl <' tcx> TypeFoldable <' tcx> for BasicBlockData <' tcx> {
2984
- statements,
2985
- terminator,
2986
- is_cleanup,
2987
- }
2988
- }
2989
-
2990
- BraceStructTypeFoldableImpl ! {
2991
- impl <' tcx> TypeFoldable <' tcx> for Statement <' tcx> {
2992
- source_info, kind
2993
- }
2994
- }
2995
-
2996
- EnumTypeFoldableImpl ! {
2997
- impl <' tcx> TypeFoldable <' tcx> for StatementKind <' tcx> {
2998
- ( StatementKind :: Assign ) ( a) ,
2999
- ( StatementKind :: FakeRead ) ( cause, place) ,
3000
- ( StatementKind :: SetDiscriminant ) { place, variant_index } ,
3001
- ( StatementKind :: StorageLive ) ( a) ,
3002
- ( StatementKind :: StorageDead ) ( a) ,
3003
- ( StatementKind :: InlineAsm ) ( a) ,
3004
- ( StatementKind :: Retag ) ( kind, place) ,
3005
- ( StatementKind :: AscribeUserType ) ( a, v) ,
3006
- ( StatementKind :: Nop ) ,
3007
- }
3008
- }
3009
-
3010
- BraceStructTypeFoldableImpl ! {
3011
- impl <' tcx> TypeFoldable <' tcx> for InlineAsm <' tcx> {
3012
- asm,
3013
- outputs,
3014
- inputs,
3015
- }
3016
- }
3017
-
3018
- EnumTypeFoldableImpl ! {
3019
- impl <' tcx, T > TypeFoldable <' tcx> for ClearCrossCrate <T > {
3020
- ( ClearCrossCrate :: Clear ) ,
3021
- ( ClearCrossCrate :: Set ) ( a) ,
3022
- } where T : TypeFoldable <' tcx>
3023
- }
3024
-
3025
2933
impl < ' tcx > TypeFoldable < ' tcx > for Terminator < ' tcx > {
3026
2934
fn super_fold_with < F : TypeFolder < ' tcx > > ( & self , folder : & mut F ) -> Self {
3027
2935
use crate :: mir:: TerminatorKind :: * ;
0 commit comments