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

Conversation

@RalfJung
Copy link
Member

commented Aug 12, 2019

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 erlepereira/x11-rs#99 (comment) for how this helps in some real-world code hitting this lint.

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented Aug 12, 2019

r? @petrochenkov

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

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
src/librustc_lint/builtin.rs Outdated Show resolved Hide resolved
@Centril

This comment has been minimized.

Copy link
Member

commented Aug 12, 2019

r? @Centril

r=me when-green + squashed :)

@RalfJung RalfJung force-pushed the RalfJung:invalid-value branch from b34d0c7 to 0499923 Aug 12, 2019

@RalfJung

This comment has been minimized.

Copy link
Member Author

commented Aug 12, 2019

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

@bors r=Centril

@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2019

📌 Commit 0499923 has been approved by Centril

@RalfJung

This comment has been minimized.

Copy link
Member Author

commented Aug 12, 2019

@bors p=1

Improving a new lint for the beta.

@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2019

⌛️ Testing commit 0499923 with merge 60960a2...

bors added a commit that referenced this pull request Aug 12, 2019
Auto merge of #63483 - RalfJung:invalid-value, r=Centril
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 erlepereira/x11-rs#99 (comment) for how this helps in some real-world code hitting this lint.
@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2019

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

@bors bors added the merged-by-bors label Aug 12, 2019

@bors bors merged commit 0499923 into rust-lang:master Aug 12, 2019

2 of 5 checks passed

pr
Details
pr (Linux mingw-check)
Details
pr (Linux x86_64-gnu-llvm-6.0)
Details
homu Test successful
Details
pr (LinuxTools) LinuxTools succeeded
Details

@RalfJung RalfJung deleted the RalfJung:invalid-value branch Aug 13, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.