//! and a borrowed `TokenStream` is sufficient to build an owned `TokenStream` without taking
//! ownership of the original.
+use crate::ext::base;
+use crate::ext::tt::{macro_parser, quoted};
+use crate::parse::Directory;
+use crate::parse::token::{self, DelimToken, Token};
+use crate::print::pprust;
+
use syntax_pos::{BytePos, Mark, Span, DUMMY_SP};
-use ext::base;
-use ext::tt::{macro_parser, quoted};
-use parse::Directory;
-use parse::token::{self, DelimToken, Token};
-use print::pprust;
+#[cfg(target_arch = "x86_64")]
+use rustc_data_structures::static_assert;
use rustc_data_structures::sync::Lrc;
use serialize::{Decoder, Decodable, Encoder, Encodable};
impl TokenTree {
/// Use this token tree as a matcher to parse given tts.
- pub fn parse(cx: &base::ExtCtxt, mtch: &[quoted::TokenTree], tts: TokenStream)
+ pub fn parse(cx: &base::ExtCtxt<'_>, mtch: &[quoted::TokenTree], tts: TokenStream)
-> macro_parser::NamedParseResult {
// `None` is because we're not interpolating
let directory = Directory {
NonJoint
}
-use self::IsJoint::*;
+use IsJoint::*;
impl TokenStream {
/// Given a `TokenStream` with a `Stream` of only two arguments, return a new `TokenStream`
}
impl fmt::Display for TokenStream {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&pprust::tokens_to_string(self.clone()))
}
}
#[cfg(test)]
mod tests {
use super::*;
- use syntax::ast::Ident;
- use with_globals;
+ use crate::syntax::ast::Ident;
+ use crate::with_globals;
+ use crate::parse::token::Token;
+ use crate::util::parser_testing::string_to_stream;
use syntax_pos::{Span, BytePos, NO_EXPANSION};
- use parse::token::Token;
- use util::parser_testing::string_to_stream;
fn string_to_ts(string: &str) -> TokenStream {
string_to_stream(string.to_owned())