1
Fork 0

Move encode_metadata out of CrateStore.

This commit is contained in:
Camille GILLOT 2020-11-14 01:59:00 +01:00
parent 11491938f8
commit df54d3980b
9 changed files with 14 additions and 21 deletions

View file

@ -7,7 +7,11 @@ use rustc_middle::middle::cstore::EncodedMetadata;
use rustc_middle::ty::TyCtxt;
// Adapted from https://github.com/rust-lang/rust/blob/da573206f87b5510de4b0ee1a9c044127e409bd3/src/librustc_codegen_llvm/base.rs#L47-L112
pub(crate) fn new_metadata_object(tcx: TyCtxt<'_>, cgu_name: &str, metadata: &EncodedMetadata) -> Vec<u8> {
pub(crate) fn new_metadata_object(
tcx: TyCtxt<'_>,
cgu_name: &str,
metadata: &EncodedMetadata,
) -> Vec<u8> {
use snap::write::FrameEncoder;
use std::io::Write;