Skip to content

Commit d577eaf

Browse files
committed
auto merge of #6688 : graydon/rust/issue-3396-mystery-bug-in-metadata, r=Aatch
Whatever it was, it is no longer a problem here.
2 parents a6b05b3 + ee1b419 commit d577eaf

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/librustc/metadata/encoder.rs

+2-11
Original file line numberDiff line numberDiff line change
@@ -1470,19 +1470,10 @@ pub fn encode_metadata(parms: EncodeParams, crate: &crate) -> ~[u8] {
14701470
// remaining % 4 bytes.
14711471
wr.write(&[0u8, 0u8, 0u8, 0u8]);
14721472

1473-
// FIXME #3396: weird bug here, for reasons unclear this emits random
1474-
// looking bytes (mostly 0x1) if we use the version byte-array constant
1475-
// above; so we use a string constant inline instead.
1476-
//
1477-
// Should be:
1478-
//
1479-
// vec::to_owned(metadata_encoding_version) +
1480-
14811473
let writer_bytes: &mut ~[u8] = wr.bytes;
14821474

1483-
(do str::as_bytes(&~"rust\x00\x00\x00\x01") |bytes| {
1484-
vec::slice(*bytes, 0, 8).to_vec()
1485-
}) + flate::deflate_bytes(*writer_bytes)
1475+
vec::to_owned(metadata_encoding_version) +
1476+
flate::deflate_bytes(*writer_bytes)
14861477
}
14871478

14881479
// Get the encoded string for a type

0 commit comments

Comments
 (0)