Skip to content

Improve diagnostic for when field is never read#83004

Closed
sunjay wants to merge 7 commits intorust-lang:masterfrom
sunjay:field-never-read-issue-81658
Closed

Improve diagnostic for when field is never read#83004
sunjay wants to merge 7 commits intorust-lang:masterfrom
sunjay:field-never-read-issue-81658

Conversation

@sunjay
Copy link
Contributor

@sunjay sunjay commented Mar 11, 2021

Related to (but does not close) #81658

This completes the first step of @pnkfelix's mentoring instructions but does not actually improve the diagnostics (yet!). The two tests are heavily reduced versions of code from the original bug report.

I've confirmed that the reduced field-used-in-ffi test fails on nightly but passes on stable. This confirms that the regression is reproduced correctly. The drop-only-field test is a case that @pnkfelix mentioned in his mentoring instructions. It is not a regression, but will come in handy when we make the diagnostic smarter by looking at whether the field type implements Drop.

Per the rustc-dev-guide, each test includes a comment summarizing what it is about.

Loading
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 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.