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

Re-enable clippy rule field_reassign_with_default #685

Closed
webmaster128 opened this issue Jan 5, 2021 · 5 comments · Fixed by #851
Closed

Re-enable clippy rule field_reassign_with_default #685

webmaster128 opened this issue Jan 5, 2021 · 5 comments · Fixed by #851
Milestone

Comments

@webmaster128
Copy link
Member

field_reassign_with_default was enabled with Rust 1.49.0 and does not play well with auto-generated code from schemars. See

In order to allow developing with Rust 1.49.0, we added a few #![allow(clippy::field_reassign_with_default)]. Those should be removed when there is a schemars patch.

For contract developers it is recommended to use Rust stable 1.47.0 or 1.48.0 in order to avoid running into this problem again and again across different repos.

@webmaster128
Copy link
Member Author

The fix in clippy landed after Jan 3rd when 1.50.0 was tagged. So it will be shipped in 1.51.0.

I wonder to what degree this is a pain for contract developers because both Rust 1.49.0 and 1.50.0 are affected by the problem now and 1.50.0 is the min version for CosmWasm 0.14 development.

@webmaster128 webmaster128 added this to the 0.14.0 milestone Mar 9, 2021
@webmaster128
Copy link
Member Author

webmaster128 commented Mar 9, 2021

Can reproduce the problem with Rust 1.50.0 in this repo as well as cosmwasm-examples. Current Rust beta (1.51.0) fixes it.

We should make Rust 1.51.0 the min supported version for CosmWasm 0.14 to ensure contract developers do not run into this problem.

@maurolacy
Copy link
Contributor

I don't think it's so impactful: It's a linter warning, it's clearly a bug, and it's easy to silence.

I agree we should move to Rust 1.51.0 asap, though.

@webmaster128
Copy link
Member Author

I don't think it's so impactful: It's a linter warning, it's clearly a bug, and it's easy to silence.

Yeah, but it is a serious support issue. The error message from the linter is not that helpful and we can't assume contract developers understand the source issue and identify it as a linter bug.

@webmaster128
Copy link
Member Author

This can be resolved by using schemars 0.8.1: https://github.com/GREsau/schemars/releases/tag/v0.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants