diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-05-01 17:54:54 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-05-02 17:00:51 -0700 |
| commit | dc5df61bc1914224d50d92cdd5599b6337ac68f2 (patch) | |
| tree | 1365352083cfe8b3d8864b3c3620ae4e7e51d3c9 /src/libsyntax/codemap.rs | |
| parent | 6f2e429041da1990a91477e37316c73729cb6fe2 (diff) | |
| download | rust-dc5df61bc1914224d50d92cdd5599b6337ac68f2.tar.gz rust-dc5df61bc1914224d50d92cdd5599b6337ac68f2.zip | |
librustc: Update the serializer to work properly with INHTWAMA, removing mutable fields in the process
Diffstat (limited to 'src/libsyntax/codemap.rs')
| -rw-r--r-- | src/libsyntax/codemap.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 5f4967351e1..bbb390e9dc9 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -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) } |
