[INFO] cloning repository https://github.com/sl1191/ddos_probe [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/sl1191/ddos_probe" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsl1191%2Fddos_probe", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsl1191%2Fddos_probe'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 6d76f089d3577925e0f7aa2cf0471330b9846e6f [INFO] building sl1191/ddos_probe against try#d79d87d4c0f7f0d0785ad6e493cf8cf718ed89a6 for pr-146237-1 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fsl1191%2Fddos_probe" "/workspace/builds/worker-3-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc2/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/sl1191/ddos_probe [INFO] finished tweaking git repo https://github.com/sl1191/ddos_probe [INFO] tweaked toml for git repo https://github.com/sl1191/ddos_probe written to /workspace/builds/worker-3-tc2/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/sl1191/ddos_probe on toolchain d79d87d4c0f7f0d0785ad6e493cf8cf718ed89a6 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+d79d87d4c0f7f0d0785ad6e493cf8cf718ed89a6" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/sl1191/ddos_probe already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+d79d87d4c0f7f0d0785ad6e493cf8cf718ed89a6" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:e90291280db7d1fac5b66fc6dad9f9662629e7365a55743daf9bdf73ebc4ea79" "/opt/rustwide/cargo-home/bin/cargo" "+d79d87d4c0f7f0d0785ad6e493cf8cf718ed89a6" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 7419071f5151b8168f6a99ce5dddf44a49ff9dbf7d74aa4888cd2f7f2c498f3a [INFO] running `Command { std: "docker" "start" "-a" "7419071f5151b8168f6a99ce5dddf44a49ff9dbf7d74aa4888cd2f7f2c498f3a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "7419071f5151b8168f6a99ce5dddf44a49ff9dbf7d74aa4888cd2f7f2c498f3a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7419071f5151b8168f6a99ce5dddf44a49ff9dbf7d74aa4888cd2f7f2c498f3a", kill_on_drop: false }` [INFO] [stdout] 7419071f5151b8168f6a99ce5dddf44a49ff9dbf7d74aa4888cd2f7f2c498f3a [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:e90291280db7d1fac5b66fc6dad9f9662629e7365a55743daf9bdf73ebc4ea79" "/opt/rustwide/cargo-home/bin/cargo" "+d79d87d4c0f7f0d0785ad6e493cf8cf718ed89a6" "build" "--frozen" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] e4756976c151a5c302549bcabd613c1c8f4125bade6f0d4bc904b9ec1f725040 [INFO] running `Command { std: "docker" "start" "-a" "e4756976c151a5c302549bcabd613c1c8f4125bade6f0d4bc904b9ec1f725040", kill_on_drop: false }` [INFO] [stderr] Compiling tracing-core v0.1.34 [INFO] [stderr] Compiling memchr v2.7.5 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Compiling regex-syntax v0.8.6 [INFO] [stderr] Compiling thiserror v2.0.16 [INFO] [stderr] Compiling parking_lot_core v0.9.11 [INFO] [stderr] Compiling indexmap v2.11.0 [INFO] [stderr] Compiling ppv-lite86 v0.2.21 [INFO] [stderr] Compiling rustversion v1.0.22 [INFO] [stderr] Compiling futures-util v0.3.31 [INFO] [stderr] Compiling libloading v0.8.8 [INFO] [stderr] Compiling sync_wrapper v1.0.2 [INFO] [stderr] Compiling serde_json v1.0.143 [INFO] [stderr] Compiling anyhow v1.0.99 [INFO] [stderr] Compiling toml_parser v1.0.2 [INFO] [stderr] Compiling errno v0.2.8 [INFO] [stderr] Compiling tracing-log v0.2.0 [INFO] [stderr] Compiling syn v2.0.106 [INFO] [stderr] Compiling parking_lot v0.12.4 [INFO] [stderr] Compiling thread_local v1.1.9 [INFO] [stderr] Compiling matchit v0.8.4 [INFO] [stderr] Compiling aho-corasick v1.1.3 [INFO] [stderr] Compiling rand_chacha v0.9.0 [INFO] [stderr] Compiling toml_writer v1.0.2 [INFO] [stderr] Compiling dashmap v5.5.3 [INFO] [stderr] Compiling etherparse v0.19.0 [INFO] [stderr] Compiling rand v0.9.2 [INFO] [stderr] Compiling arc-swap v1.7.1 [INFO] [stderr] Compiling rangemap v1.6.0 [INFO] [stderr] Compiling regex-automata v0.4.10 [INFO] [stderr] Compiling regex v1.11.2 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling tracing-attributes v0.1.30 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling thiserror-impl v2.0.16 [INFO] [stderr] Compiling pcap v2.3.0 [INFO] [stderr] Compiling tokio v1.47.1 [INFO] [stderr] Compiling tracing v0.1.41 [INFO] [stderr] Compiling tungstenite v0.26.2 [INFO] [stderr] Compiling axum-core v0.5.2 [INFO] [stderr] Compiling tracing-subscriber v0.3.19 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling tokio-util v0.7.16 [INFO] [stderr] Compiling tokio-tungstenite v0.26.2 [INFO] [stderr] Compiling tower v0.5.2 [INFO] [stderr] Compiling h2 v0.4.12 [INFO] [stderr] Compiling toml_datetime v0.7.0 [INFO] [stderr] Compiling serde_urlencoded v0.7.1 [INFO] [stderr] Compiling serde_path_to_error v0.1.17 [INFO] [stderr] Compiling serde_spanned v1.0.0 [INFO] [stderr] Compiling toml v0.9.5 [INFO] [stderr] Compiling hyper v1.7.0 [INFO] [stderr] Compiling hyper-util v0.1.16 [INFO] [stderr] Compiling axum v0.8.4 [INFO] [stderr] Compiling ddos_probe v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `std::time::Duration` [INFO] [stdout] --> src/config.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use std::time::Duration; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Capture` and `Error` [INFO] [stdout] --> src/packet_capture/mod.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | use ::pcap::{Capture, Error}; [INFO] [stdout] | ^^^^^^^ ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `tracing::log::warn` [INFO] [stdout] --> src/packet_capture/mod.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | use tracing::log::warn; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Ipv4Addr` [INFO] [stdout] --> src/rules_engine/rules.rs:3:24 [INFO] [stdout] | [INFO] [stdout] 3 | use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Ipv4Addr` [INFO] [stdout] --> src/rules_engine/limiter.rs:3:24 [INFO] [stdout] | [INFO] [stdout] 3 | use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::sync::Arc` [INFO] [stdout] --> src/rules_engine/limiter.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use std::sync::Arc; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> src/rules_engine/limiter.rs:6:17 [INFO] [stdout] | [INFO] [stdout] 6 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `anyhow::Result` [INFO] [stdout] --> src/metrics_service/ws_server.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | use anyhow::Result; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::io` [INFO] [stdout] --> src/protected_capture.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::io; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `tokio::task` [INFO] [stdout] --> src/protected_capture.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use tokio::task; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `info` and `warn` [INFO] [stdout] --> src/protected_capture.rs:4:29 [INFO] [stdout] | [INFO] [stdout] 4 | use tracing::{debug, error, info, warn}; [INFO] [stdout] | ^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `error` and `info` [INFO] [stdout] --> src/network_utils.rs:4:15 [INFO] [stdout] | [INFO] [stdout] 4 | use tracing::{error, info, warn}; [INFO] [stdout] | ^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::packet_capture::parser::parse_l3l4` [INFO] [stdout] --> src/main.rs:170:9 [INFO] [stdout] | [INFO] [stdout] 170 | use crate::packet_capture::parser::parse_l3l4; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated function `rand::thread_rng`: Renamed to `rng` [INFO] [stdout] --> src/utils.rs:10:21 [INFO] [stdout] | [INFO] [stdout] 10 | use rand::{Rng, thread_rng}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated function `rand::thread_rng`: Renamed to `rng` [INFO] [stdout] --> src/utils.rs:16:19 [INFO] [stdout] | [INFO] [stdout] 16 | let mut rng = thread_rng(); // 线程本地随机数生成器 [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `processor` [INFO] [stdout] --> src/main.rs:173:9 [INFO] [stdout] | [INFO] [stdout] 173 | let processor = PacketProcessor::new(ip_protection.clone()); [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_processor` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `consecutive_timeouts` [INFO] [stdout] --> src/packet_capture/mod.rs:62:21 [INFO] [stdout] | [INFO] [stdout] 62 | let mut consecutive_timeouts = 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_consecutive_timeouts` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `capture_ports_owned` [INFO] [stdout] --> src/packet_capture/mod.rs:60:52 [INFO] [stdout] | [INFO] [stdout] 60 | fn poll_batch(&mut self, metrics: &Metrics,capture_ports_owned: &Vec,) -> io::Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_capture_ports_owned` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/packet_capture/mod.rs:62:17 [INFO] [stdout] | [INFO] [stdout] 62 | let mut consecutive_timeouts = 0; [INFO] [stdout] | ----^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `RuleSet` is never constructed [INFO] [stdout] --> src/rules_engine/rules.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct RuleSet { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/rules_engine/rules.rs:27:12 [INFO] [stdout] | [INFO] [stdout] 25 | impl RuleSet { [INFO] [stdout] | ------------ associated items in this implementation [INFO] [stdout] 26 | /// 创建一个新的空规则集 [INFO] [stdout] 27 | pub fn new() -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 39 | pub fn is_white(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 47 | pub fn is_black(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 55 | pub fn add_white(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 64 | pub fn remove_white(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 73 | pub fn add_black(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 82 | pub fn remove_black(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 91 | pub fn deny_tcp(&self, port: u16) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 96 | pub fn deny_udp(&self, port: u16) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 101 | pub fn add_deny_tcp_port_range(&mut self, start_port: u16, end_port: u16) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 106 | pub fn add_deny_udp_port_range(&mut self, start_port: u16, end_port: u16) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 111 | pub fn remove_deny_tcp_port_range(&mut self, start_port: u16, end_port: u16) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 116 | pub fn remove_deny_udp_port_range(&mut self, start_port: u16, end_port: u16) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static `RULESET` is never used [INFO] [stdout] --> src/rules_engine/rules.rs:122:12 [INFO] [stdout] | [INFO] [stdout] 122 | pub static RULESET: LazyLock> = LazyLock::new(|| { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ipv6_to_u128` is never used [INFO] [stdout] --> src/rules_engine/rules.rs:126:4 [INFO] [stdout] | [INFO] [stdout] 126 | fn ipv6_to_u128(ip: Ipv6Addr) -> u128 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `capacity`, `tokens`, and `rate_per_sec` are never read [INFO] [stdout] --> src/rules_engine/limiter.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 18 | struct Bucket { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 19 | capacity: u32, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 20 | tokens: u32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 21 | rate_per_sec: u32, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Bucket` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `refill`, and `try_consume` are never used [INFO] [stdout] --> src/rules_engine/limiter.rs:27:8 [INFO] [stdout] | [INFO] [stdout] 25 | impl Bucket { [INFO] [stdout] | ----------- associated items in this implementation [INFO] [stdout] 26 | #[inline] [INFO] [stdout] 27 | fn new(capacity: u32, rate_per_sec: u32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 32 | fn refill(&mut self) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 45 | fn try_consume(&mut self, n: u32) -> bool { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `default_capacity`, `default_rate`, and `cleanup_interval` are never read [INFO] [stdout] --> src/rules_engine/limiter.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 52 | pub struct IPRateLimiter { [INFO] [stdout] | ------------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 55 | default_capacity: u64, // 保持与原有接口兼容 [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 56 | default_rate: u64, // 保持与原有接口兼容 [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] 57 | inactive_timeout_ms: u64, [INFO] [stdout] 58 | cleanup_interval: u64, // 保持与原有接口兼容 [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `check`, `set_ip_limit`, `remove_ip_limit`, `check_with_params`, `check_v4`, and `check_v6` are never used [INFO] [stdout] --> src/rules_engine/limiter.rs:75:18 [INFO] [stdout] | [INFO] [stdout] 61 | impl IPRateLimiter { [INFO] [stdout] | ------------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 75 | pub async fn check(&self, ip: &str, tokens: u64) -> bool { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 91 | pub async fn set_ip_limit(&self, ip: &str, capacity: u64, rate: u64) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 104 | pub async fn remove_ip_limit(&self, ip: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 122 | fn check_with_params(&self, ip: IpAddr, tokens: u32, capacity: u32, rate: u32) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 131 | fn check_v4(&self, ip_u32: u32, tokens: u32, capacity: u32, rate: u32) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 146 | fn check_v6(&self, ip_u128: u128, tokens: u32, capacity: u32, rate: u32) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ipv6_to_u128` is never used [INFO] [stdout] --> src/rules_engine/limiter.rs:162:8 [INFO] [stdout] | [INFO] [stdout] 162 | pub fn ipv6_to_u128(ip: Ipv6Addr) -> u128 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ip_str_to_addr` is never used [INFO] [stdout] --> src/rules_engine/limiter.rs:175:8 [INFO] [stdout] | [INFO] [stdout] 175 | pub fn ip_str_to_addr(s: &str) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `drop_packet` is never used [INFO] [stdout] --> src/mitigation/dropper.rs:2:8 [INFO] [stdout] | [INFO] [stdout] 2 | pub fn drop_packet(_packet: &[u8]) { /* 占位:AF_XDP/DPDK 实现时执行丢弃 */ } [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `forward_packet` is never used [INFO] [stdout] --> src/mitigation/forwarder.rs:2:8 [INFO] [stdout] | [INFO] [stdout] 2 | pub fn forward_packet(_packet: &[u8]) { /* 占位:AF_XDP/DPDK 实现时执行转发 */ } [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `MetricsDto` is never constructed [INFO] [stdout] --> src/metrics_service/metrics_data.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 5 | pub struct MetricsDto { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `IPProtectionResult` is never used [INFO] [stdout] --> src/ip_protection.rs:11:10 [INFO] [stdout] | [INFO] [stdout] 11 | pub enum IPProtectionResult { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `metrics` is never read [INFO] [stdout] --> src/ip_protection.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 19 | pub struct IPProtectionService { [INFO] [stdout] | ------------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 22 | metrics: Arc, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `handle_packet`, `manually_block_ip`, `unblock_ip`, and `set_ip_threshold` are never used [INFO] [stdout] --> src/ip_protection.rs:81:18 [INFO] [stdout] | [INFO] [stdout] 26 | impl IPProtectionService { [INFO] [stdout] | ------------------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 81 | pub async fn handle_packet(&self, ft: &FiveTuple, packet_size: u64) -> IPProtectionResult { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 143 | pub async fn manually_block_ip(&self, ip: &str, duration: Duration) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 149 | pub async fn unblock_ip(&self, ip: &str) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 158 | pub async fn set_ip_threshold(&self, ip: &str, threshold: u64) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `ProtectionPolicy` is never used [INFO] [stdout] --> src/ip_protection.rs:166:10 [INFO] [stdout] | [INFO] [stdout] 166 | pub enum ProtectionPolicy { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `increment_pps`, `increment_bps`, and `increment_dropped` are never used [INFO] [stdout] --> src/flow_analyzer/metrics.rs:42:12 [INFO] [stdout] | [INFO] [stdout] 19 | impl Metrics { [INFO] [stdout] | ------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 42 | pub fn increment_pps(&self) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 47 | pub fn increment_bps(&self, bytes: u64) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 52 | pub fn increment_dropped(&self) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `byte_count` is never read [INFO] [stdout] --> src/flow_analyzer/analyzer.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 8 | pub struct IPStats { [INFO] [stdout] | ------- field in this struct [INFO] [stdout] 9 | pub packet_count: u64, // 数据包数量 [INFO] [stdout] 10 | pub byte_count: u64, // 字节数 [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `IPStats` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `cleanup_interval` is never read [INFO] [stdout] --> src/flow_analyzer/analyzer.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 29 | pub struct Analyzer { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 33 | pub cleanup_interval: u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `update`, `get_ip_packet_rate`, and `is_ip_blocked` are never used [INFO] [stdout] --> src/flow_analyzer/analyzer.rs:49:14 [INFO] [stdout] | [INFO] [stdout] 38 | impl Analyzer { [INFO] [stdout] | ------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 49 | pub async fn update(&self, ft: &FiveTuple, packet_size: u64) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 71 | pub async fn get_ip_packet_rate(&self, ip: &str) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 84 | pub async fn is_ip_blocked(&self, ip: &str) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `ip_protection` is never read [INFO] [stdout] --> src/protected_capture.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct PacketProcessor { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] 12 | ip_protection: Arc, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `process_packet` and `start_background_tasks` are never used [INFO] [stdout] --> src/protected_capture.rs:24:18 [INFO] [stdout] | [INFO] [stdout] 15 | impl PacketProcessor { [INFO] [stdout] | -------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 24 | pub async fn process_packet(&self, five_tuple: Option<&FiveTuple>, data: &[u8], metrics: &Metrics) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 77 | pub fn start_background_tasks(&self) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `name` is never read [INFO] [stdout] --> src/network_utils.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 8 | pub struct InterfaceInfo { [INFO] [stdout] | ------------- field in this struct [INFO] [stdout] 9 | pub name: String, // 接口名称(如"eth0") [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `InterfaceInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `now_ms` is never used [INFO] [stdout] --> src/utils.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn now_ms() -> u128 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `get_recommended_config` is never used [INFO] [stdout] --> src/ip_protection.rs:174:12 [INFO] [stdout] | [INFO] [stdout] 172 | impl ProtectionPolicy { [INFO] [stdout] | --------------------- method in this implementation [INFO] [stdout] 173 | /// 根据策略获取推荐的限流配置 [INFO] [stdout] 174 | pub fn get_recommended_config(&self) -> (u64, u64, Duration) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `ActiveCapture` is never used [INFO] [stdout] --> src/packet_capture/mod.rs:171:10 [INFO] [stdout] | [INFO] [stdout] 171 | pub type ActiveCapture = pcap::PcapCapture; // 开发环境:pcap实现(优先) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `enabled` is never read [INFO] [stdout] --> src/config.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct IPRateLimit { [INFO] [stdout] | ----------- field in this struct [INFO] [stdout] 11 | pub enabled: bool, // 是否启用IP限流 [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `IPRateLimit` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 47.90s [INFO] running `Command { std: "docker" "inspect" "e4756976c151a5c302549bcabd613c1c8f4125bade6f0d4bc904b9ec1f725040", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e4756976c151a5c302549bcabd613c1c8f4125bade6f0d4bc904b9ec1f725040", kill_on_drop: false }` [INFO] [stdout] e4756976c151a5c302549bcabd613c1c8f4125bade6f0d4bc904b9ec1f725040 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:e90291280db7d1fac5b66fc6dad9f9662629e7365a55743daf9bdf73ebc4ea79" "/opt/rustwide/cargo-home/bin/cargo" "+d79d87d4c0f7f0d0785ad6e493cf8cf718ed89a6" "test" "--frozen" "--no-run" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 81a7b1f51169e0aee41e22e5ee4b32c41ef106c86495acea84e239533f07ceb5 [INFO] running `Command { std: "docker" "start" "-a" "81a7b1f51169e0aee41e22e5ee4b32c41ef106c86495acea84e239533f07ceb5", kill_on_drop: false }` [INFO] [stderr] Compiling ddos_probe v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `std::time::Duration` [INFO] [stdout] --> src/config.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use std::time::Duration; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Capture` and `Error` [INFO] [stdout] --> src/packet_capture/mod.rs:21:18 [INFO] [stdout] | [INFO] [stdout] 21 | use ::pcap::{Capture, Error}; [INFO] [stdout] | ^^^^^^^ ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `tracing::log::warn` [INFO] [stdout] --> src/packet_capture/mod.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | use tracing::log::warn; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Ipv4Addr` [INFO] [stdout] --> src/rules_engine/rules.rs:3:24 [INFO] [stdout] | [INFO] [stdout] 3 | use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Ipv4Addr` [INFO] [stdout] --> src/rules_engine/limiter.rs:3:24 [INFO] [stdout] | [INFO] [stdout] 3 | use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::sync::Arc` [INFO] [stdout] --> src/rules_engine/limiter.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use std::sync::Arc; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> src/rules_engine/limiter.rs:6:17 [INFO] [stdout] | [INFO] [stdout] 6 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `anyhow::Result` [INFO] [stdout] --> src/metrics_service/ws_server.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | use anyhow::Result; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::io` [INFO] [stdout] --> src/protected_capture.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::io; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `tokio::task` [INFO] [stdout] --> src/protected_capture.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use tokio::task; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `info` and `warn` [INFO] [stdout] --> src/protected_capture.rs:4:29 [INFO] [stdout] | [INFO] [stdout] 4 | use tracing::{debug, error, info, warn}; [INFO] [stdout] | ^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `error` and `info` [INFO] [stdout] --> src/network_utils.rs:4:15 [INFO] [stdout] | [INFO] [stdout] 4 | use tracing::{error, info, warn}; [INFO] [stdout] | ^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::packet_capture::parser::parse_l3l4` [INFO] [stdout] --> src/main.rs:170:9 [INFO] [stdout] | [INFO] [stdout] 170 | use crate::packet_capture::parser::parse_l3l4; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated function `rand::thread_rng`: Renamed to `rng` [INFO] [stdout] --> src/utils.rs:10:21 [INFO] [stdout] | [INFO] [stdout] 10 | use rand::{Rng, thread_rng}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated function `rand::thread_rng`: Renamed to `rng` [INFO] [stdout] --> src/utils.rs:16:19 [INFO] [stdout] | [INFO] [stdout] 16 | let mut rng = thread_rng(); // 线程本地随机数生成器 [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `processor` [INFO] [stdout] --> src/main.rs:173:9 [INFO] [stdout] | [INFO] [stdout] 173 | let processor = PacketProcessor::new(ip_protection.clone()); [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_processor` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `consecutive_timeouts` [INFO] [stdout] --> src/packet_capture/mod.rs:62:21 [INFO] [stdout] | [INFO] [stdout] 62 | let mut consecutive_timeouts = 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_consecutive_timeouts` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `capture_ports_owned` [INFO] [stdout] --> src/packet_capture/mod.rs:60:52 [INFO] [stdout] | [INFO] [stdout] 60 | fn poll_batch(&mut self, metrics: &Metrics,capture_ports_owned: &Vec,) -> io::Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_capture_ports_owned` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/packet_capture/mod.rs:62:17 [INFO] [stdout] | [INFO] [stdout] 62 | let mut consecutive_timeouts = 0; [INFO] [stdout] | ----^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `enabled` is never read [INFO] [stdout] --> src/config.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct IPRateLimit { [INFO] [stdout] | ----------- field in this struct [INFO] [stdout] 11 | pub enabled: bool, // 是否启用IP限流 [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `IPRateLimit` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `now_ms` is never used [INFO] [stdout] --> src/utils.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | pub fn now_ms() -> u128 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `ActiveCapture` is never used [INFO] [stdout] --> src/packet_capture/mod.rs:171:10 [INFO] [stdout] | [INFO] [stdout] 171 | pub type ActiveCapture = pcap::PcapCapture; // 开发环境:pcap实现(优先) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `increment_pps`, `increment_bps`, and `increment_dropped` are never used [INFO] [stdout] --> src/flow_analyzer/metrics.rs:42:12 [INFO] [stdout] | [INFO] [stdout] 19 | impl Metrics { [INFO] [stdout] | ------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 42 | pub fn increment_pps(&self) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 47 | pub fn increment_bps(&self, bytes: u64) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 52 | pub fn increment_dropped(&self) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `byte_count` is never read [INFO] [stdout] --> src/flow_analyzer/analyzer.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 8 | pub struct IPStats { [INFO] [stdout] | ------- field in this struct [INFO] [stdout] 9 | pub packet_count: u64, // 数据包数量 [INFO] [stdout] 10 | pub byte_count: u64, // 字节数 [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `IPStats` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `cleanup_interval` is never read [INFO] [stdout] --> src/flow_analyzer/analyzer.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 29 | pub struct Analyzer { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 33 | pub cleanup_interval: u64, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `update`, `get_ip_packet_rate`, and `is_ip_blocked` are never used [INFO] [stdout] --> src/flow_analyzer/analyzer.rs:49:14 [INFO] [stdout] | [INFO] [stdout] 38 | impl Analyzer { [INFO] [stdout] | ------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 49 | pub async fn update(&self, ft: &FiveTuple, packet_size: u64) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 71 | pub async fn get_ip_packet_rate(&self, ip: &str) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 84 | pub async fn is_ip_blocked(&self, ip: &str) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `RuleSet` is never constructed [INFO] [stdout] --> src/rules_engine/rules.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct RuleSet { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple associated items are never used [INFO] [stdout] --> src/rules_engine/rules.rs:27:12 [INFO] [stdout] | [INFO] [stdout] 25 | impl RuleSet { [INFO] [stdout] | ------------ associated items in this implementation [INFO] [stdout] 26 | /// 创建一个新的空规则集 [INFO] [stdout] 27 | pub fn new() -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 39 | pub fn is_white(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 47 | pub fn is_black(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 55 | pub fn add_white(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 64 | pub fn remove_white(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 73 | pub fn add_black(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 82 | pub fn remove_black(&self, ip: IpAddr) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 91 | pub fn deny_tcp(&self, port: u16) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 96 | pub fn deny_udp(&self, port: u16) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 101 | pub fn add_deny_tcp_port_range(&mut self, start_port: u16, end_port: u16) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 106 | pub fn add_deny_udp_port_range(&mut self, start_port: u16, end_port: u16) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 111 | pub fn remove_deny_tcp_port_range(&mut self, start_port: u16, end_port: u16) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 116 | pub fn remove_deny_udp_port_range(&mut self, start_port: u16, end_port: u16) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static `RULESET` is never used [INFO] [stdout] --> src/rules_engine/rules.rs:122:12 [INFO] [stdout] | [INFO] [stdout] 122 | pub static RULESET: LazyLock> = LazyLock::new(|| { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ipv6_to_u128` is never used [INFO] [stdout] --> src/rules_engine/rules.rs:126:4 [INFO] [stdout] | [INFO] [stdout] 126 | fn ipv6_to_u128(ip: Ipv6Addr) -> u128 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `capacity`, `tokens`, and `rate_per_sec` are never read [INFO] [stdout] --> src/rules_engine/limiter.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 18 | struct Bucket { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 19 | capacity: u32, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 20 | tokens: u32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 21 | rate_per_sec: u32, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Bucket` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `refill`, and `try_consume` are never used [INFO] [stdout] --> src/rules_engine/limiter.rs:27:8 [INFO] [stdout] | [INFO] [stdout] 25 | impl Bucket { [INFO] [stdout] | ----------- associated items in this implementation [INFO] [stdout] 26 | #[inline] [INFO] [stdout] 27 | fn new(capacity: u32, rate_per_sec: u32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 32 | fn refill(&mut self) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 45 | fn try_consume(&mut self, n: u32) -> bool { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `default_capacity`, `default_rate`, and `cleanup_interval` are never read [INFO] [stdout] --> src/rules_engine/limiter.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 52 | pub struct IPRateLimiter { [INFO] [stdout] | ------------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 55 | default_capacity: u64, // 保持与原有接口兼容 [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 56 | default_rate: u64, // 保持与原有接口兼容 [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] 57 | inactive_timeout_ms: u64, [INFO] [stdout] 58 | cleanup_interval: u64, // 保持与原有接口兼容 [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `check`, `set_ip_limit`, `remove_ip_limit`, `check_with_params`, `check_v4`, and `check_v6` are never used [INFO] [stdout] --> src/rules_engine/limiter.rs:75:18 [INFO] [stdout] | [INFO] [stdout] 61 | impl IPRateLimiter { [INFO] [stdout] | ------------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 75 | pub async fn check(&self, ip: &str, tokens: u64) -> bool { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 91 | pub async fn set_ip_limit(&self, ip: &str, capacity: u64, rate: u64) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 104 | pub async fn remove_ip_limit(&self, ip: &str) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 122 | fn check_with_params(&self, ip: IpAddr, tokens: u32, capacity: u32, rate: u32) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 131 | fn check_v4(&self, ip_u32: u32, tokens: u32, capacity: u32, rate: u32) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 146 | fn check_v6(&self, ip_u128: u128, tokens: u32, capacity: u32, rate: u32) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ipv6_to_u128` is never used [INFO] [stdout] --> src/rules_engine/limiter.rs:162:8 [INFO] [stdout] | [INFO] [stdout] 162 | pub fn ipv6_to_u128(ip: Ipv6Addr) -> u128 { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ip_str_to_addr` is never used [INFO] [stdout] --> src/rules_engine/limiter.rs:175:8 [INFO] [stdout] | [INFO] [stdout] 175 | pub fn ip_str_to_addr(s: &str) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `IPProtectionResult` is never used [INFO] [stdout] --> src/ip_protection.rs:11:10 [INFO] [stdout] | [INFO] [stdout] 11 | pub enum IPProtectionResult { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `metrics` is never read [INFO] [stdout] --> src/ip_protection.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 19 | pub struct IPProtectionService { [INFO] [stdout] | ------------------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 22 | metrics: Arc, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `handle_packet`, `manually_block_ip`, `unblock_ip`, and `set_ip_threshold` are never used [INFO] [stdout] --> src/ip_protection.rs:81:18 [INFO] [stdout] | [INFO] [stdout] 26 | impl IPProtectionService { [INFO] [stdout] | ------------------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 81 | pub async fn handle_packet(&self, ft: &FiveTuple, packet_size: u64) -> IPProtectionResult { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 143 | pub async fn manually_block_ip(&self, ip: &str, duration: Duration) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 149 | pub async fn unblock_ip(&self, ip: &str) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 158 | pub async fn set_ip_threshold(&self, ip: &str, threshold: u64) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `ProtectionPolicy` is never used [INFO] [stdout] --> src/ip_protection.rs:166:10 [INFO] [stdout] | [INFO] [stdout] 166 | pub enum ProtectionPolicy { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `get_recommended_config` is never used [INFO] [stdout] --> src/ip_protection.rs:174:12 [INFO] [stdout] | [INFO] [stdout] 172 | impl ProtectionPolicy { [INFO] [stdout] | --------------------- method in this implementation [INFO] [stdout] 173 | /// 根据策略获取推荐的限流配置 [INFO] [stdout] 174 | pub fn get_recommended_config(&self) -> (u64, u64, Duration) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `forward_packet` is never used [INFO] [stdout] --> src/mitigation/forwarder.rs:2:8 [INFO] [stdout] | [INFO] [stdout] 2 | pub fn forward_packet(_packet: &[u8]) { /* 占位:AF_XDP/DPDK 实现时执行转发 */ } [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `MetricsDto` is never constructed [INFO] [stdout] --> src/metrics_service/metrics_data.rs:5:12 [INFO] [stdout] | [INFO] [stdout] 5 | pub struct MetricsDto { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `ip_protection` is never read [INFO] [stdout] --> src/protected_capture.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct PacketProcessor { [INFO] [stdout] | --------------- field in this struct [INFO] [stdout] 12 | ip_protection: Arc, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `process_packet` and `start_background_tasks` are never used [INFO] [stdout] --> src/protected_capture.rs:24:18 [INFO] [stdout] | [INFO] [stdout] 15 | impl PacketProcessor { [INFO] [stdout] | -------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 24 | pub async fn process_packet(&self, five_tuple: Option<&FiveTuple>, data: &[u8], metrics: &Metrics) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 77 | pub fn start_background_tasks(&self) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `drop_packet` is never used [INFO] [stdout] --> src/mitigation/dropper.rs:2:8 [INFO] [stdout] | [INFO] [stdout] 2 | pub fn drop_packet(_packet: &[u8]) { /* 占位:AF_XDP/DPDK 实现时执行丢弃 */ } [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `name` is never read [INFO] [stdout] --> src/network_utils.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 8 | pub struct InterfaceInfo { [INFO] [stdout] | ------------- field in this struct [INFO] [stdout] 9 | pub name: String, // 接口名称(如"eth0") [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `InterfaceInfo` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `test` profile [unoptimized + debuginfo] target(s) in 3.02s [INFO] running `Command { std: "docker" "inspect" "81a7b1f51169e0aee41e22e5ee4b32c41ef106c86495acea84e239533f07ceb5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "81a7b1f51169e0aee41e22e5ee4b32c41ef106c86495acea84e239533f07ceb5", kill_on_drop: false }` [INFO] [stdout] 81a7b1f51169e0aee41e22e5ee4b32c41ef106c86495acea84e239533f07ceb5