clippy 0.0.164

A bunch of helpful lints to avoid common pitfalls in Rust

Build #71529 2017-09-26 03:10:28

Build failed. If you want to re-trigger a documentation build, you can do it here. You can find more information on docs.rs builds documentation on the builds page.

# 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.164 Fresh regex-syntax v0.4.1 Fresh unicode-xid v0.0.4 Fresh matches v0.1.6 Fresh bitflags v0.9.1 Fresh dtoa v0.4.2 Fresh quine-mc_cluskey v0.2.4 Fresh itoa v0.3.4 Fresh quote v0.3.15 Fresh synom v0.11.3 Fresh lazy_static v0.2.8 Fresh unicode-normalization v0.1.5 Fresh getopts v0.2.15 Fresh syn v0.11.11 Fresh num-traits v0.1.40 Fresh serde v1.0.15 Fresh semver-parser v0.7.0 Fresh either v1.1.0 Fresh semver v0.6.0 Fresh itertools v0.6.3 Fresh serde_derive_internals v0.16.0 Fresh toml v0.4.5 Fresh serde_json v1.0.3 Fresh pulldown-cmark v0.0.15 Fresh serde_derive v1.0.15 Compiling clippy_lints v0.0.164 Fresh cargo_metadata v0.2.3 Running `rustc --crate-name clippy_lints .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.164/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=71290d2e4e4cb7eb -C extra-filename=-71290d2e4e4cb7eb --out-dir /home/cratesfyi/cratesfyi/debug/deps -L dependency=/home/cratesfyi/cratesfyi/debug/deps --extern serde_derive=/home/cratesfyi/cratesfyi/debug/deps/libserde_derive-931f0dcef843f60e.so --extern-version serde_derive=serde_derive,1.0.15 --extern lazy_static=/home/cratesfyi/cratesfyi/debug/deps/liblazy_static-18005fa1be5dd889.rlib --extern-version lazy_static=lazy_static,0.2.8 --extern unicode_normalization=/home/cratesfyi/cratesfyi/debug/deps/libunicode_normalization-5554c8b28de87bfc.rlib --extern-version unicode_normalization=unicode-normalization,0.1.5 --extern serde=/home/cratesfyi/cratesfyi/debug/deps/libserde-945a6a37fb92248d.rlib --extern-version serde=serde,1.0.15 --extern semver=/home/cratesfyi/cratesfyi/debug/deps/libsemver-70b59fcc83de19e2.rlib --extern-version semver=semver,0.6.0 --extern itertools=/home/cratesfyi/cratesfyi/debug/deps/libitertools-4ddd16ffa9f0e917.rlib --extern-version itertools=itertools,0.6.3 --extern pulldown_cmark=/home/cratesfyi/cratesfyi/debug/deps/libpulldown_cmark-51e76190cc33fac5.rlib --extern-version pulldown_cmark=pulldown-cmark,0.0.15 --extern matches=/home/cratesfyi/cratesfyi/debug/deps/libmatches-e2a43ce3f52b9dcc.rlib --extern-version matches=matches,0.1.6 --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 toml=/home/cratesfyi/cratesfyi/debug/deps/libtoml-43a73e8f4c70aac5.rlib --extern-version toml=toml,0.4.5 --extern regex_syntax=/home/cratesfyi/cratesfyi/debug/deps/libregex_syntax-0240ebb185fe3635.rlib --extern-version regex_syntax=regex-syntax,0.4.1 --cap-lints allow` error[E0308]: mismatched types --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.164/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.164/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.164/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.164/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[E0308]: mismatched types --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/src/ptr.rs:163:32 | 163 | parameters.types.len() == 1, | ^^^^^ error[E0308]: mismatched types --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.164/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.164/src/transmute.rs:198:17 | 198 | !params.parenthesized, | ^^^^^^^^^^^^^ error[E0308]: mismatched types --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/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.164/src/use_self.rs:63:25 | 63 | !params.parenthesized && params.lifetimes.len() == 0 | ^^^^^^^^^^^^^ error: aborting due to 37 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.164/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=71290d2e4e4cb7eb -C extra-filename=-71290d2e4e4cb7eb --out-dir /home/cratesfyi/cratesfyi/debug/deps -L dependency=/home/cratesfyi/cratesfyi/debug/deps --extern serde_derive=/home/cratesfyi/cratesfyi/debug/deps/libserde_derive-931f0dcef843f60e.so --extern-version serde_derive=serde_derive,1.0.15 --extern lazy_static=/home/cratesfyi/cratesfyi/debug/deps/liblazy_static-18005fa1be5dd889.rlib --extern-version lazy_static=lazy_static,0.2.8 --extern unicode_normalization=/home/cratesfyi/cratesfyi/debug/deps/libunicode_normalization-5554c8b28de87bfc.rlib --extern-version unicode_normalization=unicode-normalization,0.1.5 --extern serde=/home/cratesfyi/cratesfyi/debug/deps/libserde-945a6a37fb92248d.rlib --extern-version serde=serde,1.0.15 --extern semver=/home/cratesfyi/cratesfyi/debug/deps/libsemver-70b59fcc83de19e2.rlib --extern-version semver=semver,0.6.0 --extern itertools=/home/cratesfyi/cratesfyi/debug/deps/libitertools-4ddd16ffa9f0e917.rlib --extern-version itertools=itertools,0.6.3 --extern pulldown_cmark=/home/cratesfyi/cratesfyi/debug/deps/libpulldown_cmark-51e76190cc33fac5.rlib --extern-version pulldown_cmark=pulldown-cmark,0.0.15 --extern matches=/home/cratesfyi/cratesfyi/debug/deps/libmatches-e2a43ce3f52b9dcc.rlib --extern-version matches=matches,0.1.6 --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 toml=/home/cratesfyi/cratesfyi/debug/deps/libtoml-43a73e8f4c70aac5.rlib --extern-version toml=toml,0.4.5 --extern regex_syntax=/home/cratesfyi/cratesfyi/debug/deps/libregex_syntax-0240ebb185fe3635.rlib --extern-version regex_syntax=regex-syntax,0.4.1 --cap-lints allow` (exit code: 101) }', src/bin/cratesfyi.rs:142 note: Run with `RUST_BACKTRACE=1` for a backtrace.