librustc: Update the serializer to work properly with INHTWAMA, removing mutable fields in the process

This commit is contained in:
Patrick Walton
2013-05-01 17:54:54 -07:00
parent 6f2e429041
commit dc5df61bc1
20 changed files with 5290 additions and 504 deletions

View File

@@ -125,17 +125,34 @@ impl cmp::Eq for span {
fn ne(&self, other: &span) -> bool { !(*self).eq(other) }
}
#[cfg(stage0)]
impl<S:Encoder> Encodable<S> for span {
/* Note #1972 -- spans are encoded but not decoded */
fn encode(&self, _s: &S) { _s.emit_nil() }
}
#[cfg(not(stage0))]
impl<S:Encoder> Encodable<S> for span {
/* Note #1972 -- spans are encoded but not decoded */
fn encode(&self, s: &mut S) {
s.emit_nil()
}
}
#[cfg(stage0)]
impl<D:Decoder> Decodable<D> for span {
fn decode(_d: &D) -> span {
dummy_sp()
}
}
#[cfg(not(stage0))]
impl<D:Decoder> Decodable<D> for span {
fn decode(_d: &mut D) -> span {
dummy_sp()
}
}
pub fn spanned<T>(lo: BytePos, hi: BytePos, t: T) -> spanned<T> {
respan(mk_sp(lo, hi), t)
}