clippy 0.0.165

A bunch of helpful lints to avoid common pitfalls in Rust
Build #72106 2017-09-28T17:53:19.700491+00:00
# rustc version
rustc 1.22.0-dev (b1cfd1750 2017-09-21)# docs.rs version
cratesfyi 0.4.1 (003e49d 2017-06-08)# build log
Updating registry `https://github.com/rust-lang/crates.io-index`
Downloading clippy v0.0.165
Fresh regex-syntax v0.4.1
Fresh unicode-normalization v0.1.5
Fresh quine-mc_cluskey v0.2.4
Fresh lazy_static v0.2.9
Fresh serde v1.0.15
Fresh unicode-xid v0.0.4
Fresh either v1.2.0
Fresh getopts v0.2.15
Fresh bitflags v0.9.1
Fresh dtoa v0.4.2
Fresh matches v0.1.6
Fresh toml v0.4.5
Fresh synom v0.11.3
Fresh itertools v0.6.4
Fresh quote v0.3.15
Fresh itoa v0.3.4
Fresh num-traits v0.1.40
Fresh semver-parser v0.7.0
Fresh pulldown-cmark v0.0.15
Fresh serde_json v1.0.3
Fresh semver v0.6.0
Fresh syn v0.11.11
Fresh serde_derive_internals v0.16.0
Fresh serde_derive v1.0.15
Fresh cargo_metadata v0.2.3
Compiling clippy_lints v0.0.165
Running `rustc --crate-name clippy_lints .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=e44c3e7a6b747795 -C extra-filename=-e44c3e7a6b747795 --out-dir /home/cratesfyi/cratesfyi/debug/deps -L dependency=/home/cratesfyi/cratesfyi/debug/deps --extern itertools=/home/cratesfyi/cratesfyi/debug/deps/libitertools-e9588f794f4d1657.rlib --extern-version itertools=itertools,0.6.4 --extern unicode_normalization=/home/cratesfyi/cratesfyi/debug/deps/libunicode_normalization-5554c8b28de87bfc.rlib --extern-version unicode_normalization=unicode-normalization,0.1.5 --extern quine_mc_cluskey=/home/cratesfyi/cratesfyi/debug/deps/libquine_mc_cluskey-6d8f73fdf7c11d33.rlib --extern-version quine_mc_cluskey=quine-mc_cluskey,0.2.4 --extern regex_syntax=/home/cratesfyi/cratesfyi/debug/deps/libregex_syntax-0240ebb185fe3635.rlib --extern-version regex_syntax=regex-syntax,0.4.1 --extern serde_derive=/home/cratesfyi/cratesfyi/debug/deps/libserde_derive-931f0dcef843f60e.so --extern-version serde_derive=serde_derive,1.0.15 --extern toml=/home/cratesfyi/cratesfyi/debug/deps/libtoml-43a73e8f4c70aac5.rlib --extern-version toml=toml,0.4.5 --extern serde=/home/cratesfyi/cratesfyi/debug/deps/libserde-945a6a37fb92248d.rlib --extern-version serde=serde,1.0.15 --extern matches=/home/cratesfyi/cratesfyi/debug/deps/libmatches-e2a43ce3f52b9dcc.rlib --extern-version matches=matches,0.1.6 --extern semver=/home/cratesfyi/cratesfyi/debug/deps/libsemver-70b59fcc83de19e2.rlib --extern-version semver=semver,0.6.0 --extern lazy_static=/home/cratesfyi/cratesfyi/debug/deps/liblazy_static-5b85fba9276a8257.rlib --extern-version lazy_static=lazy_static,0.2.9 --extern pulldown_cmark=/home/cratesfyi/cratesfyi/debug/deps/libpulldown_cmark-51e76190cc33fac5.rlib --extern-version pulldown_cmark=pulldown-cmark,0.0.15 --cap-lints allow`
error: expected one of `)` or `,`, found `=`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/loops.rs:1607:34
|
1607 |         ty::TyArray(_, n) => (0..=32).contains(const_to_u64(n)),
|                                  ^ expected one of `)` or `,` here

error[E0408]: variable `DotDotEq` is not bound in all patterns
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/utils/sugg.rs:365:9
|
365 |         DotDot | DotDotEq => Associativity::None,
|         ^^^^^^   -------- variable not in all patterns
|         |
|         pattern doesn't bind `DotDotEq`

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/utils/hir_utils.rs:221:15
|
221 |             (&None, &None) => true,
|               ^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/utils/hir_utils.rs:221:22
|
221 |             (&None, &None) => true,
|                      ^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/utils/hir_utils.rs:222:15
|
222 |             (&Some(ref l), &Some(ref r)) => self.eq_path_parameters(l, r),
|               ^^^^^^^^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/utils/hir_utils.rs:222:29
|
222 |             (&Some(ref l), &Some(ref r)) => self.eq_path_parameters(l, r),
|                             ^^^^^^^^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0599]: no associated item named `DotDotEq` found for type `syntax::util::parser::AssocOp` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/utils/sugg.rs:129:74
|
129 |             ast::ExprKind::Range(.., RangeLimits::Closed) => Sugg::BinOp(AssocOp::DotDotEq, snippet),
|                                                                          ^^^^^^^^^^^^^^^^^

