From ee1b41981873805c69a122c0e6ed25d39e55b535 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 22 May 2013 15:35:25 -0700 Subject: [PATCH] revert no-longer-required workaround for mystery bug, close #3396 --- src/librustc/metadata/encoder.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index d27bfd081bc65..09d48efe09716 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -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