File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
compiler/rustc_metadata/src/rmeta Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -333,12 +333,32 @@ pub(crate) struct CrateDep {
333333 pub is_private : bool ,
334334}
335335
336- #[ derive( MetadataEncodable , MetadataDecodable ) ]
337336pub ( crate ) struct TraitImpls {
338337 trait_id : ( u32 , DefIndex ) ,
339338 impls : LazyArray < ( DefIndex , Option < SimplifiedType > ) > ,
340339}
341340
341+ use rustc_serialize:: { Encodable , Decodable } ;
342+ impl < ' tcx , ' __a > Encodable < EncodeContext < ' __a , ' tcx > > for TraitImpls {
343+ #[ inline]
344+ fn encode ( & self , s : & mut EncodeContext < ' __a , ' tcx > ) {
345+ ( & b"<<TraitImpls>>" [ ..] ) . encode ( s) ;
346+ self . trait_id . encode ( s) ;
347+ self . impls . encode ( s) ;
348+ }
349+ }
350+
351+ impl < ' tcx , ' __a > Decodable < DecodeContext < ' __a , ' tcx > > for TraitImpls {
352+ #[ inline]
353+ fn decode ( d : & mut DecodeContext < ' __a , ' tcx > ) -> Self {
354+ let _header: Vec < u8 > = Decodable :: decode ( d) ;
355+ Self {
356+ trait_id : Decodable :: decode ( d) ,
357+ impls : Decodable :: decode ( d) ,
358+ }
359+ }
360+ }
361+
342362#[ derive( MetadataEncodable , MetadataDecodable ) ]
343363pub ( crate ) struct IncoherentImpls {
344364 self_ty : SimplifiedType ,
You can’t perform that action at this time.
0 commit comments