about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo.net>2015-12-25 13:59:02 -0500
committerMichael Woerister <michaelwoerister@posteo.net>2015-12-28 12:15:44 -0500
commitfa2a7411e403ec31b426c339c9950af8a1037995 (patch)
tree6cac70777036907baec037cdcd5c470ab2e1834e /src/libsyntax
parent89753077fc25abb9d04d24a2b2b73984854f7c3a (diff)
downloadrust-fa2a7411e403ec31b426c339c9950af8a1037995.tar.gz
rust-fa2a7411e403ec31b426c339c9950af8a1037995.zip
Use a more efficient encoding for opaque data in RBML.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/codemap.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs
index 18659cb2e78..19236f2cd98 100644
--- a/src/libsyntax/codemap.rs
+++ b/src/libsyntax/codemap.rs
@@ -164,18 +164,15 @@ impl Eq for Span {}
 
 impl Encodable for Span {
     fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> {
-        // Encode spans as a single u64 in order to cut down on tagging overhead
-        // added by the RBML metadata encoding. The should be solved differently
-        // altogether some time (FIXME #21482)
-        s.emit_u64( (self.lo.0 as u64) | ((self.hi.0 as u64) << 32) )
+        try!(s.emit_u32(self.lo.0));
+        s.emit_u32(self.hi.0)
     }
 }
 
 impl Decodable for Span {
     fn decode<D: Decoder>(d: &mut D) -> Result<Span, D::Error> {
-        let lo_hi: u64 = try! { d.read_u64() };
-        let lo = BytePos(lo_hi as u32);
-        let hi = BytePos((lo_hi >> 32) as u32);
+        let lo = BytePos(try! { d.read_u32() });
+        let hi = BytePos(try! { d.read_u32() });
         Ok(mk_sp(lo, hi))
     }
 }