about summary refs log tree commit diff
path: root/src/libsyntax/tokenstream.rs
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2019-09-22 19:41:04 +0300
committerAleksey Kladov <aleksey.kladov@gmail.com>2019-09-22 20:38:02 +0300
commit983569732d24df434c644dd1764e9c5e4ecfd081 (patch)
tree108253b396fa76a4bdb4140e3a39a119911296b1 /src/libsyntax/tokenstream.rs
parent9fd75f52877a3e23a7b9a6a9675f37a42340a428 (diff)
downloadrust-983569732d24df434c644dd1764e9c5e4ecfd081.tar.gz
rust-983569732d24df434c644dd1764e9c5e4ecfd081.zip
push TokenTree::parse down
Diffstat (limited to 'src/libsyntax/tokenstream.rs')
-rw-r--r--src/libsyntax/tokenstream.rs15
1 files changed, 0 insertions, 15 deletions
diff --git a/src/libsyntax/tokenstream.rs b/src/libsyntax/tokenstream.rs
index fd87f8a1f67..26cae2a8e7c 100644
--- a/src/libsyntax/tokenstream.rs
+++ b/src/libsyntax/tokenstream.rs
@@ -13,9 +13,6 @@
 //! and a borrowed `TokenStream` is sufficient to build an owned `TokenStream` without taking
 //! ownership of the original.
 
-use crate::ext::base;
-use crate::ext::mbe::{self, macro_parser};
-use crate::parse::Directory;
 use crate::parse::token::{self, DelimToken, Token, TokenKind};
 use crate::print::pprust;
 
@@ -26,7 +23,6 @@ use rustc_data_structures::sync::Lrc;
 use rustc_serialize::{Decoder, Decodable, Encoder, Encodable};
 use smallvec::{SmallVec, smallvec};
 
-use std::borrow::Cow;
 use std::{fmt, iter, mem};
 
 #[cfg(test)]
@@ -63,17 +59,6 @@ where
 {}
 
 impl TokenTree {
-    /// Use this token tree as a matcher to parse given tts.
-    crate fn parse(cx: &base::ExtCtxt<'_>, mtch: &[mbe::TokenTree], tts: TokenStream)
-                 -> macro_parser::NamedParseResult {
-        // `None` is because we're not interpolating
-        let directory = Directory {
-            path: Cow::from(cx.current_expansion.module.directory.as_path()),
-            ownership: cx.current_expansion.directory_ownership,
-        };
-        macro_parser::parse(cx.parse_sess(), tts, mtch, Some(directory), true)
-    }
-
     /// Checks if this TokenTree is equal to the other, regardless of span information.
     pub fn eq_unspanned(&self, other: &TokenTree) -> bool {
         match (self, other) {