diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2016-08-31 14:00:29 +0300 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2016-09-20 20:07:54 +0300 |
| commit | fc363cb482f92851b48b46402b5b5117627a840e (patch) | |
| tree | 3fcb17d93a2ee42b2dc266c486e1c651260fa393 /src/libsyntax_pos | |
| parent | 91e7239db40372027a642bdbda19a6d593155a9f (diff) | |
rustc_metadata: go only through rustc_serialize in astencode.
Diffstat (limited to 'src/libsyntax_pos')
| -rw-r--r-- | src/libsyntax_pos/lib.rs | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index d835f8058fa..fb59f411106 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -28,6 +28,7 @@ #![feature(rustc_private)] #![feature(staged_api)] #![feature(question_mark)] +#![feature(specialization)] use std::cell::{Cell, RefCell}; use std::ops::{Add, Sub}; @@ -151,21 +152,7 @@ impl Encodable for Span { } } -impl Decodable for Span { - fn decode<D: Decoder>(d: &mut D) -> Result<Span, D::Error> { - d.read_struct("Span", 2, |d| { - let lo = d.read_struct_field("lo", 0, |d| { - BytePos::decode(d) - })?; - - let hi = d.read_struct_field("hi", 1, |d| { - BytePos::decode(d) - })?; - - Ok(mk_sp(lo, hi)) - }) - } -} +impl serialize::UseSpecializedDecodable for Span {} fn default_span_debug(span: Span, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Span {{ lo: {:?}, hi: {:?}, expn_id: {:?} }}", |
