Skip to content

Commit 62a1f5d

Browse files
committed
hygiene: Remove some dead code
1 parent f1d4ebf commit 62a1f5d

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

src/libsyntax_pos/hygiene.rs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use crate::edition::Edition;
3131
use crate::symbol::{kw, Symbol};
3232

3333
use serialize::{Encodable, Decodable, Encoder, Decoder};
34-
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
34+
use rustc_data_structures::fx::FxHashMap;
3535
use rustc_data_structures::sync::Lrc;
3636
use std::fmt;
3737

@@ -130,32 +130,6 @@ impl Mark {
130130
HygieneData::with(|data| data.is_descendant_of(self, data.outer(ctxt)))
131131
}
132132

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-
159133
// Used for enabling some compatibility fallback in resolve.
160134
#[inline]
161135
pub fn looks_like_proc_macro_derive(self) -> bool {

0 commit comments

Comments
 (0)