[INFO] crate vasp-poscar 0.2.0 is already in cache [INFO] extracting crate vasp-poscar 0.2.0 into work/ex/clippy-test-run/sources/stable/reg/vasp-poscar/0.2.0 [INFO] extracting crate vasp-poscar 0.2.0 into work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/reg/vasp-poscar/0.2.0 [INFO] validating manifest of vasp-poscar-0.2.0 on toolchain stable [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] validating manifest of vasp-poscar-0.2.0 on toolchain stable+rustflags=-Dclippy::into_iter_on_array [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] started frobbing vasp-poscar-0.2.0 [INFO] removed 6 missing tests [INFO] finished frobbing vasp-poscar-0.2.0 [INFO] frobbed toml for vasp-poscar-0.2.0 written to work/ex/clippy-test-run/sources/stable/reg/vasp-poscar/0.2.0/Cargo.toml [INFO] started frobbing vasp-poscar-0.2.0 [INFO] removed 6 missing tests [INFO] finished frobbing vasp-poscar-0.2.0 [INFO] frobbed toml for vasp-poscar-0.2.0 written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/reg/vasp-poscar/0.2.0/Cargo.toml [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] linting vasp-poscar-0.2.0 against stable for clippy-test-run [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/clippy-test-run/worker-5/stable:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/clippy-test-run/sources/stable/reg/vasp-poscar/0.2.0:/opt/crater/workdir:ro,Z" "-v" "/mnt/big/crater/work/local/cargo-home:/opt/crater/cargo-home:ro,Z" "-v" "/mnt/big/crater/work/local/rustup-home:/opt/crater/rustup-home:ro,Z" "-e" "USER_ID=1000" "-e" "SOURCE_DIR=/opt/crater/workdir" "-e" "MAP_USER_ID=1000" "-e" "CARGO_TARGET_DIR=/opt/crater/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/crater/cargo-home" "-e" "RUSTUP_HOME=/opt/crater/rustup-home" "-w" "/opt/crater/workdir" "-m" "1536M" "--network" "none" "rustops/crates-build-env" "/opt/crater/cargo-home/bin/cargo" "+stable" "clippy" "--frozen" "--all" "--all-targets"` [INFO] [stdout] 99d007992dd4cfb4129e4b09030aea8620da67009496611b9e4bad1e08338c34 [INFO] running `"docker" "start" "-a" "99d007992dd4cfb4129e4b09030aea8620da67009496611b9e4bad1e08338c34"` [INFO] [stderr] warning: An explicit [[test]] section is specified in Cargo.toml which currently [INFO] [stderr] disables Cargo from automatically inferring other test targets. [INFO] [stderr] This inference behavior will change in the Rust 2018 edition and the following [INFO] [stderr] files will be included as a test target: [INFO] [stderr] [INFO] [stderr] * /opt/crater/workdir/tests/validate.rs [INFO] [stderr] * /opt/crater/workdir/tests/raw-write.rs [INFO] [stderr] * /opt/crater/workdir/tests/parse-trailing-lines.rs [INFO] [stderr] * /opt/crater/workdir/tests/parse.rs [INFO] [stderr] * /opt/crater/workdir/tests/version-numbers.rs [INFO] [stderr] * /opt/crater/workdir/tests/raw-parse.rs [INFO] [stderr] [INFO] [stderr] This is likely to break cargo build or cargo test as these files may not be [INFO] [stderr] ready to be compiled as a test target today. You can future-proof yourself [INFO] [stderr] and disable this warning by adding `autotests = false` to your [package] [INFO] [stderr] section. You may also move the files to a location where Cargo would not [INFO] [stderr] automatically infer them to be a target, such as in subfolders. [INFO] [stderr] [INFO] [stderr] For more information on this warning you can consult [INFO] [stderr] https://github.com/rust-lang/cargo/issues/5330 [INFO] [stderr] Compiling serde v1.0.85 [INFO] [stderr] Compiling indoc-impl v0.2.8 [INFO] [stderr] Checking vasp-poscar v0.2.0 (/opt/crater/workdir) [INFO] [stderr] warning: using `writeln!(w, "")` [INFO] [stderr] --> src/write.rs:73:33 [INFO] [stderr] | [INFO] [stderr] 73 | &Coords::Frac(_) => writeln!(w, "")?, [INFO] [stderr] | ^^^^^^^^^^^^^^^ help: replace it with: `writeln!(w)` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::writeln_empty_string)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#writeln_empty_string [INFO] [stderr] [INFO] [stderr] warning: Constants have by default a `'static` lifetime [INFO] [stderr] --> src/builder.rs:326:30 [INFO] [stderr] | [INFO] [stderr] 326 | const ALREADY_CONSUMED_MSG: &'static str = "\ [INFO] [stderr] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::const_static_lifetime)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#const_static_lifetime [INFO] [stderr] [INFO] [stderr] warning: explicit lifetimes given in parameter types where they could be elided (or replaced with `'_` if needed by type declaration) [INFO] [stderr] --> src/parse.rs:194:5 [INFO] [stderr] | [INFO] [stderr] 194 | / pub(crate) fn words<'a>(&'a self) -> Words<'a> [INFO] [stderr] 195 | | { [INFO] [stderr] 196 | | use ::std::iter::once; [INFO] [stderr] 197 | | [INFO] [stderr] ... | [INFO] [stderr] 226 | | } [INFO] [stderr] 227 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_lifetimes)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stderr] [INFO] [stderr] warning: you seem to be trying to use match for destructuring a single pattern. Consider using `if let` [INFO] [stderr] --> src/parse.rs:337:9 [INFO] [stderr] | [INFO] [stderr] 337 | / match input.chars().next() { [INFO] [stderr] 338 | | Some('+') => g_bail!(ParseUnsignedError(LeadingPlusError.into())), [INFO] [stderr] 339 | | _ => {}, [INFO] [stderr] 340 | | } [INFO] [stderr] | |_________^ help: try this: `if let Some('+') = input.chars().next() { g_bail!(ParseUnsignedError(LeadingPlusError.into())) }` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::single_match)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stderr] [INFO] [stderr] warning: length comparison to zero [INFO] [stderr] --> src/parse.rs:351:8 [INFO] [stderr] | [INFO] [stderr] 351 | if s.len() == 0 { return false; } [INFO] [stderr] | ^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `s.is_empty()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::len_zero)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/parse.rs:352:22 [INFO] [stderr] | [INFO] [stderr] 352 | if s.bytes().any(|c| is_ascii_whitespace(c)) { return false; } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove closure as shown: `is_ascii_whitespace` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_closure)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stderr] [INFO] [stderr] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stderr] --> src/parse.rs:435:20 [INFO] [stderr] | [INFO] [stderr] 435 | if let Ok(_) = word.parse::() { [INFO] [stderr] | _____________- ^^^^^ [INFO] [stderr] 436 | | bail!(word.error("too many floats on scale line (expected just one)")); [INFO] [stderr] 437 | | } [INFO] [stderr] | |_____________- help: try this: `if word.parse::().is_ok()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_pattern_matching)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stderr] [INFO] [stderr] warning: you seem to be trying to match on a boolean expression [INFO] [stderr] --> src/parse.rs:465:21 [INFO] [stderr] | [INFO] [stderr] 465 | / match is_valid_symbol_for_symbol_line(word.as_str()) { [INFO] [stderr] 466 | | true => Ok(word.as_str().to_string()), [INFO] [stderr] 467 | | false => Err(word.error("invalid symbol")), [INFO] [stderr] 468 | | } [INFO] [stderr] | |_____________________^ help: consider using an if/else expression: `if is_valid_symbol_for_symbol_line(word.as_str()) { Ok(word.as_str().to_string()) } else { Err(word.error("invalid symbol")) }` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::match_bool)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_bool [INFO] [stderr] [INFO] [stderr] warning: you seem to be trying to match on a boolean expression [INFO] [stderr] --> src/parse.rs:522:32 [INFO] [stderr] | [INFO] [stderr] 522 | let mut dynamics = match has_selective_dynamics { [INFO] [stderr] | ________________________________^ [INFO] [stderr] 523 | | true => Some(vec![]), [INFO] [stderr] 524 | | false => None, [INFO] [stderr] 525 | | }; [INFO] [stderr] | |_____________^ help: consider using an if/else expression: `if has_selective_dynamics { Some(vec![]) } else { None }` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_bool [INFO] [stderr] [INFO] [stderr] warning: you seem to be trying to match on a boolean expression [INFO] [stderr] --> src/parse.rs:546:25 [INFO] [stderr] | [INFO] [stderr] 546 | let positions = match has_direct { [INFO] [stderr] | _________________________^ [INFO] [stderr] 547 | | true => Coords::Frac(positions), [INFO] [stderr] 548 | | false => Coords::Cart(positions), [INFO] [stderr] 549 | | }; [INFO] [stderr] | |_________^ help: consider using an if/else expression: `if has_direct { Coords::Frac(positions) } else { Coords::Cart(positions) }` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_bool [INFO] [stderr] [INFO] [stderr] error: this loop never actually loops [INFO] [stderr] --> src/parse.rs:563:22 [INFO] [stderr] | [INFO] [stderr] 563 | let velocities = 'velocities: loop { break { [INFO] [stderr] | ______________________^ [INFO] [stderr] 564 | | [INFO] [stderr] 565 | | // does the file just end? [INFO] [stderr] 566 | | let line = match lines.next() { [INFO] [stderr] ... | [INFO] [stderr] 653 | | } [INFO] [stderr] 654 | | }}; [INFO] [stderr] | |______^ [INFO] [stderr] | [INFO] [stderr] = note: #[deny(clippy::never_loop)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#never_loop [INFO] [stderr] [INFO] [stderr] warning: you seem to be trying to match on a boolean expression [INFO] [stderr] --> src/parse.rs:646:34 [INFO] [stderr] | [INFO] [stderr] 646 | let velocities = match has_direct { [INFO] [stderr] | __________________________________^ [INFO] [stderr] 647 | | true => Coords::Frac(velocities), [INFO] [stderr] 648 | | false => Coords::Cart(velocities), [INFO] [stderr] 649 | | }; [INFO] [stderr] | |_________________^ help: consider using an if/else expression: `if has_direct { Coords::Frac(velocities) } else { Coords::Cart(velocities) }` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_bool [INFO] [stderr] [INFO] [stderr] warning: You are using an explicit closure for cloning elements [INFO] [stderr] --> src/types.rs:65:16 [INFO] [stderr] | [INFO] [stderr] 65 | { Box::new(self.0.group_counts.iter().map(|&c| c)) } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `cloned` method: `self.0.group_counts.iter().cloned()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::map_clone)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/types.rs:431:42 [INFO] [stderr] | [INFO] [stderr] 431 | g_ensure!(!self.comment.contains("\n"), ValidationError::NewlineInComment); [INFO] [stderr] | ^^^^ help: try using a char instead: `'\n'` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::single_char_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/types.rs:432:42 [INFO] [stderr] | [INFO] [stderr] 432 | g_ensure!(!self.comment.contains("\r"), ValidationError::NewlineInComment); [INFO] [stderr] | ^^^^ help: try using a char instead: `'\r'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: The use of negated comparison operators on partially ordered types produces code that is hard to read and refactor. Please consider using the `partial_cmp` method instead, to make it clear that the two values could be incomparable. [INFO] [stderr] --> src/util/macros.rs:12:61 [INFO] [stderr] | [INFO] [stderr] 12 | macro_rules! g_ensure { ($cond:expr, $e:expr $(,)*) => { if !$cond { g_bail!($e); } }; } [INFO] [stderr] | ^^^^^^ [INFO] [stderr] | [INFO] [stderr] ::: src/types.rs:437:17 [INFO] [stderr] | [INFO] [stderr] 437 | g_ensure!(x > 0.0, ValidationError::BadScaleLine); [INFO] [stderr] | -------------------------------------------------- in this macro invocation [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::neg_cmp_op_on_partial_ord)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_cmp_op_on_partial_ord [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/write.rs:26:31 [INFO] [stderr] | [INFO] [stderr] 26 | assert!(!comment.contains("\n"), "BUG"); [INFO] [stderr] | ^^^^ help: try using a char instead: `'\n'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: single-character string constant used as pattern [INFO] [stderr] --> src/write.rs:27:31 [INFO] [stderr] | [INFO] [stderr] 27 | assert!(!comment.contains("\r"), "BUG"); [INFO] [stderr] | ^^^^ help: try using a char instead: `'\r'` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_pattern [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/write.rs:50:5 [INFO] [stderr] | [INFO] [stderr] 50 | / if let &Some(_) = dynamics { [INFO] [stderr] 51 | | writeln!(w, "Selective Dynamics")?; [INFO] [stderr] 52 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::match_ref_pats)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 50 | if let Some(_) = *dynamics { [INFO] [stderr] | ^^^^^^^ ^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/write.rs:54:5 [INFO] [stderr] | [INFO] [stderr] 54 | / match positions { [INFO] [stderr] 55 | | &Coords::Cart(_) => writeln!(w, "Cartesian")?, [INFO] [stderr] 56 | | &Coords::Frac(_) => writeln!(w, "Direct")?, [INFO] [stderr] 57 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 54 | match *positions { [INFO] [stderr] 55 | Coords::Cart(_) => writeln!(w, "Cartesian")?, [INFO] [stderr] 56 | Coords::Frac(_) => writeln!(w, "Direct")?, [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/write.rs:62:9 [INFO] [stderr] | [INFO] [stderr] 62 | / if let &Some(ref dynamics) = dynamics { [INFO] [stderr] 63 | | let fmt = |b| match b { true => 'T', false => 'F' }; [INFO] [stderr] 64 | | write!(w, " {}", By3(dynamics[i], fmt))?; [INFO] [stderr] 65 | | } [INFO] [stderr] | |_________^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 62 | if let Some(ref dynamics) = *dynamics { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you seem to be trying to match on a boolean expression [INFO] [stderr] --> src/write.rs:63:27 [INFO] [stderr] | [INFO] [stderr] 63 | let fmt = |b| match b { true => 'T', false => 'F' }; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using an if/else expression: `if b { 'T' } else { 'F' }` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_bool [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/write.rs:69:5 [INFO] [stderr] | [INFO] [stderr] 69 | / if let &Some(ref velocities) = velocities { [INFO] [stderr] 70 | | match velocities { [INFO] [stderr] 71 | | &Coords::Cart(_) => writeln!(w, "Cartesian")?, [INFO] [stderr] 72 | | // (NOTE: typical appearance in CONTCAR; pymatgen expects this form) [INFO] [stderr] ... | [INFO] [stderr] 79 | | } [INFO] [stderr] 80 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 69 | if let Some(ref velocities) = *velocities { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/write.rs:70:9 [INFO] [stderr] | [INFO] [stderr] 70 | / match velocities { [INFO] [stderr] 71 | | &Coords::Cart(_) => writeln!(w, "Cartesian")?, [INFO] [stderr] 72 | | // (NOTE: typical appearance in CONTCAR; pymatgen expects this form) [INFO] [stderr] 73 | | &Coords::Frac(_) => writeln!(w, "")?, [INFO] [stderr] 74 | | } [INFO] [stderr] | |_________^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 70 | match *velocities { [INFO] [stderr] 71 | Coords::Cart(_) => writeln!(w, "Cartesian")?, [INFO] [stderr] 72 | // (NOTE: typical appearance in CONTCAR; pymatgen expects this form) [INFO] [stderr] 73 | Coords::Frac(_) => writeln!(w, "")?, [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] error: aborting due to previous error [INFO] [stderr] [INFO] [stderr] error: Could not compile `vasp-poscar`. [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] error: build failed [INFO] running `"docker" "inspect" "99d007992dd4cfb4129e4b09030aea8620da67009496611b9e4bad1e08338c34"` [INFO] running `"docker" "rm" "-f" "99d007992dd4cfb4129e4b09030aea8620da67009496611b9e4bad1e08338c34"` [INFO] [stdout] 99d007992dd4cfb4129e4b09030aea8620da67009496611b9e4bad1e08338c34