Auto merge of #115287 - saethlin:more-specialer, r=cjgillot
Add a specialization for encoding byte arrays in rmeta This specialization already exists for FileEncoder, but since EncodeContext is implemented by forwarding down to FileEncoder, using EncodeContext used to bypass the specialization.
This commit is contained in:
commit
3f8c8f51f7
@ -347,6 +347,13 @@ fn encode(&self, s: &mut EncodeContext<'a, 'tcx>) {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for [u8] {
|
||||
fn encode(&self, e: &mut EncodeContext<'a, 'tcx>) {
|
||||
Encoder::emit_usize(e, self.len());
|
||||
e.emit_raw_bytes(self);
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> TyEncoder for EncodeContext<'a, 'tcx> {
|
||||
const CLEAR_CROSS_CRATE: bool = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user