Skip to content
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

Highlight whole expression for E0599 #108609

Merged
merged 1 commit into from
Mar 2, 2023
Merged

Conversation

clubby789
Copy link
Contributor

@clubby789 clubby789 commented Mar 1, 2023

Fixes #108603

This adds a secondary label to highlight the whole expression leading to the error. It also prevents empty labels being recognised as 'unexpected' by compiletest - otherwise, tests with NOTE annotations would pick up empty labels.

@rustbot label +A-diagnostics

@rustbot
Copy link
Collaborator

rustbot commented Mar 1, 2023

r? @WaffleLapkin

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-diagnostics Area: Messages for errors, warnings, and lints labels Mar 1, 2023
Copy link
Member

@WaffleLapkin WaffleLapkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we somehow only include this highlighting in multiline cases? I feel like most of the cases in tests are not improvements...

@estebank
Copy link
Contributor

estebank commented Mar 1, 2023

Yeah, I agree with @WaffleLapkin on this. There's an is_multiline(Span) method that you can use for it.

@clubby789
Copy link
Contributor Author

That looks nicer. I left the compiletest changes because it seems reasonable to ignore textless notes, but I can revert that too

@estebank
Copy link
Contributor

estebank commented Mar 1, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Mar 1, 2023

📌 Commit 6c2a952 has been approved by estebank

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 1, 2023
Copy link

@punkeel punkeel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 2, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#108516 (Restrict `#[rustc_box]` to `Box::new` calls)
 - rust-lang#108575 (Erase **all** regions when probing for associated types on ambiguity in astconv)
 - rust-lang#108585 (Run compiler test suite in parallel on Fuchsia)
 - rust-lang#108606 (Add test case for mismatched open/close delims)
 - rust-lang#108609 (Highlight whole expression for E0599)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 832987b into rust-lang:master Mar 2, 2023
@rustbot rustbot added this to the 1.69.0 milestone Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

E0599 doesn't show enough context for misformatted code
6 participants