[INFO] crate bigbro 0.4.0 is already in cache [INFO] extracting crate bigbro 0.4.0 into work/ex/clippy-test-run/sources/stable/reg/bigbro/0.4.0 [INFO] extracting crate bigbro 0.4.0 into work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/reg/bigbro/0.4.0 [INFO] validating manifest of bigbro-0.4.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 bigbro-0.4.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 bigbro-0.4.0 [INFO] finished frobbing bigbro-0.4.0 [INFO] frobbed toml for bigbro-0.4.0 written to work/ex/clippy-test-run/sources/stable/reg/bigbro/0.4.0/Cargo.toml [INFO] started frobbing bigbro-0.4.0 [INFO] finished frobbing bigbro-0.4.0 [INFO] frobbed toml for bigbro-0.4.0 written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/reg/bigbro/0.4.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 bigbro-0.4.0 against stable for clippy-test-run [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/clippy-test-run/worker-6/stable:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/clippy-test-run/sources/stable/reg/bigbro/0.4.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] 0361c6a16c32bdb1e5d274c5b3fc408a334cb3028abbcb00b2de9a55e9615443 [INFO] running `"docker" "start" "-a" "0361c6a16c32bdb1e5d274c5b3fc408a334cb3028abbcb00b2de9a55e9615443"` [INFO] [stderr] warning: An explicit [[bin]] section is specified in Cargo.toml which currently [INFO] [stderr] disables Cargo from automatically inferring other binary targets. [INFO] [stderr] This inference behavior will change in the Rust 2018 edition and the following [INFO] [stderr] files will be included as a binary target: [INFO] [stderr] [INFO] [stderr] * /opt/crater/workdir/src/bin/sh.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 binary target today. You can future-proof yourself [INFO] [stderr] and disable this warning by adding `autobins = 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 seccomp-droundy-sys v0.1.2 [INFO] [stderr] Checking seccomp-droundy v0.1.0 [INFO] [stderr] Checking bigbro v0.4.0 (/opt/crater/workdir) [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/linux.rs:1179:13 [INFO] [stderr] | [INFO] [stderr] 1179 | pid: pid, [INFO] [stderr] | ^^^^^^^^ help: replace it with: `pid` [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/linux.rs:1180:13 [INFO] [stderr] | [INFO] [stderr] 1180 | have_completed: have_completed, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `have_completed` [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/linux.rs:1181:13 [INFO] [stderr] | [INFO] [stderr] 1181 | status_thread: status_thread, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `status_thread` [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/linux.rs:1279:54 [INFO] [stderr] | [INFO] [stderr] 1279 | Ok(pid) => Ok(::Killer { inner: Killer { pid: pid }}), [INFO] [stderr] | ^^^^^^^^ help: replace it with: `pid` [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/linux.rs:1373:39 [INFO] [stderr] | [INFO] [stderr] 1373 | Ok(::Killer { inner: Killer { pid: pid, }}) [INFO] [stderr] | ^^^^^^^^ help: replace it with: `pid` [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/linux.rs:1179:13 [INFO] [stderr] | [INFO] [stderr] 1179 | pid: pid, [INFO] [stderr] | ^^^^^^^^ help: replace it with: `pid` [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/linux.rs:1180:13 [INFO] [stderr] | [INFO] [stderr] 1180 | have_completed: have_completed, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `have_completed` [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/linux.rs:1181:13 [INFO] [stderr] | [INFO] [stderr] 1181 | status_thread: status_thread, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `status_thread` [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/linux.rs:1279:54 [INFO] [stderr] | [INFO] [stderr] 1279 | Ok(pid) => Ok(::Killer { inner: Killer { pid: pid }}), [INFO] [stderr] | ^^^^^^^^ help: replace it with: `pid` [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/linux.rs:1373:39 [INFO] [stderr] | [INFO] [stderr] 1373 | Ok(::Killer { inner: Killer { pid: pid, }}) [INFO] [stderr] | ^^^^^^^^ help: replace it with: `pid` [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: this if statement can be collapsed [INFO] [stderr] --> src/linux.rs:297:25 [INFO] [stderr] | [INFO] [stderr] 297 | / if path.is_file() { [INFO] [stderr] 298 | | if retval >= 0 { [INFO] [stderr] 299 | | if flag & libc::O_WRONLY != 0 || flag & libc::O_RDWR != 0 { [INFO] [stderr] 300 | | self.read_from_files.remove(&path); [INFO] [stderr] ... | [INFO] [stderr] 307 | | } [INFO] [stderr] 308 | | } [INFO] [stderr] | |_________________________^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::collapsible_if)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 297 | if path.is_file() && retval >= 0 { [INFO] [stderr] 298 | if flag & libc::O_WRONLY != 0 || flag & libc::O_RDWR != 0 { [INFO] [stderr] 299 | self.read_from_files.remove(&path); [INFO] [stderr] 300 | self.written_to_files.insert(path); [INFO] [stderr] 301 | } else { [INFO] [stderr] 302 | if !self.written_to_files.contains(&path) { [INFO] [stderr] ... [INFO] [stderr] [INFO] [stderr] warning: this `else { if .. }` block can be collapsed [INFO] [stderr] --> src/linux.rs:302:40 [INFO] [stderr] | [INFO] [stderr] 302 | } else { [INFO] [stderr] | ________________________________________^ [INFO] [stderr] 303 | | if !self.written_to_files.contains(&path) { [INFO] [stderr] 304 | | self.read_from_files.insert(path); [INFO] [stderr] 305 | | } [INFO] [stderr] 306 | | } [INFO] [stderr] | |_________________________________^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 302 | } else if !self.written_to_files.contains(&path) { [INFO] [stderr] 303 | self.read_from_files.insert(path); [INFO] [stderr] 304 | } [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this `else { if .. }` block can be collapsed [INFO] [stderr] --> src/linux.rs:822:12 [INFO] [stderr] | [INFO] [stderr] 822 | } else { [INFO] [stderr] | ____________^ [INFO] [stderr] 823 | | if regs.cs == 0x23 { [INFO] [stderr] 824 | | // child is actually x86 not x86_64.. [INFO] [stderr] 825 | | [regs.rbx as usize, [INFO] [stderr] ... | [INFO] [stderr] 838 | | } [INFO] [stderr] 839 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 822 | } else if regs.cs == 0x23 { [INFO] [stderr] 823 | // child is actually x86 not x86_64.. [INFO] [stderr] 824 | [regs.rbx as usize, [INFO] [stderr] 825 | regs.rcx as usize, [INFO] [stderr] 826 | regs.rdx as usize, [INFO] [stderr] 827 | regs.rsi as usize, [INFO] [stderr] ... [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/linux.rs:1280:23 [INFO] [stderr] | [INFO] [stderr] 1280 | Err(e) => return Err(std::io::Error::new(std::io::ErrorKind::Other,e)), [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `Err(std::io::Error::new(std::io::ErrorKind::Other,e))` [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 unit return type [INFO] [stderr] --> src/linux.rs:1200:36 [INFO] [stderr] | [INFO] [stderr] 1200 | std::thread::spawn(move || -> () { [INFO] [stderr] | ^^^^^ help: remove the `-> ()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::unused_unit)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stderr] [INFO] [stderr] warning: unneeded unit return type [INFO] [stderr] --> src/linux.rs:1339:36 [INFO] [stderr] | [INFO] [stderr] 1339 | std::thread::spawn(move || -> () { [INFO] [stderr] | ^^^^^ help: remove the `-> ()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stderr] [INFO] [stderr] warning: this if statement can be collapsed [INFO] [stderr] --> src/linux.rs:297:25 [INFO] [stderr] | [INFO] [stderr] 297 | / if path.is_file() { [INFO] [stderr] 298 | | if retval >= 0 { [INFO] [stderr] 299 | | if flag & libc::O_WRONLY != 0 || flag & libc::O_RDWR != 0 { [INFO] [stderr] 300 | | self.read_from_files.remove(&path); [INFO] [stderr] ... | [INFO] [stderr] 307 | | } [INFO] [stderr] 308 | | } [INFO] [stderr] | |_________________________^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::collapsible_if)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 297 | if path.is_file() && retval >= 0 { [INFO] [stderr] 298 | if flag & libc::O_WRONLY != 0 || flag & libc::O_RDWR != 0 { [INFO] [stderr] 299 | self.read_from_files.remove(&path); [INFO] [stderr] 300 | self.written_to_files.insert(path); [INFO] [stderr] 301 | } else { [INFO] [stderr] 302 | if !self.written_to_files.contains(&path) { [INFO] [stderr] ... [INFO] [stderr] [INFO] [stderr] warning: this `else { if .. }` block can be collapsed [INFO] [stderr] --> src/linux.rs:302:40 [INFO] [stderr] | [INFO] [stderr] 302 | } else { [INFO] [stderr] | ________________________________________^ [INFO] [stderr] 303 | | if !self.written_to_files.contains(&path) { [INFO] [stderr] 304 | | self.read_from_files.insert(path); [INFO] [stderr] 305 | | } [INFO] [stderr] 306 | | } [INFO] [stderr] | |_________________________________^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 302 | } else if !self.written_to_files.contains(&path) { [INFO] [stderr] 303 | self.read_from_files.insert(path); [INFO] [stderr] 304 | } [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this `else { if .. }` block can be collapsed [INFO] [stderr] --> src/linux.rs:822:12 [INFO] [stderr] | [INFO] [stderr] 822 | } else { [INFO] [stderr] | ____________^ [INFO] [stderr] 823 | | if regs.cs == 0x23 { [INFO] [stderr] 824 | | // child is actually x86 not x86_64.. [INFO] [stderr] 825 | | [regs.rbx as usize, [INFO] [stderr] ... | [INFO] [stderr] 838 | | } [INFO] [stderr] 839 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 822 | } else if regs.cs == 0x23 { [INFO] [stderr] 823 | // child is actually x86 not x86_64.. [INFO] [stderr] 824 | [regs.rbx as usize, [INFO] [stderr] 825 | regs.rcx as usize, [INFO] [stderr] 826 | regs.rdx as usize, [INFO] [stderr] 827 | regs.rsi as usize, [INFO] [stderr] ... [INFO] [stderr] [INFO] [stderr] warning: unneeded return statement [INFO] [stderr] --> src/linux.rs:1280:23 [INFO] [stderr] | [INFO] [stderr] 1280 | Err(e) => return Err(std::io::Error::new(std::io::ErrorKind::Other,e)), [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return` as shown: `Err(std::io::Error::new(std::io::ErrorKind::Other,e))` [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 unit return type [INFO] [stderr] --> src/linux.rs:1200:36 [INFO] [stderr] | [INFO] [stderr] 1200 | std::thread::spawn(move || -> () { [INFO] [stderr] | ^^^^^ help: remove the `-> ()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::unused_unit)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stderr] [INFO] [stderr] warning: unneeded unit return type [INFO] [stderr] --> src/linux.rs:1339:36 [INFO] [stderr] | [INFO] [stderr] 1339 | std::thread::spawn(move || -> () { [INFO] [stderr] | ^^^^^ help: remove the `-> ()` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stderr] [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/linux.rs:86:29 [INFO] [stderr] | [INFO] [stderr] 86 | self.wait().map(|s| Some(s)) [INFO] [stderr] | ^^^^^^^^^^^ help: remove closure as shown: `Some` [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: length comparison to zero [INFO] [stderr] --> src/linux.rs:168:20 [INFO] [stderr] | [INFO] [stderr] 168 | if elements.len() > 0 || lasth == LastSymlink::Followed { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!elements.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: the function has a cyclomatic complexity of 45 [INFO] [stderr] --> src/linux.rs:251:5 [INFO] [stderr] | [INFO] [stderr] 251 | / fn wait_for_syscall(&mut self, pid: i32) -> bool { [INFO] [stderr] 252 | | let mut status = 0; [INFO] [stderr] 253 | | let mut signal_to_send_back = 0; [INFO] [stderr] 254 | | let child = unsafe { libc::waitpid(-pid, &mut status, 0) }; [INFO] [stderr] ... | [INFO] [stderr] 687 | | keep_going [INFO] [stderr] 688 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::cyclomatic_complexity)] on by default [INFO] [stderr] = help: you could split it up into multiple smaller functions [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity [INFO] [stderr] [INFO] [stderr] error: this `if` has identical blocks [INFO] [stderr] --> src/linux.rs:644:108 [INFO] [stderr] | [INFO] [stderr] 644 | } else if libc::WIFSTOPPED(status) && (status>>8) == (libc::SIGTRAP | PTRACE_EVENT_VFORK << 8) { [INFO] [stderr] | ____________________________________________________________________________________________________________^ [INFO] [stderr] 645 | | let mut newpid = 0; [INFO] [stderr] 646 | | libc::ptrace(libc::PTRACE_GETEVENTMSG, child, 0, &mut newpid); [INFO] [stderr] 647 | | //println!("{}: vforked from {}\n", newpid, child); [INFO] [stderr] 648 | | true [INFO] [stderr] 649 | | } else if libc::WIFSTOPPED(status) && (status>>8) == (libc::SIGTRAP | PTRACE_EVENT_CLONE << 8) { [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/linux.rs:639:107 [INFO] [stderr] | [INFO] [stderr] 639 | } else if libc::WIFSTOPPED(status) && (status>>8) == (libc::SIGTRAP | PTRACE_EVENT_FORK << 8) { [INFO] [stderr] | ___________________________________________________________________________________________________________^ [INFO] [stderr] 640 | | let mut newpid = 0; [INFO] [stderr] 641 | | libc::ptrace(libc::PTRACE_GETEVENTMSG, child, 0, &mut newpid); [INFO] [stderr] 642 | | //println!("{}: forked from {}\n", newpid, child); [INFO] [stderr] 643 | | true [INFO] [stderr] 644 | | } else if libc::WIFSTOPPED(status) && (status>>8) == (libc::SIGTRAP | PTRACE_EVENT_VFORK << 8) { [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: `if _ { .. } else { .. }` is an expression [INFO] [stderr] --> src/linux.rs:366:29 [INFO] [stderr] | [INFO] [stderr] 366 | / let follow; [INFO] [stderr] 367 | | if SYSCALLS[syscall_num] == Syscall::Link { [INFO] [stderr] 368 | | from = read_a_string(child, args[0]); [INFO] [stderr] 369 | | to = read_a_string(child, args[1]); [INFO] [stderr] ... | [INFO] [stderr] 382 | | }; [INFO] [stderr] 383 | | } [INFO] [stderr] | |_____________________________^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::useless_let_if_seq)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_let_if_seq [INFO] [stderr] help: it is more idiomatic to write [INFO] [stderr] | [INFO] [stderr] 366 | let follow = if SYSCALLS[syscall_num] == Syscall::Link { ..; LastSymlink::Returned } else { ..; if args[4] as i32 & libc::AT_SYMLINK_FOLLOW != 0 { [INFO] [stderr] 367 | LastSymlink::Followed [INFO] [stderr] 368 | } else { [INFO] [stderr] 369 | LastSymlink::Returned [INFO] [stderr] 370 | } }; [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/linux.rs:708:16 [INFO] [stderr] | [INFO] [stderr] 708 | fn seccomp(&self) -> Vec { [INFO] [stderr] | ^^^^^ help: consider passing by value instead: `self` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::trivially_copy_pass_by_ref)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/linux.rs:746:14 [INFO] [stderr] | [INFO] [stderr] 746 | fn tostr(&self) -> &'static str { [INFO] [stderr] | ^^^^^ help: consider passing by value instead: `self` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: redundant pattern matching, consider using `is_err()` [INFO] [stderr] --> src/linux.rs:1048:28 [INFO] [stderr] | [INFO] [stderr] 1048 | if let Err(_) = std::env::set_current_dir(p) { [INFO] [stderr] | _____________________- ^^^^^^ [INFO] [stderr] 1049 | | libc::_exit(137) [INFO] [stderr] 1050 | | } [INFO] [stderr] | |_____________________- help: try this: `if std::env::set_current_dir(p).is_err()` [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] error: aborting due to previous error [INFO] [stderr] [INFO] [stderr] error: Could not compile `bigbro`. [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] warning: redundant closure found [INFO] [stderr] --> src/linux.rs:86:29 [INFO] [stderr] | [INFO] [stderr] 86 | self.wait().map(|s| Some(s)) [INFO] [stderr] | ^^^^^^^^^^^ help: remove closure as shown: `Some` [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: length comparison to zero [INFO] [stderr] --> src/linux.rs:168:20 [INFO] [stderr] | [INFO] [stderr] 168 | if elements.len() > 0 || lasth == LastSymlink::Followed { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `!elements.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: the function has a cyclomatic complexity of 45 [INFO] [stderr] --> src/linux.rs:251:5 [INFO] [stderr] | [INFO] [stderr] 251 | / fn wait_for_syscall(&mut self, pid: i32) -> bool { [INFO] [stderr] 252 | | let mut status = 0; [INFO] [stderr] 253 | | let mut signal_to_send_back = 0; [INFO] [stderr] 254 | | let child = unsafe { libc::waitpid(-pid, &mut status, 0) }; [INFO] [stderr] ... | [INFO] [stderr] 687 | | keep_going [INFO] [stderr] 688 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::cyclomatic_complexity)] on by default [INFO] [stderr] = help: you could split it up into multiple smaller functions [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cyclomatic_complexity [INFO] [stderr] [INFO] [stderr] error: this `if` has identical blocks [INFO] [stderr] --> src/linux.rs:644:108 [INFO] [stderr] | [INFO] [stderr] 644 | } else if libc::WIFSTOPPED(status) && (status>>8) == (libc::SIGTRAP | PTRACE_EVENT_VFORK << 8) { [INFO] [stderr] | ____________________________________________________________________________________________________________^ [INFO] [stderr] 645 | | let mut newpid = 0; [INFO] [stderr] 646 | | libc::ptrace(libc::PTRACE_GETEVENTMSG, child, 0, &mut newpid); [INFO] [stderr] 647 | | //println!("{}: vforked from {}\n", newpid, child); [INFO] [stderr] 648 | | true [INFO] [stderr] 649 | | } else if libc::WIFSTOPPED(status) && (status>>8) == (libc::SIGTRAP | PTRACE_EVENT_CLONE << 8) { [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/linux.rs:639:107 [INFO] [stderr] | [INFO] [stderr] 639 | } else if libc::WIFSTOPPED(status) && (status>>8) == (libc::SIGTRAP | PTRACE_EVENT_FORK << 8) { [INFO] [stderr] | ___________________________________________________________________________________________________________^ [INFO] [stderr] 640 | | let mut newpid = 0; [INFO] [stderr] 641 | | libc::ptrace(libc::PTRACE_GETEVENTMSG, child, 0, &mut newpid); [INFO] [stderr] 642 | | //println!("{}: forked from {}\n", newpid, child); [INFO] [stderr] 643 | | true [INFO] [stderr] 644 | | } else if libc::WIFSTOPPED(status) && (status>>8) == (libc::SIGTRAP | PTRACE_EVENT_VFORK << 8) { [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: `if _ { .. } else { .. }` is an expression [INFO] [stderr] --> src/linux.rs:366:29 [INFO] [stderr] | [INFO] [stderr] 366 | / let follow; [INFO] [stderr] 367 | | if SYSCALLS[syscall_num] == Syscall::Link { [INFO] [stderr] 368 | | from = read_a_string(child, args[0]); [INFO] [stderr] 369 | | to = read_a_string(child, args[1]); [INFO] [stderr] ... | [INFO] [stderr] 382 | | }; [INFO] [stderr] 383 | | } [INFO] [stderr] | |_____________________________^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::useless_let_if_seq)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_let_if_seq [INFO] [stderr] help: it is more idiomatic to write [INFO] [stderr] | [INFO] [stderr] 366 | let follow = if SYSCALLS[syscall_num] == Syscall::Link { ..; LastSymlink::Returned } else { ..; if args[4] as i32 & libc::AT_SYMLINK_FOLLOW != 0 { [INFO] [stderr] 367 | LastSymlink::Followed [INFO] [stderr] 368 | } else { [INFO] [stderr] 369 | LastSymlink::Returned [INFO] [stderr] 370 | } }; [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/linux.rs:708:16 [INFO] [stderr] | [INFO] [stderr] 708 | fn seccomp(&self) -> Vec { [INFO] [stderr] | ^^^^^ help: consider passing by value instead: `self` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::trivially_copy_pass_by_ref)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/linux.rs:746:14 [INFO] [stderr] | [INFO] [stderr] 746 | fn tostr(&self) -> &'static str { [INFO] [stderr] | ^^^^^ help: consider passing by value instead: `self` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: redundant pattern matching, consider using `is_err()` [INFO] [stderr] --> src/linux.rs:1048:28 [INFO] [stderr] | [INFO] [stderr] 1048 | if let Err(_) = std::env::set_current_dir(p) { [INFO] [stderr] | _____________________- ^^^^^^ [INFO] [stderr] 1049 | | libc::_exit(137) [INFO] [stderr] 1050 | | } [INFO] [stderr] | |_____________________- help: try this: `if std::env::set_current_dir(p).is_err()` [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] error: aborting due to previous error [INFO] [stderr] [INFO] [stderr] error: Could not compile `bigbro`. [INFO] [stderr] [INFO] [stderr] To learn more, run the command again with --verbose. [INFO] running `"docker" "inspect" "0361c6a16c32bdb1e5d274c5b3fc408a334cb3028abbcb00b2de9a55e9615443"` [INFO] running `"docker" "rm" "-f" "0361c6a16c32bdb1e5d274c5b3fc408a334cb3028abbcb00b2de9a55e9615443"` [INFO] [stdout] 0361c6a16c32bdb1e5d274c5b3fc408a334cb3028abbcb00b2de9a55e9615443