Skip to content

E0537 has a span with extra characters #36182

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
sophiajt opened this issue Aug 31, 2016 · 2 comments · Fixed by #36354
Closed

E0537 has a span with extra characters #36182

sophiajt opened this issue Aug 31, 2016 · 2 comments · Fixed by #36354

Comments

@sophiajt
Copy link
Contributor

sophiajt commented Aug 31, 2016

error[E0537]: invalid predicate `unknown`
  --> src/test/compile-fail/E0537.rs:11:7
   |
11 | #[cfg(unknown())] //~ ERROR E0537
   |       ^^^^^^^^^^

Currently, we underline a little too much of the predicate. Notice that we underline two ) instead of just the matching )

I noticed that E0535 and E0536 also have the same problem

@mikhail-m1
Copy link
Contributor

I think bug in this line https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/attr.rs#L239
it takes span.hi from unprocessed (current) token. It's can be easy fixed by taking span.lo, but this will work incorrect for spaces between )) . I tried add some spaces but parse failed.

@mikhail-m1
Copy link
Contributor

parser has last_span, so just need to change span -> last_span :)

bors added a commit that referenced this issue Sep 12, 2016
fix span for errors E0537, E0535 & E0536

fix #36182 as part of #35233
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants