File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ impl Span {
270
270
/// `self` was generated from, if any.
271
271
#[ unstable( feature = "proc_macro" , issue = "38356" ) ]
272
272
pub fn parent ( & self ) -> Option < Span > {
273
- self . 0 . parent ( ) . map ( |x| { Span ( x ) } )
273
+ self . 0 . parent ( ) . map ( Span )
274
274
}
275
275
276
276
/// The span for the origin source code that `self` was generated from. If
Original file line number Diff line number Diff line change @@ -123,11 +123,11 @@ impl Mark {
123
123
/// mark. That is, the following holds:
124
124
///
125
125
/// ```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 ))
129
129
/// ```
130
- pub fn lub ( mut a : Mark , mut b : Mark ) -> Mark {
130
+ pub fn least_ancestor ( mut a : Mark , mut b : Mark ) -> Mark {
131
131
HygieneData :: with ( |data| {
132
132
// Compute the path from a to the root
133
133
let mut a_path = FxHashSet :: < Mark > ( ) ;
@@ -138,7 +138,7 @@ impl Mark {
138
138
139
139
// While the path from b to the root hasn't intersected, move up the tree
140
140
while !a_path. contains ( & b) {
141
- b = data. marks [ b. 0 as usize ] . parent ;
141
+ b = data. marks [ b. 0 as usize ] . parent ;
142
142
}
143
143
144
144
b
Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ impl Span {
291
291
self . ctxt ( ) . outer ( ) . expn_info ( ) . map ( |info| info. call_site . source_callsite ( ) ) . unwrap_or ( self )
292
292
}
293
293
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,
295
295
/// if any
296
296
pub fn parent ( self ) -> Option < Span > {
297
297
self . ctxt ( ) . outer ( ) . expn_info ( ) . map ( |i| i. call_site )
You can’t perform that action at this time.
0 commit comments