Skip to content

Commit 16749f9

Browse files
committed
instrument harder
1 parent b6d39de commit 16749f9

File tree

1 file changed

+21
-1
lines changed
  • compiler/rustc_metadata/src/rmeta

1 file changed

+21
-1
lines changed

compiler/rustc_metadata/src/rmeta/mod.rs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,32 @@ pub(crate) struct CrateDep {
333333
pub is_private: bool,
334334
}
335335

336-
#[derive(MetadataEncodable, MetadataDecodable)]
337336
pub(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)]
343363
pub(crate) struct IncoherentImpls {
344364
self_ty: SimplifiedType,

0 commit comments

Comments
 (0)