1313//! and a borrowed `TokenStream` is sufficient to build an owned `TokenStream` without taking
1414//! ownership of the original.
1515
16- use crate :: ext:: base;
17- use crate :: ext:: mbe:: { self , macro_parser} ;
18- use crate :: parse:: Directory ;
1916use crate :: parse:: token:: { self , DelimToken , Token , TokenKind } ;
2017use crate :: print:: pprust;
2118
@@ -26,7 +23,6 @@ use rustc_data_structures::sync::Lrc;
2623use rustc_serialize:: { Decoder , Decodable , Encoder , Encodable } ;
2724use smallvec:: { SmallVec , smallvec} ;
2825
29- use std:: borrow:: Cow ;
3026use std:: { fmt, iter, mem} ;
3127
3228#[ cfg( test) ]
6359{ }
6460
6561impl TokenTree {
66- /// Use this token tree as a matcher to parse given tts.
67- crate fn parse ( cx : & base:: ExtCtxt < ' _ > , mtch : & [ mbe:: TokenTree ] , tts : TokenStream )
68- -> macro_parser:: NamedParseResult {
69- // `None` is because we're not interpolating
70- let directory = Directory {
71- path : Cow :: from ( cx. current_expansion . module . directory . as_path ( ) ) ,
72- ownership : cx. current_expansion . directory_ownership ,
73- } ;
74- macro_parser:: parse ( cx. parse_sess ( ) , tts, mtch, Some ( directory) , true )
75- }
76-
7762 /// Checks if this TokenTree is equal to the other, regardless of span information.
7863 pub fn eq_unspanned ( & self , other : & TokenTree ) -> bool {
7964 match ( self , other) {
0 commit comments