13
13
//! and a borrowed `TokenStream` is sufficient to build an owned `TokenStream` without taking
14
14
//! ownership of the original.
15
15
16
- use crate :: ext:: base;
17
- use crate :: ext:: mbe:: { self , macro_parser} ;
18
- use crate :: parse:: Directory ;
19
16
use crate :: parse:: token:: { self , DelimToken , Token , TokenKind } ;
20
17
use crate :: print:: pprust;
21
18
@@ -26,7 +23,6 @@ use rustc_data_structures::sync::Lrc;
26
23
use rustc_serialize:: { Decoder , Decodable , Encoder , Encodable } ;
27
24
use smallvec:: { SmallVec , smallvec} ;
28
25
29
- use std:: borrow:: Cow ;
30
26
use std:: { fmt, iter, mem} ;
31
27
32
28
#[ cfg( test) ]
63
59
{ }
64
60
65
61
impl 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
-
77
62
/// Checks if this TokenTree is equal to the other, regardless of span information.
78
63
pub fn eq_unspanned ( & self , other : & TokenTree ) -> bool {
79
64
match ( self , other) {
0 commit comments