Skip to content

used_underscore_binding trigged on #[derive(Serialize)] using serde #852

Closed
@compressed

Description

@compressed

Similar to https://github.com/Manishearth/rust-clippy/issues/536, I'm getting this clippy warning on the expansion of Serialize.

Cargo.toml

[dependencies]
clippy = "0.0.63"
serde = "0.7.0"
serde_macros = "0.7.2"

lib.rs

#![feature(custom_derive, plugin)]
#![plugin(serde_macros, clippy)]

extern crate serde;

#[derive(Serialize)]
pub struct A {
    a: String,
}

Returns:

src/lib.rs:7:10: 7:19 warning: used binding which is prefixed with an underscore. A leading underscore signals that a binding will not be used., #[warn(used_underscore_binding)] on by default
src/lib.rs:7 #[derive(Serialize)]
                      ^~~~~~~~~
src/lib.rs:7:10: 7:19 note: in this expansion of try! (defined in <std macros>)
src/lib.rs:7:10: 7:19 help: for further information visit https://github.com/Manishearth/rust-clippy/wiki#used_underscore_binding

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingT-middleType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions