clippy_lints 0.0.121

A bunch of helpful lints to avoid common pitfalls in Rust

Build #44745 2017-03-21 07:59:37

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.17.0-nightly (485358400 2017-03-18)

# docs.rs version cratesfyi 0.3.2 (56e5d46 2017-03-20)

# build log Updating registry `https://github.com/rust-lang/crates.io-index` Downloading clippy_lints v0.0.121 Compiling quine-mc_cluskey v0.2.4 Compiling rustc-serialize v0.3.23 Compiling matches v0.1.4 Compiling semver-parser v0.7.0 Compiling regex-syntax v0.4.0 Compiling unicode-normalization v0.1.4 Running `rustc --crate-name quine_mc_cluskey .cargo/registry/src/github.com-1ecc6299db9ec823/quine-mc_cluskey-0.2.4/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=9702e7983e184bea -C extra-filename=-9702e7983e184bea --out-dir /home/cratesfyi/clippy_lints-0.0.121/debug/deps -L dependency=/home/cratesfyi/clippy_lints-0.0.121/debug/deps --cap-lints allow` Running `rustc --crate-name rustc_serialize .cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.23/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=54d2bf33b1d4b0b0 -C extra-filename=-54d2bf33b1d4b0b0 --out-dir /home/cratesfyi/clippy_lints-0.0.121/debug/deps -L dependency=/home/cratesfyi/clippy_lints-0.0.121/debug/deps --cap-lints allow` Running `rustc --crate-name matches .cargo/registry/src/github.com-1ecc6299db9ec823/matches-0.1.4/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=8f1598a59712d6cc -C extra-filename=-8f1598a59712d6cc --out-dir /home/cratesfyi/clippy_lints-0.0.121/debug/deps -L dependency=/home/cratesfyi/clippy_lints-0.0.121/debug/deps --cap-lints allow` Running `rustc --crate-name regex_syntax .cargo/registry/src/github.com-1ecc6299db9ec823/regex-syntax-0.4.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=21fcdc3a2a66b202 -C extra-filename=-21fcdc3a2a66b202 --out-dir /home/cratesfyi/clippy_lints-0.0.121/debug/deps -L dependency=/home/cratesfyi/clippy_lints-0.0.121/debug/deps --cap-lints allow` Running `rustc --crate-name semver_parser .cargo/registry/src/github.com-1ecc6299db9ec823/semver-parser-0.7.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=df3c236d49c7b60f -C extra-filename=-df3c236d49c7b60f --out-dir /home/cratesfyi/clippy_lints-0.0.121/debug/deps -L dependency=/home/cratesfyi/clippy_lints-0.0.121/debug/deps --cap-lints allow` Running `rustc --crate-name unicode_normalization .cargo/registry/src/github.com-1ecc6299db9ec823/unicode-normalization-0.1.4/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=0297b14f098a4d93 -C extra-filename=-0297b14f098a4d93 --out-dir /home/cratesfyi/clippy_lints-0.0.121/debug/deps -L dependency=/home/cratesfyi/clippy_lints-0.0.121/debug/deps --cap-lints allow` Compiling semver v0.6.0 Running `rustc --crate-name semver .cargo/registry/src/github.com-1ecc6299db9ec823/semver-0.6.0/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="default"' -C metadata=a755b7ebf243aa54 -C extra-filename=-a755b7ebf243aa54 --out-dir /home/cratesfyi/clippy_lints-0.0.121/debug/deps -L dependency=/home/cratesfyi/clippy_lints-0.0.121/debug/deps --extern semver_parser=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libsemver_parser-df3c236d49c7b60f.rlib --cap-lints allow` Compiling toml v0.2.1 Running `rustc --crate-name toml .cargo/registry/src/github.com-1ecc6299db9ec823/toml-0.2.1/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="rustc-serialize"' --cfg 'feature="default"' -C metadata=94ea404b50476639 -C extra-filename=-94ea404b50476639 --out-dir /home/cratesfyi/clippy_lints-0.0.121/debug/deps -L dependency=/home/cratesfyi/clippy_lints-0.0.121/debug/deps --extern rustc_serialize=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/librustc_serialize-54d2bf33b1d4b0b0.rlib --cap-lints allow` Documenting clippy_lints v0.0.121 Running `rustdoc --crate-name clippy_lints .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/lib.rs -o /home/cratesfyi/clippy_lints-0.0.121/doc -L dependency=/home/cratesfyi/clippy_lints-0.0.121/debug/deps --extern matches=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libmatches-8f1598a59712d6cc.rlib --extern toml=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libtoml-94ea404b50476639.rlib --extern quine_mc_cluskey=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libquine_mc_cluskey-9702e7983e184bea.rlib --extern regex_syntax=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libregex_syntax-21fcdc3a2a66b202.rlib --extern unicode_normalization=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libunicode_normalization-0297b14f098a4d93.rlib --extern semver=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libsemver-a755b7ebf243aa54.rlib` error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:8:5 | 8 | use std::collections::Bound; | ^^^^^^^^^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:419:47 | 413 | if_let_chain! {[ | - in this macro invocation ... 419 | RangeEnd::Included => Bound::Included(rhs), | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:420:47 | 413 | if_let_chain! {[ | - in this macro invocation ... 420 | RangeEnd::Excluded => Bound::Excluded(rhs), | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:429:86 | 425 | if_let_chain! {[ | _____________________- starting here... 426 | | let PatKind::Lit(ref value) = pat.node, 427 | | let Ok(value) = constcx.eval(value) 428 | | ], { 429 | | return Some(SpannedRange { span: pat.span, node: (value.clone(), Bound::Included(value)) }); | | ^^^^^^^^^^^^^^^ 430 | | }} | |__________________- ...ending here: in this macro invocation | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:451:41 | 451 | (ConstVal::Integral(start), Bound::Included(ConstVal::Integral(end))) => { | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:454:35 | 454 | node: (start, Bound::Included(end)), | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:457:41 | 457 | (ConstVal::Integral(start), Bound::Excluded(ConstVal::Integral(end))) => { | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:460:35 | 460 | node: (start, Bound::Excluded(end)), | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:463:41 | 463 | (ConstVal::Integral(start), Bound::Unbounded) => { | ^^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:466:35 | 466 | node: (start, Bound::Unbounded), | ^^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:578:60 | 578 | (&Kind::End(a, _), &Kind::Start(b, _)) if a != Bound::Included(b) => (), | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:441:19 | 441 | pub node: (T, Bound<T>), | ^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:513:13 | 513 | End(Bound<T>, &'a SpannedRange<T>), | ^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:524:27 | 524 | fn value(self) -> Bound<T> { | ^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:526:38 | 526 | Kind::Start(t, _) => Bound::Included(t), | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:541:18 | 541 | (Bound::Included(a), Bound::Included(b)) | | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:541:38 | 541 | (Bound::Included(a), Bound::Included(b)) | | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:542:18 | 542 | (Bound::Excluded(a), Bound::Excluded(b)) => a.cmp(&b), | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:542:38 | 542 | (Bound::Excluded(a), Bound::Excluded(b)) => a.cmp(&b), | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:544:18 | 544 | (Bound::Unbounded, _) | | ^^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:545:21 | 545 | (_, Bound::Unbounded) => unimplemented!(), | ^^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:546:18 | 546 | (Bound::Included(a), Bound::Excluded(b)) => { | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:546:38 | 546 | (Bound::Included(a), Bound::Excluded(b)) => { | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:552:18 | 552 | (Bound::Excluded(a), Bound::Included(b)) => { | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:552:38 | 552 | (Bound::Excluded(a), Bound::Included(b)) => { | ^^^^^^^^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:441:19 | 441 | pub node: (T, Bound<T>), | ^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: use of unstable library feature 'collections_bound' (see issue #27787) --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/matches.rs:513:13 | 513 | End(Bound<T>, &'a SpannedRange<T>), | ^^^^^^^^ | = help: add #![feature(collections_bound)] to the crate attributes to enable error: no method named `map_or` found for type `syntax::ast::Symbol` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/utils/mod.rs:682:28 | 682 | if attr.name().map_or(false, |n| n == name) { | ^^^^^^ error: no method named `map_or` found for type `syntax::ast::Symbol` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/attrs.rs:90:48 | 90 | if items.is_empty() || attr.name().map_or(true, |n| n != "deprecated") { | ^^^^^^ error[E0277]: the trait bound `&&[syntax::codemap::Spanned<syntax::ast::NestedMetaItemKind>]: core::iter::Iterator` is not satisfied --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/attrs.rs:93:13 | 93 | for item in items { | _____________^ starting here... 94 | | if_let_chain! {[ 95 | | let NestedMetaItemKind::MetaItem(ref mi) = item.node, 96 | | let MetaItemKind::NameValue(ref lit) = mi.node, 97 | | mi.name() == "since", 98 | | ], { 99 | | check_semver(cx, item.span, lit); 100 | | }} 101 | | } | |_____________^ ...ending here: the trait `core::iter::Iterator` is not implemented for `&&[syntax::codemap::Spanned<syntax::ast::NestedMetaItemKind>]` | = note: `&&[syntax::codemap::Spanned<syntax::ast::NestedMetaItemKind>]` is not an iterator; maybe try calling `.iter()` or a similar method = note: required by `core::iter::IntoIterator::into_iter` error[E0308]: mismatched types --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/attrs.rs:114:32 | 114 | if let Some(name) = attr.name() { | ^^^^^^^^^^ expected struct `syntax::ast::Symbol`, found enum `core::option::Option` | = note: expected type `syntax::ast::Symbol` found type `core::option::Option<_>` error[E0277]: the trait bound `&&[syntax::codemap::Spanned<syntax::ast::NestedMetaItemKind>]: core::iter::Iterator` is not satisfied --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/attrs.rs:118:37 | 118 | for lint in lint_list { | _____________________________________^ starting here... 119 | | if is_word(lint, "unused_imports") || is_word(lint, "deprecated") { 120 | | if let ItemUse(_, _) = item.node { 121 | | return; 122 | | } 123 | | } 124 | | } | |_____________________________________^ ...ending here: the trait `core::iter::Iterator` is not implemented for `&&[syntax::codemap::Spanned<syntax::ast::NestedMetaItemKind>]` | = note: `&&[syntax::codemap::Spanned<syntax::ast::NestedMetaItemKind>]` is not an iterator; maybe try calling `.iter()` or a similar method = note: required by `core::iter::IntoIterator::into_iter` error: no method named `map_or` found for type `syntax::ast::Symbol` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/attrs.rs:224:49 | 224 | if values.len() != 1 || attr.name().map_or(true, |n| n != "inline") { | ^^^^^^ error: no method named `map_or` found for type `syntax::ast::Symbol` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/missing_doc.rs:80:73 | 80 | let has_doc = attrs.iter().any(|a| a.is_value_str() && a.name().map_or(false, |n| n == "doc")); | ^^^^^^ error: no method named `map_or` found for type `syntax::ast::Symbol` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.121/src/returns.rs:153:52 | 153 | attr.meta_item_list().is_some() && attr.name().map_or(false, |n| n == "cfg") | ^^^^^^ 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.121/src/lib.rs -o /home/cratesfyi/clippy_lints-0.0.121/doc -L dependency=/home/cratesfyi/clippy_lints-0.0.121/debug/deps --extern matches=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libmatches-8f1598a59712d6cc.rlib --extern toml=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libtoml-94ea404b50476639.rlib --extern quine_mc_cluskey=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libquine_mc_cluskey-9702e7983e184bea.rlib --extern regex_syntax=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libregex_syntax-21fcdc3a2a66b202.rlib --extern unicode_normalization=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libunicode_normalization-0297b14f098a4d93.rlib --extern semver=/home/cratesfyi/clippy_lints-0.0.121/debug/deps/libsemver-a755b7ebf243aa54.rlib` (exit code: 101) }', src/bin/cratesfyi.rs:136 note: Run with `RUST_BACKTRACE=1` for a backtrace.