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 invalid_value lint message #63483

Merged
merged 1 commit into from
Aug 12, 2019
Merged

Conversation

RalfJung
Copy link
Member

The lint now explains which type is involved and why it cannot be initialized this way. It also points at the innermost struct/enum field that has an offending type, if any.

See AltF02/x11-rs#99 (comment) for how this helps in some real-world code hitting this lint.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(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 12, 2019
src/librustc_lint/builtin.rs Outdated Show resolved Hide resolved
src/librustc_lint/builtin.rs Outdated Show resolved Hide resolved
src/librustc_lint/builtin.rs Outdated Show resolved Hide resolved
@Centril
Copy link
Contributor

Centril commented Aug 12, 2019

r? @Centril

r=me when-green + squashed :)

@RalfJung
Copy link
Member Author

The corresponding pipeline is long done but GH doesn't show it as green... strange.

@bors r=Centril

@bors
Copy link
Contributor

bors commented Aug 12, 2019

📌 Commit 0499923 has been approved by Centril

@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 12, 2019
@RalfJung
Copy link
Member Author

@bors p=1

Improving a new lint for the beta.

@bors
Copy link
Contributor

bors commented Aug 12, 2019

⌛ Testing commit 0499923 with merge 60960a2...

bors added a commit that referenced this pull request Aug 12, 2019
Improve invalid_value lint message

The lint now explains which type is involved and why it cannot be initialized this way. It also points at the innermost struct/enum field that has an offending type, if any.

See AltF02/x11-rs#99 (comment) for how this helps in some real-world code hitting this lint.
@bors
Copy link
Contributor

bors commented Aug 12, 2019

☀️ Test successful - checks-azure
Approved by: Centril
Pushing 60960a2 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Aug 12, 2019
@bors bors merged commit 0499923 into rust-lang:master Aug 12, 2019
@RalfJung RalfJung deleted the invalid-value branch August 13, 2019 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants