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

improve "try ignoring the field" diagnostic #100031

Merged
merged 2 commits into from
Aug 15, 2022

Conversation

GoldsteinE
Copy link
Contributor

Closes #95795

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 1, 2022
@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 1, 2022
@GoldsteinE
Copy link
Contributor Author

GoldsteinE commented Aug 1, 2022

This probably could be MachineApplicable, but I don’t see a clean way to get a span that includes the comma there.

@GoldsteinE
Copy link
Contributor Author

It’s also not clear whether this should work for tuples. Consider:

let (x, unused1, unused2, ..) = tuple;

There’re three suggestion options here:

  1. Suggest to ignore both fields (current)
  2. Suggest to ignore first field and to remove the second (kinda weird I guess?)
  3. Suggest to remove both fields (clean, but then the first suggestion is wrong in isolation)

@GoldsteinE GoldsteinE force-pushed the try-removing-the-field branch from 3ef9e4b to 6810458 Compare August 1, 2022 18:54
Copy link
Member

@michaelwoerister michaelwoerister left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @GoldsteinE!

I left some comments below.

compiler/rustc_passes/src/liveness.rs Outdated Show resolved Hide resolved
@GoldsteinE
Copy link
Contributor Author

@michaelwoerister Thanks for the review! I implemented your suggestions

@rust-log-analyzer

This comment has been minimized.

@GoldsteinE GoldsteinE force-pushed the try-removing-the-field branch from 3609afe to 3fb249b Compare August 12, 2022 09:33
@michaelwoerister
Copy link
Member

Thanks, @GoldsteinE!

@bors r+

@bors
Copy link
Contributor

bors commented Aug 15, 2022

📌 Commit 3e0df4b has been approved by michaelwoerister

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 Aug 15, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 15, 2022
… r=michaelwoerister

improve "try ignoring the field" diagnostic

Closes rust-lang#95795
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 15, 2022
…iaskrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#100031 (improve "try ignoring the field" diagnostic)
 - rust-lang#100325 (Rustdoc-Json: Don't remove impls for items imported from private modules)
 - rust-lang#100377 (Replace - with _ in fluent slugs to improve developer workflows)
 - rust-lang#100458 (Adjust span of fn argument declaration)
 - rust-lang#100514 (Delay span bug when failing to normalize negative coherence impl subject due to other malformed impls)
 - rust-lang#100528 (Support 1st group of RISC-V Bitmanip backend target features)
 - rust-lang#100559 (Parser simplifications)
 - rust-lang#100568 (Fix STD build for ESP-IDF)
 - rust-lang#100582 ([rustdoc] Fix handling of stripped enum variant in JSON output format)
 - rust-lang#100586 (Reland changes replacing num_cpus with available_parallelism )

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 710bd23 into rust-lang:master Aug 15, 2022
@rustbot rustbot added this to the 1.65.0 milestone Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Chance to improve "try ignoring the field" message
6 participants