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

serde generated code triggers new clippy::type_repetition_in_bounds warning #1595

Closed
imp opened this issue Aug 2, 2019 · 1 comment
Closed

Comments

@imp
Copy link

imp commented Aug 2, 2019

Clippy has recently introduced new lint type_repetition_in_bounds and apparently serde-generated code (#[derive(Serialize, Deserialize)]) triggers this lint in some cases.

   Checking playground v0.0.1 (/playground)
warning: this type has already been used as a bound predicate
 --> src/main.rs:8:17
  |
8 | #[derive(Debug, Serialize, Deserialize)]
  |                 ^^^^^^^^^
  |
note: lint level defined here
 --> src/main.rs:1:9
  |
1 | #![warn(clippy::type_repetition_in_bounds)]
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  = help: consider combining the bounds: `S: Foo + _serde::Serialize`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

warning: this type has already been used as a bound predicate
 --> src/main.rs:8:28
  |
8 | #[derive(Debug, Serialize, Deserialize)]
  |                            ^^^^^^^^^^^
  |
  = help: consider combining the bounds: `S: Foo + _serde::Deserialize`
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_repetition_in_bounds

    Finished dev [unoptimized + debuginfo] target(s) in 0.61s

Code example

@imp imp changed the title serve generated code triggers new clippy warning serde generated code triggers new clippy warning Aug 2, 2019
@imp imp changed the title serde generated code triggers new clippy warning serde generated code triggers new clippy::type_repetition_in_bounds warning Aug 2, 2019
@dtolnay
Copy link
Member

dtolnay commented Aug 2, 2019

Thanks, I reported this as a Clippy false positive in rust-lang/rust-clippy#4326.

@dtolnay dtolnay closed this as completed Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants