@@ -31,7 +31,7 @@ use crate::edition::Edition;
31
31
use crate :: symbol:: { kw, Symbol } ;
32
32
33
33
use serialize:: { Encodable , Decodable , Encoder , Decoder } ;
34
- use rustc_data_structures:: fx:: { FxHashMap , FxHashSet } ;
34
+ use rustc_data_structures:: fx:: FxHashMap ;
35
35
use rustc_data_structures:: sync:: Lrc ;
36
36
use std:: fmt;
37
37
@@ -130,32 +130,6 @@ impl Mark {
130
130
HygieneData :: with ( |data| data. is_descendant_of ( self , data. outer ( ctxt) ) )
131
131
}
132
132
133
- /// Computes a mark such that both input marks are descendants of (or equal to) the returned
134
- /// mark. That is, the following holds:
135
- ///
136
- /// ```rust
137
- /// let la = least_ancestor(a, b);
138
- /// assert!(a.is_descendant_of(la))
139
- /// assert!(b.is_descendant_of(la))
140
- /// ```
141
- pub fn least_ancestor ( mut a : Mark , mut b : Mark ) -> Mark {
142
- HygieneData :: with ( |data| {
143
- // Compute the path from a to the root
144
- let mut a_path = FxHashSet :: < Mark > :: default ( ) ;
145
- while a != Mark :: root ( ) {
146
- a_path. insert ( a) ;
147
- a = data. marks [ a. 0 as usize ] . parent ;
148
- }
149
-
150
- // While the path from b to the root hasn't intersected, move up the tree
151
- while !a_path. contains ( & b) {
152
- b = data. marks [ b. 0 as usize ] . parent ;
153
- }
154
-
155
- b
156
- } )
157
- }
158
-
159
133
// Used for enabling some compatibility fallback in resolve.
160
134
#[ inline]
161
135
pub fn looks_like_proc_macro_derive ( self ) -> bool {
0 commit comments