clippy 0.0.157

A bunch of helpful lints to avoid common pitfalls in Rust

Build #69629 2017-09-04 15:15:13

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.21.0-dev (d835dc82b 2017-08-29)

# 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.157 Fresh quote v0.3.15 Fresh num-traits v0.1.40 Fresh getopts v0.2.14 Fresh lazy_static v0.2.8 Fresh unicode-normalization v0.1.5 Fresh dtoa v0.4.2 Fresh matches v0.1.6 Fresh semver-parser v0.7.0 Fresh itoa v0.3.3 Fresh bitflags v0.9.1 Fresh serde v1.0.11 Fresh regex-syntax v0.4.1 Fresh unicode-xid v0.0.4 Fresh quine-mc_cluskey v0.2.4 Fresh semver v0.6.0 Fresh either v1.1.0 Fresh serde_json v1.0.2 Fresh toml v0.4.5 Fresh synom v0.11.3 Fresh itertools v0.6.2 Fresh pulldown-cmark v0.0.15 Fresh syn v0.11.11 Fresh serde_derive_internals v0.15.1 Fresh serde_derive v1.0.11 Compiling clippy_lints v0.0.157 Fresh cargo_metadata v0.2.3 Running `rustc --crate-name clippy_lints .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=271c5bebd6eda83c -C extra-filename=-271c5bebd6eda83c --out-dir /home/cratesfyi/cratesfyi/debug/deps -L dependency=/home/cratesfyi/cratesfyi/debug/deps --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 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 regex_syntax=/home/cratesfyi/cratesfyi/debug/deps/libregex_syntax-0240ebb185fe3635.rlib --extern-version regex_syntax=regex-syntax,0.4.1 --extern toml=/home/cratesfyi/cratesfyi/debug/deps/libtoml-43a73e8f4c70aac5.rlib --extern-version toml=toml,0.4.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 semver=/home/cratesfyi/cratesfyi/debug/deps/libsemver-70b59fcc83de19e2.rlib --extern-version semver=semver,0.6.0 --extern itertools=/home/cratesfyi/cratesfyi/debug/deps/libitertools-d225ddfcb503bcb8.rlib --extern-version itertools=itertools,0.6.2 --extern serde=/home/cratesfyi/cratesfyi/debug/deps/libserde-c7201ac4f95f293e.rlib --extern-version serde=serde,1.0.11 --extern serde_derive=/home/cratesfyi/cratesfyi/debug/deps/libserde_derive-27ac43668445212f.so --extern-version serde_derive=serde_derive,1.0.11 --cap-lints allow` error[E0412]: cannot find type `Scope` in module `region` --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/loops.rs:1037:43 | 1037 | indexed: HashMap<Name, Option<region::Scope>>, | ^^^^^ not found in `region` error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/mod.rs:101:9 | 101 | rhs.ctxt() != lhs.ctxt() | ^^^^ field, not a method | = help: did you mean to write `rhs.ctxt` instead of `rhs.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/mod.rs:101:23 | 101 | rhs.ctxt() != lhs.ctxt() | ^^^^ field, not a method | = help: did you mean to write `lhs.ctxt` instead of `lhs.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/mod.rs:117:10 | 117 | span.ctxt().outer().expn_info().map_or(false, |info| { | ^^^^ field, not a method | = help: did you mean to write `span.ctxt` instead of `span.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/mod.rs:150:10 | 150 | span.ctxt().outer().expn_info().map_or(false, |info| { | ^^^^ field, not a method | = help: did you mean to write `span.ctxt` instead of `span.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/mod.rs:744:35 | 744 | let span_name_span = span.ctxt().outer().expn_info().map(|ei| { | ^^^^ field, not a method | = help: did you mean to write `span.ctxt` instead of `span.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/mod.rs:766:31 | 766 | let span_name_span = span.ctxt().outer().expn_info().map(|ei| { | ^^^^ field, not a method | = help: did you mean to write `span.ctxt` instead of `span.ctxt(...)`? error[E0599]: no method named `lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/sugg.rs:395:55 | 395 | let lo = cx.sess().codemap().lookup_char_pos(span.lo()); | ^^ field, not a method | = help: did you mean to write `span.lo` instead of `span.lo(...)`? error[E0599]: no method named `with_hi` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/sugg.rs:446:29 | 446 | let span = item.with_hi(item.lo()); | ^^^^^^^ error[E0599]: no method named `lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/sugg.rs:446:42 | 446 | let span = item.with_hi(item.lo()); | ^^ field, not a method | = help: did you mean to write `item.lo` instead of `item.lo(...)`? error[E0599]: no method named `with_hi` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/sugg.rs:454:29 | 454 | let span = item.with_hi(item.lo()); | ^^^^^^^ error[E0599]: no method named `lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/sugg.rs:454:42 | 454 | let span = item.with_hi(item.lo()); | ^^ field, not a method | = help: did you mean to write `item.lo` instead of `item.lo(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/utils/internal_lints.rs:140:18 | 140 | .ctxt() | ^^^^ field, not a method | = help: did you mean to write `lint_span.ctxt` instead of `lint_span.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/collapsible_if.rs:129:22 | 129 | if expr.span.ctxt() != inner.span.ctxt() { | ^^^^ field, not a method | = help: did you mean to write `expr.span.ctxt` instead of `expr.span.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/collapsible_if.rs:129:43 | 129 | if expr.span.ctxt() != inner.span.ctxt() { | ^^^^ field, not a method | = help: did you mean to write `inner.span.ctxt` instead of `inner.span.ctxt(...)`? error[E0599]: no method named `with_lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/doc.rs:97:38 | 97 | (doc.len(), span.with_lo(span.lo() + BytePos(prefix.len() as u32))), | ^^^^^^^ error[E0599]: no method named `lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/doc.rs:97:51 | 97 | (doc.len(), span.with_lo(span.lo() + BytePos(prefix.len() as u32))), | ^^ field, not a method | = help: did you mean to write `span.lo` instead of `span.lo(...)`? error[E0599]: no method named `with_lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/doc.rs:112:46 | 112 | sizes.push((line.len() + 1, span.with_lo(span.lo() + BytePos(offset as u32)))); | ^^^^^^^ error[E0599]: no method named `lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/doc.rs:112:59 | 112 | sizes.push((line.len() + 1, span.with_lo(span.lo() + BytePos(offset as u32)))); | ^^ field, not a method | = help: did you mean to write `span.lo` instead of `span.lo(...)`? error[E0599]: no method named `with_lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/doc.rs:219:37 | 219 | let span = span.with_lo(span.lo() + BytePos::from_usize(offset - begin)); | ^^^^^^^ error[E0599]: no method named `lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/doc.rs:219:50 | 219 | let span = span.with_lo(span.lo() + BytePos::from_usize(offset - begin)); | ^^ field, not a method | = help: did you mean to write `span.lo` instead of `span.lo(...)`? error[E0599]: no function or associated item named `new` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/doc.rs:241:20 | 241 | let span = Span::new( | ^^^^^^^^^ error[E0599]: no method named `lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/doc.rs:242:18 | 242 | span.lo() + BytePos::from_usize(offset), | ^^ field, not a method | = help: did you mean to write `span.lo` instead of `span.lo(...)`? error[E0599]: no method named `lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/doc.rs:243:18 | 243 | span.lo() + BytePos::from_usize(offset + word.len()), | ^^ field, not a method | = help: did you mean to write `span.lo` instead of `span.lo(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/doc.rs:244:18 | 244 | span.ctxt(), | ^^^^ field, not a method | = help: did you mean to write `span.ctxt` instead of `span.ctxt(...)`? error[E0599]: no method named `region_scope_tree` found for type `rustc::ty::TyCtxt<'a, 'tcx, 'tcx>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/escape.rs:73:41 | 73 | let region_scope_tree = &cx.tcx.region_scope_tree(fn_def_id); | ^^^^^^^^^^^^^^^^^ error[E0599]: no method named `with_lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/formatting.rs:173:50 | 173 | let lint_span = lhs.span.with_lo(lhs.span.hi()); | ^^^^^^^ error[E0599]: no method named `hi` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/formatting.rs:173:67 | 173 | let lint_span = lhs.span.with_lo(lhs.span.hi()); | ^^ field, not a method | = help: did you mean to write `lhs.span.hi` instead of `lhs.span.hi(...)`? error[E0599]: no method named `with_hi` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/if_let_redundant_pattern_matching.rs:76:42 | 76 | let span = expr.span.with_hi(op.span.hi()); | ^^^^^^^ error[E0599]: no method named `hi` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/if_let_redundant_pattern_matching.rs:76:58 | 76 | let span = expr.span.with_hi(op.span.hi()); | ^^ field, not a method | = help: did you mean to write `op.span.hi` instead of `op.span.hi(...)`? error[E0599]: no method named `region_scope_tree` found for type `rustc::ty::TyCtxt<'a, 'tcx, 'tcx>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/loops.rs:624:52 | 624 | let region_scope_tree = cx.tcx.region_scope_tree(parent_def_id); | ^^^^^^^^^^^^^^^^^ error[E0599]: no method named `region_scope_tree` found for type `rustc::ty::TyCtxt<'a, 'tcx, 'tcx>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/loops.rs:1071:46 | 1071 | let extent = self.cx.tcx.region_scope_tree(parent_def_id).var_scope(hir_id.local_id); | ^^^^^^^^^^^^^^^^^ error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/methods.rs:1095:42 | 1095 | let same_span = map_args[1].span.ctxt() == unwrap_args[1].span.ctxt(); | ^^^^ field, not a method | = help: did you mean to write `map_args[1].span.ctxt` instead of `map_args[1].span.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/methods.rs:1095:72 | 1095 | let same_span = map_args[1].span.ctxt() == unwrap_args[1].span.ctxt(); | ^^^^ field, not a method | = help: did you mean to write `unwrap_args[1].span.ctxt` instead of `unwrap_args[1].span.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/methods.rs:1128:42 | 1128 | let same_span = map_args[1].span.ctxt() == unwrap_args[1].span.ctxt(); | ^^^^ field, not a method | = help: did you mean to write `map_args[1].span.ctxt` instead of `map_args[1].span.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/methods.rs:1128:72 | 1128 | let same_span = map_args[1].span.ctxt() == unwrap_args[1].span.ctxt(); | ^^^^ field, not a method | = help: did you mean to write `unwrap_args[1].span.ctxt` instead of `unwrap_args[1].span.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/misc.rs:570:15 | 570 | expr.span.ctxt().outer().expn_info().map_or( | ^^^^ field, not a method | = help: did you mean to write `expr.span.ctxt` instead of `expr.span.ctxt(...)`? error[E0599]: no method named `region_scope_tree` found for type `rustc::ty::TyCtxt<'a, 'tcx, 'tcx>` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/needless_pass_by_value.rs:100:45 | 100 | let region_scope_tree = &cx.tcx.region_scope_tree(fn_def_id); | ^^^^^^^^^^^^^^^^^ error[E0599]: no function or associated item named `new` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/regex.rs:142:13 | 142 | Span::new(base.lo() + BytePos(l as u32), base.lo() + BytePos(h as u32), base.ctxt()) | ^^^^^^^^^ error[E0599]: no method named `lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/regex.rs:142:28 | 142 | Span::new(base.lo() + BytePos(l as u32), base.lo() + BytePos(h as u32), base.ctxt()) | ^^ field, not a method | = help: did you mean to write `base.lo` instead of `base.lo(...)`? error[E0599]: no method named `lo` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/regex.rs:142:59 | 142 | Span::new(base.lo() + BytePos(l as u32), base.lo() + BytePos(h as u32), base.ctxt()) | ^^ field, not a method | = help: did you mean to write `base.lo` instead of `base.lo(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/regex.rs:142:90 | 142 | Span::new(base.lo() + BytePos(l as u32), base.lo() + BytePos(h as u32), base.ctxt()) | ^^^^ field, not a method | = help: did you mean to write `base.ctxt` instead of `base.ctxt(...)`? error[E0599]: no method named `ctxt` found for type `syntax_pos::Span` in the current scope --> .cargo/registry/src/github.com-1ecc6299db9ec823/clippy_lints-0.0.157/src/vec.rs:54:33 | 54 | let span = arg.span.ctxt().outer().expn_info().map(|info| info.call_site).expect("unable to get call_site"); | ^^^^ field, not a method | = help: did you mean to write `arg.span.ctxt` instead of `arg.span.ctxt(...)`? error: aborting due to 43 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.157/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=271c5bebd6eda83c -C extra-filename=-271c5bebd6eda83c --out-dir /home/cratesfyi/cratesfyi/debug/deps -L dependency=/home/cratesfyi/cratesfyi/debug/deps --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 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 regex_syntax=/home/cratesfyi/cratesfyi/debug/deps/libregex_syntax-0240ebb185fe3635.rlib --extern-version regex_syntax=regex-syntax,0.4.1 --extern toml=/home/cratesfyi/cratesfyi/debug/deps/libtoml-43a73e8f4c70aac5.rlib --extern-version toml=toml,0.4.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 semver=/home/cratesfyi/cratesfyi/debug/deps/libsemver-70b59fcc83de19e2.rlib --extern-version semver=semver,0.6.0 --extern itertools=/home/cratesfyi/cratesfyi/debug/deps/libitertools-d225ddfcb503bcb8.rlib --extern-version itertools=itertools,0.6.2 --extern serde=/home/cratesfyi/cratesfyi/debug/deps/libserde-c7201ac4f95f293e.rlib --extern-version serde=serde,1.0.11 --extern serde_derive=/home/cratesfyi/cratesfyi/debug/deps/libserde_derive-27ac43668445212f.so --extern-version serde_derive=serde_derive,1.0.11 --cap-lints allow` (exit code: 101) }', src/bin/cratesfyi.rs:142 note: Run with `RUST_BACKTRACE=1` for a backtrace.