Skip to content

Commit 01587b1

Browse files
committed
Remove unused SyntaxContext serialization impls
The implementations were wrong and unused.
1 parent 6f00e1e commit 01587b1

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

src/librustc_metadata/decoder.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use syntax::ast::{self, Ident};
3131
use syntax::source_map;
3232
use syntax::symbol::{Symbol, sym};
3333
use syntax::ext::base::{MacroKind, SyntaxExtension};
34-
use syntax::ext::hygiene::{ExpnId, SyntaxContext};
34+
use syntax::ext::hygiene::ExpnId;
3535
use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP, NO_EXPANSION};
3636
use log::debug;
3737

@@ -356,14 +356,6 @@ impl SpecializedDecoder<Ident> for DecodeContext<'_, '_> {
356356
}
357357
}
358358

359-
impl SpecializedDecoder<SyntaxContext> for DecodeContext<'_, '_> {
360-
fn specialized_decode(&mut self) -> Result<SyntaxContext, Self::Error> {
361-
// FIXME(jseyfried): intercrate hygiene
362-
363-
Ok(SyntaxContext::empty())
364-
}
365-
}
366-
367359
impl<'a, 'tcx> SpecializedDecoder<Fingerprint> for DecodeContext<'a, 'tcx> {
368360
fn specialized_decode(&mut self) -> Result<Fingerprint, Self::Error> {
369361
Fingerprint::decode_opaque(&mut self.opaque)

src/librustc_metadata/encoder.rs

-8
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ use syntax::attr;
3333
use syntax::source_map::Spanned;
3434
use syntax::symbol::{kw, sym, Ident};
3535
use syntax_pos::{self, FileName, SourceFile, Span};
36-
use syntax_pos::hygiene::SyntaxContext;
3736
use log::{debug, trace};
3837

3938
use rustc::hir::{self, PatKind};
@@ -181,13 +180,6 @@ impl SpecializedEncoder<Ident> for EncodeContext<'tcx> {
181180
}
182181
}
183182

184-
impl SpecializedEncoder<SyntaxContext> for EncodeContext<'tcx> {
185-
fn specialized_encode(&mut self, _ctxt: &SyntaxContext) -> Result<(), Self::Error> {
186-
// FIXME(jseyfried): intercrate hygiene
187-
Ok(())
188-
}
189-
}
190-
191183
impl<'tcx> SpecializedEncoder<LocalDefId> for EncodeContext<'tcx> {
192184
#[inline]
193185
fn specialized_encode(&mut self, def_id: &LocalDefId) -> Result<(), Self::Error> {

src/libsyntax_pos/hygiene.rs

-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use crate::{Span, DUMMY_SP};
3030
use crate::edition::Edition;
3131
use crate::symbol::{kw, Symbol};
3232

33-
use rustc_serialize::{UseSpecializedEncodable, UseSpecializedDecodable};
3433
use rustc_data_structures::fx::FxHashMap;
3534
use rustc_data_structures::sync::Lrc;
3635
use std::fmt;
@@ -766,7 +765,3 @@ impl DesugaringKind {
766765
}
767766
}
768767
}
769-
770-
impl UseSpecializedEncodable for SyntaxContext {}
771-
772-
impl UseSpecializedDecodable for SyntaxContext {}

0 commit comments

Comments
 (0)