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
1 changed files with 7 additions and 0 deletions
|
|
@ -347,6 +347,13 @@ impl<'a, 'tcx> Encodable<EncodeContext<'a, 'tcx>> for Symbol {
|
|||
}
|
||||
}
|
||||
|
||||
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…
Add table
Add a link
Reference in a new issue