tokenstream: don't depend on pprust
This commit is contained in:
parent
742ec4b9bf
commit
ab8105ee97
3 changed files with 7 additions and 11 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue