Skip to content

Commit

Permalink
Fix review nits
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphire-arches committed Apr 26, 2018
1 parent 498dbe4 commit 73e0c1e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ impl Span {
/// `self` was generated from, if any.
#[unstable(feature = "proc_macro", issue = "38356")]
pub fn parent(&self) -> Option<Span> {
self.0.parent().map(|x| { Span(x) })
self.0.parent().map(Span)
}

/// The span for the origin source code that `self` was generated from. If
Expand Down
10 changes: 5 additions & 5 deletions src/libsyntax_pos/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ impl Mark {
/// mark. That is, the following holds:
///
/// ```rust
/// let lub = lub(a, b);
/// assert!(a.is_descendant_of(lub))
/// assert!(b.is_descendant_of(lub))
/// let la = least_ancestor(a, b);
/// assert!(a.is_descendant_of(la))
/// assert!(b.is_descendant_of(la))
/// ```
pub fn lub(mut a: Mark, mut b: Mark) -> Mark {
pub fn least_ancestor(mut a: Mark, mut b: Mark) -> Mark {
HygieneData::with(|data| {
// Compute the path from a to the root
let mut a_path = FxHashSet::<Mark>();
Expand All @@ -138,7 +138,7 @@ impl Mark {

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

b
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax_pos/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ impl Span {
self.ctxt().outer().expn_info().map(|info| info.call_site.source_callsite()).unwrap_or(self)
}

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

0 comments on commit 73e0c1e

Please sign in to comment.