Skip to content

Commit 83e6539

Browse files
author
Lukas Markeffsky
committed
document that Span::to can go backwards
1 parent 94d6245 commit 83e6539

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

compiler/rustc_span/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,9 @@ impl Span {
796796

797797
/// Returns a `Span` that would enclose both `self` and `end`.
798798
///
799+
/// Note that this can also be used to extend the span "backwards":
800+
/// `start.to(end)` and `end.to(start)` return the same `Span`.
801+
///
799802
/// ```text
800803
/// ____ ___
801804
/// self lorem ipsum end

0 commit comments

Comments
 (0)