From 1c0a5469edcb11bdbfd44a1eb227aacd95aff0ca Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Tue, 13 Aug 2019 19:19:31 +0100 Subject: [PATCH] Remove unused `SyntaxContext` serialization impls The implementations were wrong and unused. --- src/librustc_metadata/decoder.rs | 8 -------- src/librustc_metadata/encoder.rs | 8 -------- src/libsyntax_pos/hygiene.rs | 4 ---- 3 files changed, 20 deletions(-) diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs index 4365b1bee583f..772b2d3ec4d85 100644 --- a/src/librustc_metadata/decoder.rs +++ b/src/librustc_metadata/decoder.rs @@ -356,14 +356,6 @@ impl SpecializedDecoder for DecodeContext<'_, '_> { } } -impl SpecializedDecoder for DecodeContext<'_, '_> { - fn specialized_decode(&mut self) -> Result { - // FIXME(jseyfried): intercrate hygiene - - Ok(SyntaxContext::empty()) - } -} - impl<'a, 'tcx> SpecializedDecoder for DecodeContext<'a, 'tcx> { fn specialized_decode(&mut self) -> Result { Fingerprint::decode_opaque(&mut self.opaque) diff --git a/src/librustc_metadata/encoder.rs b/src/librustc_metadata/encoder.rs index 34ccdad8636c9..e2de0552cd651 100644 --- a/src/librustc_metadata/encoder.rs +++ b/src/librustc_metadata/encoder.rs @@ -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}; @@ -181,13 +180,6 @@ impl SpecializedEncoder for EncodeContext<'tcx> { } } -impl SpecializedEncoder for EncodeContext<'tcx> { - fn specialized_encode(&mut self, _ctxt: &SyntaxContext) -> Result<(), Self::Error> { - // FIXME(jseyfried): intercrate hygiene - Ok(()) - } -} - impl<'tcx> SpecializedEncoder for EncodeContext<'tcx> { #[inline] fn specialized_encode(&mut self, def_id: &LocalDefId) -> Result<(), Self::Error> { diff --git a/src/libsyntax_pos/hygiene.rs b/src/libsyntax_pos/hygiene.rs index 1e40994e77bf1..ebfb0764fa2b2 100644 --- a/src/libsyntax_pos/hygiene.rs +++ b/src/libsyntax_pos/hygiene.rs @@ -750,7 +750,3 @@ impl Decodable for ExpnId { Ok(ExpnId::root()) // FIXME(jseyfried) intercrate hygiene } } - -impl UseSpecializedEncodable for SyntaxContext {} - -impl UseSpecializedDecodable for SyntaxContext {}