Skip to content

revert no-longer-required workaround for mystery bug, close #3396 #6688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions src/librustc/metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1455,19 +1455,10 @@ pub fn encode_metadata(parms: EncodeParams, crate: &crate) -> ~[u8] {
// remaining % 4 bytes.
wr.write(&[0u8, 0u8, 0u8, 0u8]);

// FIXME #3396: weird bug here, for reasons unclear this emits random
// looking bytes (mostly 0x1) if we use the version byte-array constant
// above; so we use a string constant inline instead.
//
// Should be:
//
// vec::to_owned(metadata_encoding_version) +

let writer_bytes: &mut ~[u8] = wr.bytes;

(do str::as_bytes(&~"rust\x00\x00\x00\x01") |bytes| {
vec::slice(*bytes, 0, 8).to_vec()
}) + flate::deflate_bytes(*writer_bytes)
vec::to_owned(metadata_encoding_version) +
flate::deflate_bytes(*writer_bytes)
}

// Get the encoded string for a type
Expand Down