Skip to content

Commit

Permalink
Remove unused SyntaxContext serialization impls
Browse files Browse the repository at this point in the history
The implementations were wrong and unused.
  • Loading branch information
matthewjasper committed Aug 13, 2019
1 parent 6f00e1e commit 01587b1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
10 changes: 1 addition & 9 deletions src/librustc_metadata/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use syntax::ast::{self, Ident};
use syntax::source_map;
use syntax::symbol::{Symbol, sym};
use syntax::ext::base::{MacroKind, SyntaxExtension};
use syntax::ext::hygiene::{ExpnId, SyntaxContext};
use syntax::ext::hygiene::ExpnId;
use syntax_pos::{self, Span, BytePos, Pos, DUMMY_SP, NO_EXPANSION};
use log::debug;

Expand Down Expand Up @@ -356,14 +356,6 @@ impl SpecializedDecoder<Ident> for DecodeContext<'_, '_> {
}
}

impl SpecializedDecoder<SyntaxContext> for DecodeContext<'_, '_> {
fn specialized_decode(&mut self) -> Result<SyntaxContext, Self::Error> {
// FIXME(jseyfried): intercrate hygiene

Ok(SyntaxContext::empty())
}
}

impl<'a, 'tcx> SpecializedDecoder<Fingerprint> for DecodeContext<'a, 'tcx> {
fn specialized_decode(&mut self) -> Result<Fingerprint, Self::Error> {
Fingerprint::decode_opaque(&mut self.opaque)
Expand Down
8 changes: 0 additions & 8 deletions src/librustc_metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ use syntax::attr;
use syntax::source_map::Spanned;
use syntax::symbol::{kw, sym, Ident};
use syntax_pos::{self, FileName, SourceFile, Span};
use syntax_pos::hygiene::SyntaxContext;
use log::{debug, trace};

use rustc::hir::{self, PatKind};
Expand Down Expand Up @@ -181,13 +180,6 @@ impl SpecializedEncoder<Ident> for EncodeContext<'tcx> {
}
}

impl SpecializedEncoder<SyntaxContext> for EncodeContext<'tcx> {
fn specialized_encode(&mut self, _ctxt: &SyntaxContext) -> Result<(), Self::Error> {
// FIXME(jseyfried): intercrate hygiene
Ok(())
}
}

impl<'tcx> SpecializedEncoder<LocalDefId> for EncodeContext<'tcx> {
#[inline]
fn specialized_encode(&mut self, def_id: &LocalDefId) -> Result<(), Self::Error> {
Expand Down
5 changes: 0 additions & 5 deletions src/libsyntax_pos/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ use crate::{Span, DUMMY_SP};
use crate::edition::Edition;
use crate::symbol::{kw, Symbol};

use rustc_serialize::{UseSpecializedEncodable, UseSpecializedDecodable};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
use std::fmt;
Expand Down Expand Up @@ -766,7 +765,3 @@ impl DesugaringKind {
}
}
}

impl UseSpecializedEncodable for SyntaxContext {}

impl UseSpecializedDecodable for SyntaxContext {}

0 comments on commit 01587b1

Please sign in to comment.