-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Macro errors are reported at def, not use #1448
Comments
I looked at simplext.rs briefly and couldn't understand what it was doing. |
I will try to look into it this week if I can find the time, I want to understand what that code is doing anyway. |
Actually using the example given, and the latest Rust compiler (0.10), the problem is closer to #1387. For an example of this bug try:
Here I know exactly what is going on, the span used is the one for the location of the pattern variable Failing a full backtrace I think the better location is the one for the location of |
Just to clarify, when I try to reproduce the error on the example given using:
I get
which is basically the same as #1387 as there is no column 200 in mac.rs except that I don't get a crash. |
This issue should now be fixed in a pull request I will submit shortly. The actual cause of the bogus location was due to the bug I outlined in an earlier comment. The problem was that a hack to fix Issue #1362 was confusing the manner. I fixed the root cause of #1362 and also fixed this bug. The actual fix was a fit involved and involved modifying how fold works, but I didn't see any other sensible way. |
Need a better fix, right now it is just causing even more confusion, for example in issue rust-lang#1448 and rust-lang#1387. This reverts commit 1e4de33.
the replacement and not the span of the pattern variable. Fixes issue rust-lang#1448, and rust-lang#1387.
Fixed by kevina |
If you write something like
#debug["%u", 10]
, the type error (unsigned vs signed int) gets reported incore.rs
, at the definition of#debug
, rather than at the point of use. This is very confusing and makes you think something is fundamentally wrong in the Rust libraries (as in, they don't compile) rather than your own code. I think this ought to be fixed before 0.1 so I associated it with that milestone, but others may disagree.The text was updated successfully, but these errors were encountered: