@@ -747,7 +747,7 @@ impl<'a, 'gcx, 'tcx> GenericPredicates<'tcx> {
747
747
}
748
748
}
749
749
750
- #[ derive( Clone , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
750
+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
751
751
pub enum Predicate < ' tcx > {
752
752
/// Corresponds to `where Foo : Bar<A,B,C>`. `Foo` here would be
753
753
/// the `Self` type of the trait reference and `A`, `B`, and `C`
@@ -876,7 +876,7 @@ impl<'a, 'gcx, 'tcx> Predicate<'tcx> {
876
876
}
877
877
}
878
878
879
- #[ derive( Clone , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
879
+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , RustcEncodable , RustcDecodable ) ]
880
880
pub struct TraitPredicate < ' tcx > {
881
881
pub trait_ref : TraitRef < ' tcx >
882
882
}
@@ -928,18 +928,18 @@ impl<'tcx> PolyTraitPredicate<'tcx> {
928
928
}
929
929
}
930
930
931
- #[ derive( Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
931
+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
932
932
pub struct EquatePredicate < ' tcx > ( pub Ty < ' tcx > , pub Ty < ' tcx > ) ; // `0 == 1`
933
933
pub type PolyEquatePredicate < ' tcx > = ty:: Binder < EquatePredicate < ' tcx > > ;
934
934
935
- #[ derive( Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
935
+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
936
936
pub struct OutlivesPredicate < A , B > ( pub A , pub B ) ; // `A : B`
937
937
pub type PolyOutlivesPredicate < A , B > = ty:: Binder < OutlivesPredicate < A , B > > ;
938
938
pub type PolyRegionOutlivesPredicate < ' tcx > = PolyOutlivesPredicate < ty:: Region < ' tcx > ,
939
939
ty:: Region < ' tcx > > ;
940
940
pub type PolyTypeOutlivesPredicate < ' tcx > = PolyOutlivesPredicate < Ty < ' tcx > , ty:: Region < ' tcx > > ;
941
941
942
- #[ derive( Clone , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
942
+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , Debug , RustcEncodable , RustcDecodable ) ]
943
943
pub struct SubtypePredicate < ' tcx > {
944
944
pub a_is_expected : bool ,
945
945
pub a : Ty < ' tcx > ,
@@ -1173,7 +1173,7 @@ pub struct ParameterEnvironment<'tcx> {
1173
1173
/// Obligations that the caller must satisfy. This is basically
1174
1174
/// the set of bounds on the in-scope type parameters, translated
1175
1175
/// into Obligations, and elaborated and normalized.
1176
- pub caller_bounds : Vec < ty:: Predicate < ' tcx > > ,
1176
+ pub caller_bounds : & ' tcx [ ty:: Predicate < ' tcx > ] ,
1177
1177
1178
1178
/// Scope that is attached to free regions for this scope. This is
1179
1179
/// usually the id of the fn body, but for more abstract scopes
@@ -1196,7 +1196,7 @@ pub struct ParameterEnvironment<'tcx> {
1196
1196
1197
1197
impl < ' a , ' tcx > ParameterEnvironment < ' tcx > {
1198
1198
pub fn with_caller_bounds ( & self ,
1199
- caller_bounds : Vec < ty:: Predicate < ' tcx > > )
1199
+ caller_bounds : & ' tcx [ ty:: Predicate < ' tcx > ] )
1200
1200
-> ParameterEnvironment < ' tcx >
1201
1201
{
1202
1202
ParameterEnvironment {
@@ -2441,7 +2441,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2441
2441
pub fn empty_parameter_environment ( self ) -> ParameterEnvironment < ' tcx > {
2442
2442
ty:: ParameterEnvironment {
2443
2443
free_substs : self . intern_substs ( & [ ] ) ,
2444
- caller_bounds : Vec :: new ( ) ,
2444
+ caller_bounds : Slice :: empty ( ) ,
2445
2445
implicit_region_bound : None ,
2446
2446
free_id_outlive : None ,
2447
2447
is_copy_cache : RefCell :: new ( FxHashMap ( ) ) ,
@@ -2516,7 +2516,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
2516
2516
let unnormalized_env = ty:: ParameterEnvironment {
2517
2517
free_substs : free_substs,
2518
2518
implicit_region_bound : free_id_outlive. map ( |f| tcx. mk_region ( ty:: ReScope ( f) ) ) ,
2519
- caller_bounds : predicates,
2519
+ caller_bounds : tcx . intern_predicates ( & predicates) ,
2520
2520
free_id_outlive : free_id_outlive,
2521
2521
is_copy_cache : RefCell :: new ( FxHashMap ( ) ) ,
2522
2522
is_sized_cache : RefCell :: new ( FxHashMap ( ) ) ,
0 commit comments