clippy_lints 0.0.149

A bunch of helpful lints to avoid common pitfalls in Rust

Build #67015 2017-08-06 21:11:43

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.20.0-dev (64484707f 2017-07-10)

# 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_lints v0.0.149 Fresh unicode-normalization v0.1.5 Fresh quine-mc_cluskey v0.2.4 Fresh unicode-xid v0.0.4 Fresh bitflags v0.9.1 Fresh matches v0.1.6 Fresh lazy_static v0.2.8 Fresh either v1.1.0 Fresh semver-parser v0.7.0 Fresh serde v1.0.11 Fresh synom v0.11.3 Fresh regex-syntax v0.4.1 Fresh quote v0.3.15 Fresh getopts v0.2.14 Fresh itertools v0.6.1 Fresh semver v0.6.0 Fresh toml v0.4.4 Fresh syn v0.11.11 Fresh pulldown-cmark v0.0.15 Compiling serde_derive_internals v0.15.1 Running `rustc --crate-name serde_derive_internals .cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive_internals-0.15.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=c02f12ad40a271f5 -C extra-filename=-c02f12ad40a271f5 --out-dir /home/cratesfyi/cratesfyi/debug/deps -L dependency=/home/cratesfyi/cratesfyi/debug/deps --extern synom=/home/cratesfyi/cratesfyi/debug/deps/libsynom-538247bd997586d9.rlib --extern-version synom=synom,0.11.3 --extern syn=/home/cratesfyi/cratesfyi/debug/deps/libsyn-b177bd5a479c7be8.rlib --extern-version syn=syn,0.11.11 --cap-lints allow` Compiling serde_derive v1.0.11 Running `rustc --crate-name serde_derive .cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.11/src/lib.rs --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C debuginfo=2 -C metadata=27ac43668445212f -C extra-filename=-27ac43668445212f --out-dir /home/cratesfyi/cratesfyi/debug/deps -L dependency=/home/cratesfyi/cratesfyi/debug/deps --extern quote=/home/cratesfyi/cratesfyi/debug/deps/libquote-983cfcbeae6039c8.rlib --extern-version quote=quote,0.3.15 --extern syn=/home/cratesfyi/cratesfyi/debug/deps/libsyn-b177bd5a479c7be8.rlib --extern-version syn=syn,0.11.11 --extern serde_derive_internals=/home/cratesfyi/cratesfyi/debug/deps/libserde_derive_internals-c02f12ad40a271f5.rlib --extern-version serde_derive_internals=serde_derive_internals,0.15.1 --cap-lints allow` Documenting clippy_lints v0.0.149 Running `rustdoc --crate-name clippy_lints .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/lib.rs -o /home/cratesfyi/cratesfyi/doc -L dependency=/home/cratesfyi/cratesfyi/debug/deps --extern serde=/home/cratesfyi/cratesfyi/debug/deps/libserde-c7201ac4f95f293e.rlib --extern-version serde=serde,1.0.11 --extern itertools=/home/cratesfyi/cratesfyi/debug/deps/libitertools-86e98dc5b478f997.rlib --extern-version itertools=itertools,0.6.1 --extern toml=/home/cratesfyi/cratesfyi/debug/deps/libtoml-a7d305db388eaaf6.rlib --extern-version toml=toml,0.4.4 --extern unicode_normalization=/home/cratesfyi/cratesfyi/debug/deps/libunicode_normalization-5554c8b28de87bfc.rlib --extern-version unicode_normalization=unicode-normalization,0.1.5 --extern semver=/home/cratesfyi/cratesfyi/debug/deps/libsemver-70b59fcc83de19e2.rlib --extern-version semver=semver,0.6.0 --extern serde_derive=/home/cratesfyi/cratesfyi/debug/deps/libserde_derive-27ac43668445212f.so --extern-version serde_derive=serde_derive,1.0.11 --extern matches=/home/cratesfyi/cratesfyi/debug/deps/libmatches-e2a43ce3f52b9dcc.rlib --extern-version matches=matches,0.1.6 --extern regex_syntax=/home/cratesfyi/cratesfyi/debug/deps/libregex_syntax-0240ebb185fe3635.rlib --extern-version regex_syntax=regex-syntax,0.4.1 --extern pulldown_cmark=/home/cratesfyi/cratesfyi/debug/deps/libpulldown_cmark-51e76190cc33fac5.rlib --extern-version pulldown_cmark=pulldown-cmark,0.0.15 --extern lazy_static=/home/cratesfyi/cratesfyi/debug/deps/liblazy_static-18005fa1be5dd889.rlib --extern-version lazy_static=lazy_static,0.2.8 --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` error[E0432]: unresolved import `rustc::hir::BindingAnnotation` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/let_if_seq.rs:3:5 | 3 | use rustc::hir::BindingAnnotation; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `BindingAnnotation` in `hir` error[E0432]: unresolved import `rustc::hir::BindingAnnotation` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/needless_borrow.rs:6:64 | 6 | use rustc::hir::{ExprAddrOf, Expr, MutImmutable, Pat, PatKind, BindingAnnotation}; | ^^^^^^^^^^^^^^^^^ no `BindingAnnotation` in `hir` error[E0432]: unresolved import `rustc::hir::BindingAnnotation` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/needless_borrowed_ref.rs:6:46 | 6 | use rustc::hir::{MutImmutable, Pat, PatKind, BindingAnnotation}; | ^^^^^^^^^^^^^^^^^ no `BindingAnnotation` in `hir` error[E0433]: failed to resolve. Use of undeclared type or module `BindingAnnotation` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/matches.rs:246:26 | 246 | PatKind::Binding(BindingAnnotation::Unannotated, _, ident, None) => ident.node.to_string(), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `BindingAnnotation` error[E0433]: failed to resolve. Use of undeclared type or module `BindingAnnotation` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:229:34 | 229 | PatKind::Binding(BindingAnnotation::Ref, _, _, _) | | ^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `BindingAnnotation` error[E0433]: failed to resolve. Use of undeclared type or module `BindingAnnotation` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:230:34 | 230 | PatKind::Binding(BindingAnnotation::RefMut, _, _, _) => { | ^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `BindingAnnotation` error[E0433]: failed to resolve. Use of undeclared type or module `BindingAnnotation` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:249:22 | 249 | if an == BindingAnnotation::Ref || an == BindingAnnotation::RefMut { | ^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `BindingAnnotation` error[E0433]: failed to resolve. Use of undeclared type or module `BindingAnnotation` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:249:54 | 249 | if an == BindingAnnotation::Ref || an == BindingAnnotation::RefMut { | ^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `BindingAnnotation` error[E0433]: failed to resolve. Use of undeclared type or module `BindingAnnotation` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:251:49 | 251 | let (mutopt,initref) = if an == BindingAnnotation::RefMut { | ^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `BindingAnnotation` error[E0574]: expected struct, variant or union type, found enum `ConstFloat` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:408:28 | 408 | let zero = ConstFloat { | ^^^^^^^^^^ not a struct, variant or union type error[E0574]: expected struct, variant or union type, found enum `ConstFloat` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:413:32 | 413 | let infinity = ConstFloat { | ^^^^^^^^^^ not a struct, variant or union type error[E0574]: expected struct, variant or union type, found enum `ConstFloat` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:418:36 | 418 | let neg_infinity = ConstFloat { | ^^^^^^^^^^ not a struct, variant or union type error[E0574]: expected struct, variant or union type, found enum `ConstFloat` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:427:28 | 427 | let zero = ConstFloat { | ^^^^^^^^^^ not a struct, variant or union type error[E0574]: expected struct, variant or union type, found enum `ConstFloat` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:432:32 | 432 | let infinity = ConstFloat { | ^^^^^^^^^^ not a struct, variant or union type error[E0574]: expected struct, variant or union type, found enum `ConstFloat` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:437:36 | 437 | let neg_infinity = ConstFloat { | ^^^^^^^^^^ not a struct, variant or union type error[E0433]: failed to resolve. Use of undeclared type or module `BindingAnnotation` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/needless_pass_by_value.rs:126:28 | 126 | if mode == BindingAnnotation::Mutable || mode == BindingAnnotation::RefMut { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `BindingAnnotation` error[E0433]: failed to resolve. Use of undeclared type or module `BindingAnnotation` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/needless_pass_by_value.rs:126:66 | 126 | if mode == BindingAnnotation::Mutable || mode == BindingAnnotation::RefMut { | ^^^^^^^^^^^^^^^^^^^^^^^^^ Use of undeclared type or module `BindingAnnotation` error[E0277]: the trait bound `rustc::hir::def_id::DefId: rustc::ty::TypeFoldable<'_>` is not satisfied --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/consts.rs:297:48 | 297 | let param_env = self.param_env.and((def_id, substs)); | ^^^ the trait `rustc::ty::TypeFoldable<'_>` is not implemented for `rustc::hir::def_id::DefId` | = note: required because of the requirements on the impl of `rustc::ty::TypeFoldable<'_>` for `(rustc::hir::def_id::DefId, &rustc::ty::Slice<rustc::ty::subst::Kind<'_>>)` error[E0061]: this function takes 3 parameters but 2 parameters were supplied --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/consts.rs:298:68 | 298 | if let Some((def_id, substs)) = lookup_const_by_id(self.tcx, param_env) { | ^^^^^^^^^^^^^^^^^^^ expected 3 parameters error[E0560]: struct `rustc_errors::CodeSuggestion` has no field named `show_code_when_inline` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/utils/mod.rs:588:9 | 588 | show_code_when_inline: true, | ^^^^^^^^^^^^^^^^^^^^^^ `rustc_errors::CodeSuggestion` does not have this field error[E0599]: no function or associated item named `new` found for type `rustc_const_eval::ConstContext<'_, '_>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/array_indexing.rs:69:31 | 69 | let constcx = ConstContext::new(cx.tcx, cx.param_env.and(substs), cx.tables); | ^^^^^^^^^^^^^^^^^ error[E0061]: this function takes 3 parameters but 2 parameters were supplied --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/bit_mask.rs:290:36 | 290 | lookup_const_by_id(cx.tcx, cx.param_env.and((def_id, Substs::empty()))).and_then(|(l, _ty)| { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 3 parameters error[E0277]: the trait bound `rustc::hir::def_id::DefId: rustc::ty::TypeFoldable<'_>` is not satisfied --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/bit_mask.rs:290:57 | 290 | lookup_const_by_id(cx.tcx, cx.param_env.and((def_id, Substs::empty()))).and_then(|(l, _ty)| { | ^^^ the trait `rustc::ty::TypeFoldable<'_>` is not implemented for `rustc::hir::def_id::DefId` | = note: required because of the requirements on the impl of `rustc::ty::TypeFoldable<'_>` for `(rustc::hir::def_id::DefId, &rustc::ty::Slice<rustc::ty::subst::Kind<'_>>)` error[E0277]: the trait bound `rustc::hir::def_id::DefId: rustc::ty::TypeFoldable<'_>` is not satisfied --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/enum_clike.rs:53:79 | 53 | let bad = match cx.tcx.at(expr.span).const_eval(param_env.and((did, substs))) { | ^^^ the trait `rustc::ty::TypeFoldable<'_>` is not implemented for `rustc::hir::def_id::DefId` | = note: required because of the requirements on the impl of `rustc::ty::TypeFoldable<'_>` for `(rustc::hir::def_id::DefId, &rustc::ty::Slice<rustc::ty::subst::Kind<'_>>)` error[E0308]: mismatched types --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/enum_clike.rs:53:69 | 53 | let bad = match cx.tcx.at(expr.span).const_eval(param_env.and((did, substs))) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected tuple, found struct `rustc::ty::ParamEnvAnd` | = note: expected type `(rustc::hir::def_id::DefId, &rustc::ty::Slice<rustc::ty::subst::Kind<'_>>)` found type `rustc::ty::ParamEnvAnd<'_, (rustc::hir::def_id::DefId, &rustc::ty::Slice<rustc::ty::subst::Kind<'_>>)>` error[E0599]: no function or associated item named `new` found for type `rustc_const_eval::ConstContext<'_, '_>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/loops.rs:678:23 | 678 | let constcx = ConstContext::new(cx.tcx, cx.param_env.and(substs), cx.tables); | ^^^^^^^^^^^^^^^^^ error[E0599]: no function or associated item named `new` found for type `rustc_const_eval::ConstContext<'_, '_>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/matches.rs:399:19 | 399 | let constcx = ConstContext::new(cx.tcx, cx.param_env.and(substs), cx.tables); | ^^^^^^^^^^^^^^^^^ error[E0599]: no function or associated item named `new` found for type `rustc_const_eval::ConstContext<'_, '_>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/methods.rs:1233:35 | 1233 | if let Ok(ConstVal::Str(r)) = ConstContext::new(cx.tcx, cx.param_env.and(substs), cx.tables).eval(arg) { | ^^^^^^^^^^^^^^^^^ error[E0599]: no function or associated item named `new` found for type `rustc_const_eval::ConstContext<'_, '_>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:403:15 | 403 | let res = ConstContext::new(cx.tcx, cx.param_env.and(substs), cx.tables).eval(expr); | ^^^^^^^^^^^^^^^^^ error[E0609]: no field `ty` on type `rustc_const_math::ConstFloat` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:406:19 | 406 | match val.ty { | ^^ error: use of unstable library feature 'float_bits_conv': recently added (see issue #40470) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:410:35 | 410 | bits: 0.0_f32.to_bits() as u128, | ^^^^^^^ | = help: add #![feature(float_bits_conv)] to the crate attributes to enable error: use of unstable library feature 'float_bits_conv': recently added (see issue #40470) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:415:48 | 415 | bits: ::std::f32::INFINITY.to_bits() as u128, | ^^^^^^^ | = help: add #![feature(float_bits_conv)] to the crate attributes to enable error: use of unstable library feature 'float_bits_conv': recently added (see issue #40470) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:420:52 | 420 | bits: ::std::f32::NEG_INFINITY.to_bits() as u128, | ^^^^^^^ | = help: add #![feature(float_bits_conv)] to the crate attributes to enable error: use of unstable library feature 'float_bits_conv': recently added (see issue #40470) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:429:35 | 429 | bits: 0.0_f64.to_bits() as u128, | ^^^^^^^ | = help: add #![feature(float_bits_conv)] to the crate attributes to enable error: use of unstable library feature 'float_bits_conv': recently added (see issue #40470) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:434:48 | 434 | bits: ::std::f64::INFINITY.to_bits() as u128, | ^^^^^^^ | = help: add #![feature(float_bits_conv)] to the crate attributes to enable error: use of unstable library feature 'float_bits_conv': recently added (see issue #40470) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/misc.rs:439:52 | 439 | bits: ::std::f64::NEG_INFINITY.to_bits() as u128, | ^^^^^^^ | = help: add #![feature(float_bits_conv)] to the crate attributes to enable error[E0599]: no function or associated item named `new` found for type `rustc_const_eval::ConstContext<'_, '_>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/regex.rs:157:11 | 157 | match ConstContext::new(cx.tcx, cx.param_env.and(substs), cx.tables).eval(e) { | ^^^^^^^^^^^^^^^^^ error[E0599]: no function or associated item named `new` found for type `rustc_const_eval::ConstContext<'_, '_>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/types.rs:984:20 | 984 | let cv = match ConstContext::new(cx.tcx, cx.param_env.and(substs), cx.tables).eval(expr) { | ^^^^^^^^^^^^^^^^^ error[E0599]: no function or associated item named `new` found for type `rustc_const_eval::ConstContext<'_, '_>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/types.rs:1184:11 | 1184 | match ConstContext::new(cx.tcx, cx.param_env.and(substs), cx.tables).eval(expr) { | ^^^^^^^^^^^^^^^^^ error[E0599]: no function or associated item named `new` found for type `rustc_const_eval::ConstContext<'_, '_>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/vec.rs:66:16 | 66 | if ConstContext::new(cx.tcx, cx.param_env.and(substs), cx.tables).eval(len).is_ok() { | ^^^^^^^^^^^^^^^^^ error: Compilation failed, aborting rustdoc thread 'main' panicked at 'ChainedError { error: Could not document `clippy_lints`., cause: process didn't exit successfully: `rustdoc --crate-name clippy_lints .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.149/src/lib.rs -o /home/cratesfyi/cratesfyi/doc -L dependency=/home/cratesfyi/cratesfyi/debug/deps --extern serde=/home/cratesfyi/cratesfyi/debug/deps/libserde-c7201ac4f95f293e.rlib --extern-version serde=serde,1.0.11 --extern itertools=/home/cratesfyi/cratesfyi/debug/deps/libitertools-86e98dc5b478f997.rlib --extern-version itertools=itertools,0.6.1 --extern toml=/home/cratesfyi/cratesfyi/debug/deps/libtoml-a7d305db388eaaf6.rlib --extern-version toml=toml,0.4.4 --extern unicode_normalization=/home/cratesfyi/cratesfyi/debug/deps/libunicode_normalization-5554c8b28de87bfc.rlib --extern-version unicode_normalization=unicode-normalization,0.1.5 --extern semver=/home/cratesfyi/cratesfyi/debug/deps/libsemver-70b59fcc83de19e2.rlib --extern-version semver=semver,0.6.0 --extern serde_derive=/home/cratesfyi/cratesfyi/debug/deps/libserde_derive-27ac43668445212f.so --extern-version serde_derive=serde_derive,1.0.11 --extern matches=/home/cratesfyi/cratesfyi/debug/deps/libmatches-e2a43ce3f52b9dcc.rlib --extern-version matches=matches,0.1.6 --extern regex_syntax=/home/cratesfyi/cratesfyi/debug/deps/libregex_syntax-0240ebb185fe3635.rlib --extern-version regex_syntax=regex-syntax,0.4.1 --extern pulldown_cmark=/home/cratesfyi/cratesfyi/debug/deps/libpulldown_cmark-51e76190cc33fac5.rlib --extern-version pulldown_cmark=pulldown-cmark,0.0.15 --extern lazy_static=/home/cratesfyi/cratesfyi/debug/deps/liblazy_static-18005fa1be5dd889.rlib --extern-version lazy_static=lazy_static,0.2.8 --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` (exit code: 101) }', src/bin/cratesfyi.rs:142 note: Run with `RUST_BACKTRACE=1` for a backtrace.