Uh oh!
There was an error while loading. Please reload this page.
Reduce span to function name in unreachable calls - #64229
Conversation
rust-highfive
commented
Sep 6, 2019
(rust_highfive has picked a reviewer for you, use r? to override) |
petrochenkov
commented
Sep 6, 2019
r? @estebank for reassigning, can't spend time on digging into this right now |
petrochenkov
commented
Sep 6, 2019
(The PR as is doesn't seem to address the issue?) |
estebank
commented
Sep 6, 2019
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. |
ayuusweetfish
commented
Sep 7, 2019
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 |
ayuusweetfish
commented
Sep 7, 2019
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 |
Centril
commented
Sep 7, 2019
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. |
estebank
commented
Sep 7, 2019
@Centril I can see it being as "cheap" as adding a single |
estebank
commented
Sep 7, 2019
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+ |
bors
commented
Sep 7, 2019
📌 Commit e1d27eb has been approved by |
…=estebank Reduce span to function name in unreachable calls As title suggests, this might closerust-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.