Skip to content

Commit 73e0c1e

Browse files
Fix review nits
1 parent 498dbe4 commit 73e0c1e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/libproc_macro/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ impl Span {
270270
/// `self` was generated from, if any.
271271
#[unstable(feature = "proc_macro", issue = "38356")]
272272
pub fn parent(&self) -> Option<Span> {
273-
self.0.parent().map(|x| { Span(x) })
273+
self.0.parent().map(Span)
274274
}
275275

276276
/// The span for the origin source code that `self` was generated from. If

src/libsyntax_pos/hygiene.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ impl Mark {
123123
/// mark. That is, the following holds:
124124
///
125125
/// ```rust
126-
/// let lub = lub(a, b);
127-
/// assert!(a.is_descendant_of(lub))
128-
/// assert!(b.is_descendant_of(lub))
126+
/// let la = least_ancestor(a, b);
127+
/// assert!(a.is_descendant_of(la))
128+
/// assert!(b.is_descendant_of(la))
129129
/// ```
130-
pub fn lub(mut a: Mark, mut b: Mark) -> Mark {
130+
pub fn least_ancestor(mut a: Mark, mut b: Mark) -> Mark {
131131
HygieneData::with(|data| {
132132
// Compute the path from a to the root
133133
let mut a_path = FxHashSet::<Mark>();
@@ -138,7 +138,7 @@ impl Mark {
138138

139139
// While the path from b to the root hasn't intersected, move up the tree
140140
while !a_path.contains(&b) {
141-
b = data.marks[b.0 as usize].parent;
141+
b = data.marks[b.0 as usize].parent;
142142
}
143143

144144
b

src/libsyntax_pos/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ impl Span {
291291
self.ctxt().outer().expn_info().map(|info| info.call_site.source_callsite()).unwrap_or(self)
292292
}
293293

294-
/// The `Span for the tokens in the previous macro expansion from which `self` was generated,
294+
/// The `Span` for the tokens in the previous macro expansion from which `self` was generated,
295295
/// if any
296296
pub fn parent(self) -> Option<Span> {
297297
self.ctxt().outer().expn_info().map(|i| i.call_site)

0 commit comments

Comments
 (0)