Skip to content

Commit a2a1033

Browse files
committed
Fix comments of find_oldest_ancestor_in_same_ctxt
Signed-off-by: xizheyin <[email protected]>
1 parent 460259d commit a2a1033

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

compiler/rustc_span/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -762,10 +762,10 @@ impl Span {
762762
Some(self)
763763
}
764764

765-
/// Recursively walk down the expansion ancestors to find the oldest ancestor span with the same
766-
/// [`SyntaxContext`] the initial span.
765+
/// Recursively walk up the expansion ancestors to find the oldest ancestor span with the same
766+
/// [`SyntaxContext`] as the initial span.
767767
///
768-
/// This method is suitable for peeling through *local* macro expansions to find the "innermost"
768+
/// This method is suitable for peeling through *local* macro expansions to find the "outermost"
769769
/// span that is still local and shares the same [`SyntaxContext`]. For example, given
770770
///
771771
/// ```ignore (illustrative example, contains type error)
@@ -787,8 +787,8 @@ impl Span {
787787
/// }
788788
/// ```
789789
///
790-
/// if provided the initial span of `outer!(x)` inside `bar`, this method will recurse
791-
/// the parent callsites until we reach `format!("error: {}", $x)`, at which point it is the
790+
/// if provided the initial span of `format!("error: {}", $x)` inside the expansion, this method will recurse
791+
/// up the parent callsites until we reach `outer!(x)` in `bar`, at which point it is the
792792
/// oldest ancestor span that is both still local and shares the same [`SyntaxContext`] as the
793793
/// initial span.
794794
pub fn find_oldest_ancestor_in_same_ctxt(self) -> Span {

0 commit comments

Comments
 (0)