-
Notifications
You must be signed in to change notification settings - Fork 13.3k
E0407 needs to be updated to new format #35697
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
Comments
@jonathandturner give me a hint how to implement bonus part, please.
ImplItem does not contain useful info. impl_item.span corresponds to whole function. The only stupid idea, that I tried - hardcode, like this:
Hardcoded shift for lower bound is more or less acceptable, because usually function starts from "fn ", upper bound is stupid 100%. |
Right now without bonus. But I work on it! |
I took a look at the bonus last night. I had a few ideas, but for what time I spent with it, it seemed like it wasn't going to be one of the easier bonuses :) In general, it's much better to thread the Span information you need through or to look it up with a span_if_local. We're trying to avoid actually changing the spans (though there are a couple of rare exceptions). Pinging @KiChjang who is also working on some of the bonuses and might have some ideas. |
My ideas are all bad in this case, because there is no span information stored by the parser :(. Both |
@KiChjang - possibly, though I'd like to underline other names as well, like in the case of an unused function we could underline the name instead of the whole function. @eddyb - any thought on adding spans? I know @nikomatsakis mentioned you were thinking about possibly adding some spans in the future. |
…omez New output for E0407 Issue rust-lang#35697 as a part of rust-lang#35233. r? @GuillaumeGomez
@KiChjang So shell I wait for changes in parser API? |
You can add span information for the Ident struct yourself. Look in parser.rs. |
Closing this issue, but feel free to open one about the bonus. |
From: src/test/compile-fail/E0407.rs
E0407 needs a span_label, updating it from:
To:
Bonus: tighten the span to focus on
b
:The text was updated successfully, but these errors were encountered: