From 73e0c1e968caaf7b70d659e58c0a40782c60f8da Mon Sep 17 00:00:00 2001 From: bobtwinkles Date: Thu, 26 Apr 2018 18:28:34 -0400 Subject: [PATCH] Fix review nits --- src/libproc_macro/lib.rs | 2 +- src/libsyntax_pos/hygiene.rs | 10 +++++----- src/libsyntax_pos/lib.rs | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index 4d24353a383..f51dbc3772f 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -270,7 +270,7 @@ impl Span { /// `self` was generated from, if any. #[unstable(feature = "proc_macro", issue = "38356")] pub fn parent(&self) -> Option { - 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 diff --git a/src/libsyntax_pos/hygiene.rs b/src/libsyntax_pos/hygiene.rs index 8e9564d0ac1..658408519b9 100644 --- a/src/libsyntax_pos/hygiene.rs +++ b/src/libsyntax_pos/hygiene.rs @@ -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::(); @@ -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 diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs index 19f52d83a01..8d37b4aa396 100644 --- a/src/libsyntax_pos/lib.rs +++ b/src/libsyntax_pos/lib.rs @@ -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 { self.ctxt().outer().expn_info().map(|i| i.call_site)