1
Fork 0

tokenstream: don't depend on pprust

This commit is contained in:
Mazdak Farrokhzad 2019-10-09 01:45:40 +02:00
parent 742ec4b9bf
commit ab8105ee97
3 changed files with 7 additions and 11 deletions

View file

@ -14,7 +14,6 @@
//! ownership of the original.
use crate::parse::token::{self, DelimToken, Token, TokenKind};
use crate::print::pprust;
use syntax_pos::{BytePos, Span, DUMMY_SP};
#[cfg(target_arch = "x86_64")]
@ -23,7 +22,7 @@ use rustc_data_structures::sync::Lrc;
use rustc_serialize::{Decoder, Decodable, Encoder, Encodable};
use smallvec::{SmallVec, smallvec};
use std::{fmt, iter, mem};
use std::{iter, mem};
#[cfg(test)]
mod tests;
@ -507,12 +506,6 @@ impl Cursor {
}
}
impl fmt::Display for TokenStream {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&pprust::tts_to_string(self.clone()))
}
}
impl Encodable for TokenStream {
fn encode<E: Encoder>(&self, encoder: &mut E) -> Result<(), E::Error> {
self.trees().collect::<Vec<_>>().encode(encoder)