@@ -45,7 +45,7 @@ impl UpvarId {
4545
4646/// Information describing the capture of an upvar. This is computed
4747/// 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 ) ]
4949#[ derive( TypeFoldable , TypeVisitable ) ]
5050pub enum UpvarCapture {
5151 /// Upvar is captured by value. This is always true when the
@@ -73,7 +73,7 @@ pub type RootVariableMinCaptureList<'tcx> = FxIndexMap<hir::HirId, MinCaptureLis
7373pub type MinCaptureList < ' tcx > = Vec < CapturedPlace < ' tcx > > ;
7474
7575/// 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 ) ]
7777#[ derive( TypeFoldable , TypeVisitable ) ]
7878pub struct CapturedPlace < ' tcx > {
7979 /// Name and span where the binding happens.
@@ -192,7 +192,7 @@ impl<'tcx> CapturedPlace<'tcx> {
192192#[ derive( Copy , Clone , Debug , HashStable ) ]
193193pub struct ClosureTypeInfo < ' tcx > {
194194 user_provided_sig : ty:: CanonicalPolyFnSig < ' tcx > ,
195- captures : & ' tcx [ & ' tcx ty:: CapturedPlace < ' tcx > ] ,
195+ captures : & ' tcx ty :: List < & ' tcx ty:: CapturedPlace < ' tcx > > ,
196196 kind_origin : Option < & ' tcx ( Span , HirPlace < ' tcx > ) > ,
197197}
198198
@@ -201,7 +201,7 @@ fn closure_typeinfo<'tcx>(tcx: TyCtxt<'tcx>, def: LocalDefId) -> ClosureTypeInfo
201201 let typeck_results = tcx. typeck ( def) ;
202202 let user_provided_sig = typeck_results. user_provided_sigs [ & def] ;
203203 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) ;
205205 let hir_id = tcx. local_def_id_to_hir_id ( def) ;
206206 let kind_origin = typeck_results. closure_kind_origins ( ) . get ( hir_id) ;
207207 ClosureTypeInfo { user_provided_sig, captures, kind_origin }
@@ -253,7 +253,7 @@ pub fn is_ancestor_or_same_capture(
253253/// Part of `MinCaptureInformationMap`; describes the capture kind (&, &mut, move)
254254/// for a particular capture as well as identifying the part of the source code
255255/// 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 ) ]
257257#[ derive( TypeFoldable , TypeVisitable ) ]
258258pub struct CaptureInfo {
259259 /// 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
332332 curr_string
333333}
334334
335- #[ derive( Clone , PartialEq , Debug , TyEncodable , TyDecodable , Copy , HashStable ) ]
335+ #[ derive( Eq , Clone , PartialEq , Debug , TyEncodable , TyDecodable , Copy , HashStable , Hash ) ]
336336#[ derive( TypeFoldable , TypeVisitable ) ]
337337pub enum BorrowKind {
338338 /// Data must be immutable and is aliasable.
0 commit comments