error[E0599]: no associated item named `DotDotEq` found for type `syntax::util::parser::AssocOp` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/utils/sugg.rs:168:52
|
168 |             ast::RangeLimits::Closed => make_assoc(AssocOp::DotDotEq, &self, &end),
|                                                    ^^^^^^^^^^^^^^^^^

error[E0599]: no associated item named `DotDotEq` found for type `syntax::util::parser::AssocOp` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/utils/sugg.rs:315:9
|
315 |         AssocOp::DotDotEq => format!("{}..={}", lhs, rhs),
|         ^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:114:24
|
114 |                 if let Some(ref params) = *params {
|                        ^^^^^^^^^^^^^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0609]: no field `lifetimes` on type `&_`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:115:42
|
115 |                     for bound in &params.lifetimes {
|                                          ^^^^^^^^^

error[E0599]: no method named `name` found for type `syntax_pos::symbol::Symbol` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:229:62
|
229 |             allowed_lts.insert(RefLt::Named(lt.lifetime.name.name()));
|                                                              ^^^^

error[E0599]: no method named `name` found for type `syntax_pos::symbol::Symbol` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:239:20
|
239 |         if lt.name.name() != "'static" {
|                    ^^^^

error[E0599]: no method named `name` found for type `syntax_pos::symbol::Symbol` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:240:43
|
240 |             vec.push(RefLt::Named(lt.name.name()));
|                                           ^^^^

error[E0599]: no method named `name` found for type `syntax_pos::symbol::Symbol` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:270:24
|
270 |             if lt.name.name() == "'static" {
|                        ^^^^

error[E0599]: no method named `name` found for type `syntax_pos::symbol::Symbol` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:275:52
|
275 |                 self.lts.push(RefLt::Named(lt.name.name()));
|                                                    ^^^^

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:291:16
|
291 |         if let Some(ref last_path_segment) = last_path_segment(qpath).parameters {
|                ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0609]: no field `parenthesized` on type `&_`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:292:35
|
292 |             if !last_path_segment.parenthesized && last_path_segment.lifetimes.is_empty() {
|                                   ^^^^^^^^^^^^^

error[E0599]: no method named `name` found for type `syntax_pos::symbol::Symbol` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:401:40
|
401 |         self.map.remove(&lifetime.name.name());
|                                        ^^^^

error[E0599]: no method named `name` found for type `syntax_pos::symbol::Symbol` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:420:37
|
420 |         .map(|lt| (lt.lifetime.name.name(), lt.lifetime.span))
|                                     ^^^^

error[E0599]: no method named `name` found for type `syntax_pos::symbol::Symbol` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:439:26
|
439 |         if lifetime.name.name() != keywords::Invalid.name() && lifetime.name.name() != "'static" {
|                          ^^^^

error[E0599]: no method named `name` found for type `syntax_pos::symbol::Symbol` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lifetimes.rs:439:78
|
439 |         if lifetime.name.name() != keywords::Invalid.name() && lifetime.name.name() != "'static" {
|                                                                              ^^^^

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/map_clone.rs:103:33
|
103 |                     parameters: None,
|                                 ^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`
= help: here are some functions which might fulfill your needs:
- .unwrap()
- .unwrap_or_default()

error[E0560]: struct `rustc::hir::PathSegment` has no field named `infer_types`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/map_clone.rs:104:21
|
104 |                     infer_types: true,
|                     ^^^^^^^^^^^^ `rustc::hir::PathSegment` does not have this field
|
= note: available fields are: `name`, `parameters`

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/methods.rs:1621:44
|
1621 |                                     if let Some(ref params) = s.parameters {
|                                            ^^^^^^^^^^^^^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0609]: no field `parenthesized` on type `&_`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/methods.rs:1622:51
|
1622 |                                         if params.parenthesized {
|                                                   ^^^^^^^^^^^^^

error[E0599]: no method named `as_ref` found for type `rustc::hir::PathParameters` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/needless_pass_by_value.rs:147:58
|
147 |                             .and_then(|ps| ps.parameters.as_ref())
|                                                          ^^^^^^

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/ptr.rs:162:55
|
162 |                     let Some(&PathSegment{parameters: Some(ref parameters), ..}) = path.segments.last(),
|                                                       ^^^^^^^^^^^^^^^^^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0609]: no field `types` on type `&_`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/ptr.rs:163:32
|
163 |                     parameters.types.len() == 1,
|                                ^^^^^

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/transmute.rs:197:13
|
197 |         let Some(ref params) = seg.parameters,
|             ^^^^^^^^^^^^^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0609]: no field `parenthesized` on type `&_`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/transmute.rs:198:17
|
198 |         !params.parenthesized,
|                 ^^^^^^^^^^^^^

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/types.rs:157:29
|
157 |                         let Some(ref params) = last.parameters,
|                             ^^^^^^^^^^^^^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0609]: no field `parenthesized` on type `&_`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/types.rs:158:33
|
158 |                         !params.parenthesized,
|                                 ^^^^^^^^^^^^^

error[E0599]: no method named `as_ref` found for type `rustc::hir::PathParameters` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/types.rs:187:56
|
187 |                         .flat_map(|seg| seg.parameters.as_ref()
|                                                        ^^^^^^

error[E0599]: no method named `as_ref` found for type `rustc::hir::PathParameters` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/types.rs:196:52
|
196 |                     .flat_map(|seg| seg.parameters.as_ref()
|                                                    ^^^^^^

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/types.rs:204:28
|
204 |                     if let Some(ref params) = seg.parameters {
|                            ^^^^^^^^^^^^^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0609]: no field `types` on type `&_`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/types.rs:205:42
|
205 |                         for ty in params.types.iter() {
|                                          ^^^^^

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/types.rs:232:21
|
232 |                 let Some(ref params) = bx.parameters,
|                     ^^^^^^^^^^^^^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0609]: no field `parenthesized` on type `&_`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/types.rs:233:25
|
233 |                 !params.parenthesized,
|                         ^^^^^^^^^^^^^

error[E0599]: no method named `name` found for type `syntax_pos::symbol::Symbol` in the current scope
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/types.rs:244:44
|
244 |                     format!("{} ", lt.name.name().as_str())
|                                            ^^^^

error[E0308]: mismatched types
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/use_self.rs:62:39
|
62 |             let should_check = if let Some(ref params) = *parameters {
|                                       ^^^^^^^^^^^^^^^^ expected struct `rustc::hir::PathParameters`, found enum `serde::export::Option`
|
= note: expected type `rustc::hir::PathParameters`
found type `serde::export::Option<_>`

error[E0609]: no field `parenthesized` on type `&_`
--> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/use_self.rs:63:25
|
63 |                 !params.parenthesized && params.lifetimes.len() == 0 
|                         ^^^^^^^^^^^^^

error: aborting due to 42 previous errors

thread 'main' panicked at 'ChainedError {
error: Could not compile `clippy_lints`.,
cause: process didn't exit successfully: `rustc --crate-name clippy_lints .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.165/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=e44c3e7a6b747795 -C extra-filename=-e44c3e7a6b747795 --out-dir /home/cratesfyi/cratesfyi/debug/deps -L dependency=/home/cratesfyi/cratesfyi/debug/deps --extern itertools=/home/cratesfyi/cratesfyi/debug/deps/libitertools-e9588f794f4d1657.rlib --extern-version itertools=itertools,0.6.4 --extern unicode_normalization=/home/cratesfyi/cratesfyi/debug/deps/libunicode_normalization-5554c8b28de87bfc.rlib --extern-version unicode_normalization=unicode-normalization,0.1.5 --extern quine_mc_cluskey=/home/cratesfyi/cratesfyi/debug/deps/libquine_mc_cluskey-6d8f73fdf7c11d33.rlib --extern-version quine_mc_cluskey=quine-mc_cluskey,0.2.4 --extern regex_syntax=/home/cratesfyi/cratesfyi/debug/deps/libregex_syntax-0240ebb185fe3635.rlib --extern-version regex_syntax=regex-syntax,0.4.1 --extern serde_derive=/home/cratesfyi/cratesfyi/debug/deps/libserde_derive-931f0dcef843f60e.so --extern-version serde_derive=serde_derive,1.0.15 --extern toml=/home/cratesfyi/cratesfyi/debug/deps/libtoml-43a73e8f4c70aac5.rlib --extern-version toml=toml,0.4.5 --extern serde=/home/cratesfyi/cratesfyi/debug/deps/libserde-945a6a37fb92248d.rlib --extern-version serde=serde,1.0.15 --extern matches=/home/cratesfyi/cratesfyi/debug/deps/libmatches-e2a43ce3f52b9dcc.rlib --extern-version matches=matches,0.1.6 --extern semver=/home/cratesfyi/cratesfyi/debug/deps/libsemver-70b59fcc83de19e2.rlib --extern-version semver=semver,0.6.0 --extern lazy_static=/home/cratesfyi/cratesfyi/debug/deps/liblazy_static-5b85fba9276a8257.rlib --extern-version lazy_static=lazy_static,0.2.9 --extern pulldown_cmark=/home/cratesfyi/cratesfyi/debug/deps/libpulldown_cmark-51e76190cc33fac5.rlib --extern-version pulldown_cmark=pulldown-cmark,0.0.15 --cap-lints allow` (exit code: 101)
}', src/bin/cratesfyi.rs:142
note: Run with `RUST_BACKTRACE=1` for a backtrace.