-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix multiple labels when some don't have message #39214
Conversation
The diagnostic emitter now accounts for labels with no text message, presenting the underline on its own, without drawing the line for the non existing message below it. Go from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ----^^^^^^^---- | | | | | `b` is a good letter | ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ----^^^^^^^---- | | | `b` is a good letter ``` and from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ | | | | | | `a` is a good letter ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ `a` is a good letter ```
For an example of what this bug actually looks like in practice (taken from #39202): The presentation logic should still allow for labels without messages with a reasonable output. Given that, the proper thing to do is to not have labels without a message, specially when multiple labels might overlap. Cases that would now be shown in this way
might actually be masking
Thankfully, this is a very contrived example. |
This is really great! 👍 |
@bors r+ |
📌 Commit 469ecef has been approved by |
Fix multiple labels when some don't have message The diagnostic emitter now accounts for labels with no text message, presenting the underline on its own, without drawing the line for the non existing message below it. Go from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ----^^^^^^^---- | | | | | `b` is a good letter | ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ----^^^^^^^---- | | | `b` is a good letter ``` from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ | | | | | | `a` is a good letter ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ `a` is a good letter ``` and from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ | | | | | | ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ ``` r? @nikomatsakis cc @jonathandturner, @GuillaumeGomez, @nrc
💔 Test failed - status-travis |
… On Mon, Jan 23, 2017 at 2:37 PM, bors ***@***.***> wrote:
💔 Test failed - status-travis
<https://travis-ci.org/rust-lang/rust/builds/194605255>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#39214 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95OUGf7JOXRDKnQButLmk4H0L4YAAks5rVSu8gaJpZM4Lp9-e>
.
|
⌛ Testing commit 469ecef with merge 067221f... |
💔 Test failed - status-travis |
@bors: retry
* apparent travis bug...
…On Mon, Jan 23, 2017 at 7:42 PM, bors ***@***.***> wrote:
💔 Test failed - status-travis
<https://travis-ci.org/rust-lang/rust/builds/194701054>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#39214 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAD95FHElkRuR4Xoq_5LfdWh09vWLJHPks5rVXMtgaJpZM4Lp9-e>
.
|
⌛ Testing commit 469ecef with merge d2d8ae6... |
Fix multiple labels when some don't have message The diagnostic emitter now accounts for labels with no text message, presenting the underline on its own, without drawing the line for the non existing message below it. Go from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ----^^^^^^^---- | | | | | `b` is a good letter | ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ----^^^^^^^---- | | | `b` is a good letter ``` from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ | | | | | | `a` is a good letter ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ `a` is a good letter ``` and from ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ | | | | | | ``` to ``` error: foo --> test.rs:3:6 | 3 | a { b { c } d } | ^^^^-------^^^^ ``` r? @nikomatsakis cc @jonathandturner, @GuillaumeGomez, @nrc
☀️ Test successful - status-appveyor, status-travis |
The diagnostic emitter now accounts for labels with no text message, presenting the underline on its own, without drawing the line for the non existing message below it. Go from
to
from
to
and from
to
r? @nikomatsakis
cc @jonathandturner, @GuillaumeGomez, @nrc