diff options
| author | David Tolnay <dtolnay@gmail.com> | 2018-04-06 22:57:10 -0700 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2018-04-06 22:57:45 -0700 |
| commit | 52766b57477002583b0a72c917a172c082cb4a36 (patch) | |
| tree | 0c5c19c358099382dc6ed22c2050b5384fd0e71f /src/libproc_macro | |
| parent | 6c08bb8b0841ecfbcf6ee22e0690d2e256e84850 (diff) | |
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.
Diffstat (limited to 'src/libproc_macro')
| -rw-r--r-- | src/libproc_macro/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index 257a8a72b1c..449b8fcfb2d 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -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) |
