-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Reduce span to function name in unreachable calls #64229
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
r? @estebank for reassigning, can't spend time on digging into this right now |
(The PR as is doesn't seem to address the issue?) |
The reduced span to the call itself makes it slightly easier to follow what is going on, but as you point out the only thing that will actually make this clear is to actually point at the diverging expression ( Beyond that r=me on this PR once it's green. |
Thanks for the prompt reply! I'd love to dig into this! For now, I think a viable solution is to store the span of the diverging |
I'd like to not complicate |
Would you mind explaining the reason? And will it be useful if the diverging expression is pointed out for every unreachable code warning? The only downside I can think of is becoming too verbose, but there is always |
Mainly internal compiler complexity reasons, but if it turns out it does not substantially add to the complexity of understanding how Diverges works then go for it. |
@Centril I can see it being as "cheap" as adding a single |
Lets do this, lets merge this PR and @kawa-yoiko can work on the enhancement in a follow up that @Centril and I can review and have a longer convo if needed there. This as is is already a clear, if smaller, improvement. @bors r+ |
📌 Commit e1d27eb has been approved by |
…=estebank Reduce span to function name in unreachable calls As title suggests, this might close rust-lang#64103. Refer to the updated tests for expected output. There is potential to further improve usability. In particular, is it favourable that the exact diverging expression/statement be pointed out (not only in this case, but for all unreachable code)? Certainly that would deserve another issue, but I'm interested in the opinions.
Rollup of 5 pull requests Successful merges: - #64052 (Rename test locals to work around LLDB bug) - #64066 (Support "soft" feature-gating using a lint) - #64177 (resolve: Do not afraid to set current module to enums and traits) - #64229 (Reduce span to function name in unreachable calls) - #64255 (Add methods for converting `bool` to `Option<T>`) Failed merges: r? @ghost
As title suggests, this might close #64103. Refer to the updated tests for expected output.
There is potential to further improve usability. In particular, is it favourable that the exact diverging expression/statement be pointed out (not only in this case, but for all unreachable code)? Certainly that would deserve another issue, but I'm interested in the opinions.