Skip to content

Commit

Permalink
Print proc_macro spans as a half-open range
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dtolnay committed Apr 7, 2018
1 parent 6c08bb8 commit 52766b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libproc_macro/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ impl Span {
#[unstable(feature = "proc_macro", issue = "38356")]
impl fmt::Debug for Span {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{:?} bytes({}...{})",
write!(f, "{:?} bytes({}..{})",
self.0.ctxt(),
self.0.lo().0,
self.0.hi().0)
Expand Down

0 comments on commit 52766b5

Please sign in to comment.