Emit missing-fields diagnostics from inference#22336
Open
Twil3akine wants to merge 4 commits into
Open
Conversation
ChayimFriedman2
requested changes
May 10, 2026
| remaining_fields.contains_key(&field.name).then_some(field_idx) | ||
| }) | ||
| .collect::<Vec<_>>(); | ||
| if !missing_fields.is_empty() { |
Contributor
There was a problem hiding this comment.
This if is redundant, we already checked that above.
| expr_store_diagnostics(db, acc, source_map); | ||
|
|
||
| let infer = InferenceResult::of(db, id); | ||
| let mut delayed_missing_fields_diagnostics = Vec::new(); |
Contributor
There was a problem hiding this comment.
Why do you delay this? I see no reason for that.
Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
Collaborator
|
☔ The latest upstream changes (possibly #22252) made this pull request unmergeable. Please resolve the merge conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements one diagnostic FIXME from #22140.
This changes record-literal missing-fields diagnostics to be emitted from inference, while reusing the existing
MissingFieldsdiagnostic.MissingFieldsalready represents record literal/pattern missing field diagnostics and is rendered as rustc hard errorE0063, so adding a separate diagnostic would duplicate behavior.This PR:
MissingFieldsdiagnosticValidated with:
AI assistance disclosure:
I used ChatGPT to help review the implementation plan and draft this PR description. I reviewed the generated suggestions before submitting.