@@ -167,10 +167,7 @@ pub(super) struct DecodeContext<'a, 'tcx> {
167
167
/// Abstract over the various ways one can create metadata decoders.
168
168
pub ( super ) trait Metadata < ' a , ' tcx > : Copy {
169
169
fn blob ( self ) -> & ' a MetadataBlob ;
170
- #[ inline]
171
- fn raw_bytes ( self ) -> & ' a [ u8 ] {
172
- self . blob ( )
173
- }
170
+
174
171
fn cdata ( self ) -> Option < CrateMetadataRef < ' a > > {
175
172
None
176
173
}
@@ -184,7 +181,7 @@ pub(super) trait Metadata<'a, 'tcx>: Copy {
184
181
fn decoder ( self , pos : usize ) -> DecodeContext < ' a , ' tcx > {
185
182
let tcx = self . tcx ( ) ;
186
183
DecodeContext {
187
- opaque : opaque:: Decoder :: new ( self . raw_bytes ( ) , pos) ,
184
+ opaque : opaque:: Decoder :: new ( self . blob ( ) , pos) ,
188
185
cdata : self . cdata ( ) ,
189
186
blob : self . blob ( ) ,
190
187
sess : self . sess ( ) . or ( tcx. map ( |tcx| tcx. sess ) ) ,
@@ -637,7 +634,7 @@ impl MetadataBlob {
637
634
}
638
635
639
636
crate fn is_compatible ( & self ) -> bool {
640
- self . raw_bytes ( ) . starts_with ( METADATA_HEADER )
637
+ self . blob ( ) . starts_with ( METADATA_HEADER )
641
638
}
642
639
643
640
crate fn get_rustc_version ( & self ) -> String {
@@ -646,7 +643,7 @@ impl MetadataBlob {
646
643
}
647
644
648
645
crate fn get_root ( & self ) -> CrateRoot < ' tcx > {
649
- let slice = self . raw_bytes ( ) ;
646
+ let slice = & self . blob ( ) [ .. ] ;
650
647
let offset = METADATA_HEADER . len ( ) ;
651
648
let pos = ( ( ( slice[ offset + 0 ] as u32 ) << 24 )
652
649
| ( ( slice[ offset + 1 ] as u32 ) << 16 )
0 commit comments