@@ -45,7 +45,7 @@ impl UpvarId {
45
45
46
46
/// Information describing the capture of an upvar. This is computed
47
47
/// during `typeck`, specifically by `regionck`.
48
- #[ derive( PartialEq , Clone , Debug , Copy , TyEncodable , TyDecodable , HashStable ) ]
48
+ #[ derive( Eq , PartialEq , Clone , Debug , Copy , TyEncodable , TyDecodable , HashStable , Hash ) ]
49
49
#[ derive( TypeFoldable , TypeVisitable ) ]
50
50
pub enum UpvarCapture {
51
51
/// Upvar is captured by value. This is always true when the
@@ -73,7 +73,7 @@ pub type RootVariableMinCaptureList<'tcx> = FxIndexMap<hir::HirId, MinCaptureLis
73
73
pub type MinCaptureList < ' tcx > = Vec < CapturedPlace < ' tcx > > ;
74
74
75
75
/// A composite describing a `Place` that is captured by a closure.
76
- #[ derive( PartialEq , Clone , Debug , TyEncodable , TyDecodable , HashStable ) ]
76
+ #[ derive( Eq , PartialEq , Clone , Debug , TyEncodable , TyDecodable , HashStable , Hash ) ]
77
77
#[ derive( TypeFoldable , TypeVisitable ) ]
78
78
pub struct CapturedPlace < ' tcx > {
79
79
/// Name and span where the binding happens.
@@ -192,7 +192,7 @@ impl<'tcx> CapturedPlace<'tcx> {
192
192
#[ derive( Copy , Clone , Debug , HashStable ) ]
193
193
pub struct ClosureTypeInfo < ' tcx > {
194
194
user_provided_sig : ty:: CanonicalPolyFnSig < ' tcx > ,
195
- captures : & ' tcx [ & ' tcx ty:: CapturedPlace < ' tcx > ] ,
195
+ captures : & ' tcx ty :: List < & ' tcx ty:: CapturedPlace < ' tcx > > ,
196
196
kind_origin : Option < & ' tcx ( Span , HirPlace < ' tcx > ) > ,
197
197
}
198
198
@@ -201,7 +201,7 @@ fn closure_typeinfo<'tcx>(tcx: TyCtxt<'tcx>, def: LocalDefId) -> ClosureTypeInfo
201
201
let typeck_results = tcx. typeck ( def) ;
202
202
let user_provided_sig = typeck_results. user_provided_sigs [ & def] ;
203
203
let captures = typeck_results. closure_min_captures_flattened ( def) ;
204
- let captures = tcx. arena . alloc_from_iter ( captures) ;
204
+ let captures = tcx. mk_captures_from_iter ( captures) ;
205
205
let hir_id = tcx. local_def_id_to_hir_id ( def) ;
206
206
let kind_origin = typeck_results. closure_kind_origins ( ) . get ( hir_id) ;
207
207
ClosureTypeInfo { user_provided_sig, captures, kind_origin }
@@ -253,7 +253,7 @@ pub fn is_ancestor_or_same_capture(
253
253
/// Part of `MinCaptureInformationMap`; describes the capture kind (&, &mut, move)
254
254
/// for a particular capture as well as identifying the part of the source code
255
255
/// that triggered this capture to occur.
256
- #[ derive( PartialEq , Clone , Debug , Copy , TyEncodable , TyDecodable , HashStable ) ]
256
+ #[ derive( Eq , PartialEq , Clone , Debug , Copy , TyEncodable , TyDecodable , HashStable , Hash ) ]
257
257
#[ derive( TypeFoldable , TypeVisitable ) ]
258
258
pub struct CaptureInfo {
259
259
/// Expr Id pointing to use that resulted in selecting the current capture kind
@@ -332,7 +332,7 @@ pub fn place_to_string_for_capture<'tcx>(tcx: TyCtxt<'tcx>, place: &HirPlace<'tc
332
332
curr_string
333
333
}
334
334
335
- #[ derive( Clone , PartialEq , Debug , TyEncodable , TyDecodable , Copy , HashStable ) ]
335
+ #[ derive( Eq , Clone , PartialEq , Debug , TyEncodable , TyDecodable , Copy , HashStable , Hash ) ]
336
336
#[ derive( TypeFoldable , TypeVisitable ) ]
337
337
pub enum BorrowKind {
338
338
/// Data must be immutable and is aliasable.
0 commit comments