Skip to content

Commit 52766b5

Browse files
committed
Print proc_macro spans as a half-open range
A span covering a single byte, such as for an operator `+` token, should print as e.g. `80..81` rather than `80...81`. The lo end of the range is inclusive and the hi end is exclusive.
1 parent 6c08bb8 commit 52766b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libproc_macro/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl Span {
338338
#[unstable(feature = "proc_macro", issue = "38356")]
339339
impl fmt::Debug for Span {
340340
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
341-
write!(f, "{:?} bytes({}...{})",
341+
write!(f, "{:?} bytes({}..{})",
342342
self.0.ctxt(),
343343
self.0.lo().0,
344344
self.0.hi().0)

0 commit comments

Comments
 (0)