Skip to content

Commit 4d7c297

Browse files
committed
(FIX) Change encoder::encode_metadata to return a [u8] (which will become an LLVM string)
1 parent 5847cf0 commit 4d7c297

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/comp/metadata/encoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ fn encode_hash(ebml_w: ebml::writer, hash: str) {
662662
ebml::end_tag(ebml_w);
663663
}
664664

665-
fn encode_metadata(cx: @crate_ctxt, crate: @crate) -> str {
665+
fn encode_metadata(cx: @crate_ctxt, crate: @crate) -> [u8] {
666666

667667
let abbrevs = ty::new_ty_hash();
668668
let ecx = @{ccx: cx, type_abbrevs: abbrevs};
@@ -695,7 +695,7 @@ fn encode_metadata(cx: @crate_ctxt, crate: @crate) -> str {
695695
// Pad this, since something (LLVM, presumably) is cutting off the
696696
// remaining % 4 bytes.
697697
buf_w.write([0u8, 0u8, 0u8, 0u8]);
698-
io::mem_buffer_str(buf)
698+
io::mem_buffer_buf(buf)
699699
}
700700

701701
// Get the encoded string for a type

src/comp/middle/trans.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5419,7 +5419,7 @@ fn fill_crate_map(ccx: @crate_ctxt, map: ValueRef) {
54195419

54205420
fn write_metadata(cx: @crate_ctxt, crate: @ast::crate) {
54215421
if !cx.sess.building_library { ret; }
5422-
let llmeta = C_postr(metadata::encoder::encode_metadata(cx, crate));
5422+
let llmeta = C_bytes(metadata::encoder::encode_metadata(cx, crate));
54235423
let llconst = trans_common::C_struct([llmeta]);
54245424
let llglobal =
54255425
str::as_buf("rust_metadata",

0 commit comments

Comments
 (0)