[INFO] updating cached repository carlosgj94/simple_blockchain [INFO] running `"git" "fetch" "--all"` [INFO] [stdout] Fetching origin [INFO] [stderr] From git://github.com/carlosgj94/simple_blockchain [INFO] [stderr] * branch HEAD -> FETCH_HEAD [INFO] running `"git" "clone" "work/cache/sources/gh/carlosgj94/simple_blockchain" "work/ex/clippy-test-run/sources/stable/gh/carlosgj94/simple_blockchain"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable/gh/carlosgj94/simple_blockchain'... [INFO] [stderr] done. [INFO] running `"git" "clone" "work/cache/sources/gh/carlosgj94/simple_blockchain" "work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/carlosgj94/simple_blockchain"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/carlosgj94/simple_blockchain'... [INFO] [stderr] done. [INFO] running `"git" "rev-parse" "HEAD"` [INFO] [stdout] 5f1c49970e56d09ea6fd8e84a1294cb183c7ccbd [INFO] sha for GitHub repo carlosgj94/simple_blockchain: 5f1c49970e56d09ea6fd8e84a1294cb183c7ccbd [INFO] validating manifest of carlosgj94/simple_blockchain 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 carlosgj94/simple_blockchain 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 carlosgj94/simple_blockchain [INFO] finished frobbing carlosgj94/simple_blockchain [INFO] frobbed toml for carlosgj94/simple_blockchain written to work/ex/clippy-test-run/sources/stable/gh/carlosgj94/simple_blockchain/Cargo.toml [INFO] started frobbing carlosgj94/simple_blockchain [INFO] finished frobbing carlosgj94/simple_blockchain [INFO] frobbed toml for carlosgj94/simple_blockchain written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/carlosgj94/simple_blockchain/Cargo.toml [INFO] crate carlosgj94/simple_blockchain has a lockfile. skipping [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 carlosgj94/simple_blockchain 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/gh/carlosgj94/simple_blockchain:/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] 867e7a9447b29403f048197481be434de28d09dcaefe3dcc30ccfd914d23b1b1 [INFO] running `"docker" "start" "-a" "867e7a9447b29403f048197481be434de28d09dcaefe3dcc30ccfd914d23b1b1"` [INFO] [stderr] Checking rust-crypto v0.2.36 [INFO] [stderr] Checking simple_blockchain v0.1.0 (/opt/crater/workdir) [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:82:9 [INFO] [stderr] | [INFO] [stderr] 82 | index: index, [INFO] [stderr] | ^^^^^^^^^^^^ help: replace it with: `index` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_field_names)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:83:9 [INFO] [stderr] | [INFO] [stderr] 83 | nonce: nonce, [INFO] [stderr] | ^^^^^^^^^^^^ help: replace it with: `nonce` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:86:9 [INFO] [stderr] | [INFO] [stderr] 86 | data: data, [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `data` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:87:9 [INFO] [stderr] | [INFO] [stderr] 87 | hash: hash [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `hash` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:82:9 [INFO] [stderr] | [INFO] [stderr] 82 | index: index, [INFO] [stderr] | ^^^^^^^^^^^^ help: replace it with: `index` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_field_names)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:83:9 [INFO] [stderr] | [INFO] [stderr] 83 | nonce: nonce, [INFO] [stderr] | ^^^^^^^^^^^^ help: replace it with: `nonce` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:86:9 [INFO] [stderr] | [INFO] [stderr] 86 | data: data, [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `data` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:87:9 [INFO] [stderr] | [INFO] [stderr] 87 | hash: hash [INFO] [stderr] | ^^^^^^^^^^ help: replace it with: `hash` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:50:5 [INFO] [stderr] | [INFO] [stderr] 50 | return hasher.result_str(); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `hasher.result_str()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_return)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:65:5 [INFO] [stderr] | [INFO] [stderr] 65 | return true; [INFO] [stderr] | ^^^^^^^^^^^^ help: remove `return` as shown: `true` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:81:5 [INFO] [stderr] | [INFO] [stderr] 81 | / return Block{ [INFO] [stderr] 82 | | index: index, [INFO] [stderr] 83 | | nonce: nonce, [INFO] [stderr] 84 | | previous_hash: p_block.hash.clone(), [INFO] [stderr] ... | [INFO] [stderr] 88 | | [INFO] [stderr] 89 | | }; [INFO] [stderr] | |______^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] help: remove `return` as shown [INFO] [stderr] | [INFO] [stderr] 81 | Block{ [INFO] [stderr] 82 | index: index, [INFO] [stderr] 83 | nonce: nonce, [INFO] [stderr] 84 | previous_hash: p_block.hash.clone(), [INFO] [stderr] 85 | timestamp: timestamp.sec.to_string(), [INFO] [stderr] 86 | data: data, [INFO] [stderr] ... [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:118:5 [INFO] [stderr] | [INFO] [stderr] 118 | return true; [INFO] [stderr] | ^^^^^^^^^^^^ help: remove `return` as shown: `true` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:50:5 [INFO] [stderr] | [INFO] [stderr] 50 | return hasher.result_str(); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `hasher.result_str()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_return)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:65:5 [INFO] [stderr] | [INFO] [stderr] 65 | return true; [INFO] [stderr] | ^^^^^^^^^^^^ help: remove `return` as shown: `true` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:81:5 [INFO] [stderr] | [INFO] [stderr] 81 | / return Block{ [INFO] [stderr] 82 | | index: index, [INFO] [stderr] 83 | | nonce: nonce, [INFO] [stderr] 84 | | previous_hash: p_block.hash.clone(), [INFO] [stderr] ... | [INFO] [stderr] 88 | | [INFO] [stderr] 89 | | }; [INFO] [stderr] | |______^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] help: remove `return` as shown [INFO] [stderr] | [INFO] [stderr] 81 | Block{ [INFO] [stderr] 82 | index: index, [INFO] [stderr] 83 | nonce: nonce, [INFO] [stderr] 84 | previous_hash: p_block.hash.clone(), [INFO] [stderr] 85 | timestamp: timestamp.sec.to_string(), [INFO] [stderr] 86 | data: data, [INFO] [stderr] ... [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/main.rs:118:5 [INFO] [stderr] | [INFO] [stderr] 118 | return true; [INFO] [stderr] | ^^^^^^^^^^^^ help: remove `return` as shown: `true` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stderr] [INFO] [stderr] warning: value assigned to `hash` is never read [INFO] [stderr] --> src/main.rs:73:13 [INFO] [stderr] | [INFO] [stderr] 73 | let mut hash = String::new(); [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_assignments)] on by default [INFO] [stderr] [INFO] [stderr] warning: function is never used: `is_valid_new_block` [INFO] [stderr] --> src/main.rs:104:1 [INFO] [stderr] | [INFO] [stderr] 104 | fn is_valid_new_block(n_block: Block, p_block: Block) -> bool { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(dead_code)] on by default [INFO] [stderr] [INFO] [stderr] warning: value assigned to `hash` is never read [INFO] [stderr] --> src/main.rs:73:13 [INFO] [stderr] | [INFO] [stderr] 73 | let mut hash = String::new(); [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(unused_assignments)] on by default [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:31:9 [INFO] [stderr] | [INFO] [stderr] 31 | counter= counter + 1; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `counter += 1` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::assign_op_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: writing `&String` instead of `&str` involves a new object where a slice will do. [INFO] [stderr] --> src/main.rs:46:51 [INFO] [stderr] | [INFO] [stderr] 46 | fn calculate_hash(index: i64, nonce: i64, p_hash: &String, timestamp: String, data: &String) -> String { [INFO] [stderr] | ^^^^^^^ help: change this to: `&str` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::ptr_arg)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&String` instead of `&str` involves a new object where a slice will do. [INFO] [stderr] --> src/main.rs:46:85 [INFO] [stderr] | [INFO] [stderr] 46 | fn calculate_hash(index: i64, nonce: i64, p_hash: &String, timestamp: String, data: &String) -> String { [INFO] [stderr] | ^^^^^^^ help: change this to: `&str` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&String` instead of `&str` involves a new object where a slice will do. [INFO] [stderr] --> src/main.rs:53:24 [INFO] [stderr] | [INFO] [stderr] 53 | fn proof_of_work(hash: &String) -> bool { [INFO] [stderr] | ^^^^^^^ help: change this to: `&str` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] error: this `if` has identical blocks [INFO] [stderr] --> src/main.rs:56:48 [INFO] [stderr] | [INFO] [stderr] 56 | }else if hash.chars().nth(1).unwrap() != '0'{ [INFO] [stderr] | ________________________________________________^ [INFO] [stderr] 57 | | return false; [INFO] [stderr] 58 | | }else if hash.chars().nth(2).unwrap() != '0'{ [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = note: #[deny(clippy::if_same_then_else)] on by default [INFO] [stderr] note: same as this [INFO] [stderr] --> src/main.rs:54:42 [INFO] [stderr] | [INFO] [stderr] 54 | if hash.chars().nth(0).unwrap() != '0'{ [INFO] [stderr] | __________________________________________^ [INFO] [stderr] 55 | | return false; [INFO] [stderr] 56 | | }else if hash.chars().nth(1).unwrap() != '0'{ [INFO] [stderr] | |____^ [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:78:9 [INFO] [stderr] | [INFO] [stderr] 78 | nonce = nonce + 1; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ help: replace it with: `nonce += 1` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] error: aborting due to previous error [INFO] [stderr] [INFO] [stderr] error: Could not compile `simple_blockchain`. [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] warning: function is never used: `is_valid_new_block` [INFO] [stderr] --> src/main.rs:104:1 [INFO] [stderr] | [INFO] [stderr] 104 | fn is_valid_new_block(n_block: Block, p_block: Block) -> bool { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(dead_code)] on by default [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:31:9 [INFO] [stderr] | [INFO] [stderr] 31 | counter= counter + 1; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `counter += 1` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::assign_op_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: writing `&String` instead of `&str` involves a new object where a slice will do. [INFO] [stderr] --> src/main.rs:46:51 [INFO] [stderr] | [INFO] [stderr] 46 | fn calculate_hash(index: i64, nonce: i64, p_hash: &String, timestamp: String, data: &String) -> String { [INFO] [stderr] | ^^^^^^^ help: change this to: `&str` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::ptr_arg)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&String` instead of `&str` involves a new object where a slice will do. [INFO] [stderr] --> src/main.rs:46:85 [INFO] [stderr] | [INFO] [stderr] 46 | fn calculate_hash(index: i64, nonce: i64, p_hash: &String, timestamp: String, data: &String) -> String { [INFO] [stderr] | ^^^^^^^ help: change this to: `&str` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&String` instead of `&str` involves a new object where a slice will do. [INFO] [stderr] --> src/main.rs:53:24 [INFO] [stderr] | [INFO] [stderr] 53 | fn proof_of_work(hash: &String) -> bool { [INFO] [stderr] | ^^^^^^^ help: change this to: `&str` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] error: this `if` has identical blocks [INFO] [stderr] --> src/main.rs:56:48 [INFO] [stderr] | [INFO] [stderr] 56 | }else if hash.chars().nth(1).unwrap() != '0'{ [INFO] [stderr] | ________________________________________________^ [INFO] [stderr] 57 | | return false; [INFO] [stderr] 58 | | }else if hash.chars().nth(2).unwrap() != '0'{ [INFO] [stderr] | |____^ [INFO] [stderr] | [INFO] [stderr] = note: #[deny(clippy::if_same_then_else)] on by default [INFO] [stderr] note: same as this [INFO] [stderr] --> src/main.rs:54:42 [INFO] [stderr] | [INFO] [stderr] 54 | if hash.chars().nth(0).unwrap() != '0'{ [INFO] [stderr] | __________________________________________^ [INFO] [stderr] 55 | | return false; [INFO] [stderr] 56 | | }else if hash.chars().nth(1).unwrap() != '0'{ [INFO] [stderr] | |____^ [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:78:9 [INFO] [stderr] | [INFO] [stderr] 78 | nonce = nonce + 1; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ help: replace it with: `nonce += 1` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] error: aborting due to previous error [INFO] [stderr] [INFO] [stderr] error: Could not compile `simple_blockchain`. [INFO] [stderr] [INFO] [stderr] To learn more, run the command again with --verbose. [INFO] running `"docker" "inspect" "867e7a9447b29403f048197481be434de28d09dcaefe3dcc30ccfd914d23b1b1"` [INFO] running `"docker" "rm" "-f" "867e7a9447b29403f048197481be434de28d09dcaefe3dcc30ccfd914d23b1b1"` [INFO] [stdout] 867e7a9447b29403f048197481be434de28d09dcaefe3dcc30ccfd914d23b1b1