summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@gmail.com>2014-07-11 15:26:26 -0700
committerSteven Fackler <sfackler@gmail.com>2014-07-11 15:26:26 -0700
commit52ccab1405478837193893ae47d17e3de64a77e6 (patch)
tree35817e112d498c677892fea0226bbc8c718d61c4 /src/libsyntax/parse
parent75c1fb535dc4dc8732c2cf9ed3696789081ab3b7 (diff)
downloadrust-52ccab1405478837193893ae47d17e3de64a77e6.tar.gz
rust-52ccab1405478837193893ae47d17e3de64a77e6.zip
Fix spans for attributes
They used to be one token too long, so you'd see things like
```
rust/rust/test.rs:1:1: 2:2 warning: unused attribute,
rust/rust/test.rs:1 #![foo]
rust/rust/test.rs:2 #![bar]
```
instead of
```
test.rs:1:1: 1:8 warning: unused attribute, #[warn(unused_attribute)] on
by default
test.rs:1 #![foo]
          ^~~~~~~
```
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/attr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/parse/attr.rs b/src/libsyntax/parse/attr.rs
index 55ad1b77123..550dbfdab71 100644
--- a/src/libsyntax/parse/attr.rs
+++ b/src/libsyntax/parse/attr.rs
@@ -85,9 +85,9 @@ impl<'a> ParserAttr for Parser<'a> {
 
                 self.expect(&token::LBRACKET);
                 let meta_item = self.parse_meta_item();
+                let hi = self.span.hi;
                 self.expect(&token::RBRACKET);
 
-                let hi = self.span.hi;
                 (mk_sp(lo, hi), meta_item, style)
             }
             _ => {