[INFO] cloning repository https://github.com/qianlvzhe/translation-cli [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/qianlvzhe/translation-cli" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fqianlvzhe%2Ftranslation-cli", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fqianlvzhe%2Ftranslation-cli'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] ce3a049ba2e475af4294912dbb26327ef8a8ecb5 [INFO] testing qianlvzhe/translation-cli against master#ad85bc524b1ad696e42061ad8338d382dffbdbe5 for pr-146237 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fqianlvzhe%2Ftranslation-cli" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/qianlvzhe/translation-cli [INFO] finished tweaking git repo https://github.com/qianlvzhe/translation-cli [INFO] tweaked toml for git repo https://github.com/qianlvzhe/translation-cli written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/qianlvzhe/translation-cli on toolchain ad85bc524b1ad696e42061ad8338d382dffbdbe5 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+ad85bc524b1ad696e42061ad8338d382dffbdbe5" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/qianlvzhe/translation-cli 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" "+ad85bc524b1ad696e42061ad8338d382dffbdbe5" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded markup5ever v0.13.0 [INFO] [stderr] Downloaded match_token v0.35.0 [INFO] [stderr] Downloaded compression-core v0.4.28 [INFO] [stderr] Downloaded markup5ever v0.35.0 [INFO] [stderr] Downloaded phf_macros v0.11.3 [INFO] [stderr] Downloaded dtoa-short v0.3.5 [INFO] [stderr] Downloaded compression-codecs v0.4.28 [INFO] [stderr] Downloaded cssparser v0.35.0 [INFO] [stderr] Downloaded clap v4.5.45 [INFO] [stderr] Downloaded html5ever v0.35.0 [INFO] [stderr] Downloaded html5ever v0.28.0 [INFO] [stderr] Downloaded async-compression v0.4.28 [INFO] [stderr] Downloaded web_atoms v0.1.3 [INFO] [stderr] Downloaded xml5ever v0.35.0 [INFO] [stderr] Downloaded markup5ever_rcdom v0.4.0-unofficial [INFO] [stderr] Downloaded clap_builder v4.5.44 [INFO] [stderr] Downloaded xml5ever v0.19.0 [INFO] [stderr] Downloaded monolith v2.10.1 [INFO] [stderr] Downloaded markup5ever_rcdom v0.35.0+unofficial [INFO] [stderr] Downloaded redb v2.6.3 [INFO] [stderr] Downloaded brotli v8.0.2 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/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" "+ad85bc524b1ad696e42061ad8338d382dffbdbe5" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] e9e718b581fc8783c64245cab0b59d8393e69cfd0dd62f383f7f133bf17f4c40 [INFO] running `Command { std: "docker" "start" "-a" "e9e718b581fc8783c64245cab0b59d8393e69cfd0dd62f383f7f133bf17f4c40", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "e9e718b581fc8783c64245cab0b59d8393e69cfd0dd62f383f7f133bf17f4c40", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e9e718b581fc8783c64245cab0b59d8393e69cfd0dd62f383f7f133bf17f4c40", kill_on_drop: false }` [INFO] [stdout] e9e718b581fc8783c64245cab0b59d8393e69cfd0dd62f383f7f133bf17f4c40 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/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" "+ad85bc524b1ad696e42061ad8338d382dffbdbe5" "build" "--frozen" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] d7686fce23dd63bb62e8a17994249598f630d37400ac5f82945d3544f3e3a07d [INFO] running `Command { std: "docker" "start" "-a" "d7686fce23dd63bb62e8a17994249598f630d37400ac5f82945d3544f3e3a07d", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.101 [INFO] [stderr] Compiling libc v0.2.175 [INFO] [stderr] Compiling smallvec v1.15.1 [INFO] [stderr] Compiling phf_shared v0.11.3 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling cc v1.2.34 [INFO] [stderr] Compiling tracing-core v0.1.34 [INFO] [stderr] Compiling http v1.3.1 [INFO] [stderr] Compiling bitflags v2.9.3 [INFO] [stderr] Compiling percent-encoding v2.3.2 [INFO] [stderr] Compiling openssl v0.10.73 [INFO] [stderr] Compiling indexmap v2.11.0 [INFO] [stderr] Compiling flate2 v1.1.2 [INFO] [stderr] Compiling brotli v8.0.2 [INFO] [stderr] Compiling compression-core v0.4.28 [INFO] [stderr] Compiling anstyle-parse v0.2.7 [INFO] [stderr] Compiling redb v2.6.3 [INFO] [stderr] Compiling anstyle v1.0.11 [INFO] [stderr] Compiling form_urlencoded v1.2.2 [INFO] [stderr] Compiling phf_generator v0.11.3 [INFO] [stderr] Compiling colorchoice v1.0.4 [INFO] [stderr] Compiling dtoa v1.0.10 [INFO] [stderr] Compiling anstyle-query v1.1.4 [INFO] [stderr] Compiling encoding_rs v0.8.35 [INFO] [stderr] Compiling dtoa-short v0.3.5 [INFO] [stderr] Compiling phf_codegen v0.11.3 [INFO] [stderr] Compiling clap_lex v0.7.5 [INFO] [stderr] Compiling anstream v0.6.20 [INFO] [stderr] Compiling sha2 v0.10.9 [INFO] [stderr] Compiling thread_local v1.1.9 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Compiling walkdir v2.5.0 [INFO] [stderr] Compiling tracing-log v0.2.0 [INFO] [stderr] Compiling syn v2.0.106 [INFO] [stderr] Compiling string_cache_codegen v0.5.4 [INFO] [stderr] Compiling clap_builder v4.5.44 [INFO] [stderr] Compiling tracing-subscriber v0.3.19 [INFO] [stderr] Compiling http-body v1.0.1 [INFO] [stderr] Compiling http-body-util v0.1.3 [INFO] [stderr] Compiling parking_lot_core v0.9.11 [INFO] [stderr] Compiling signal-hook-registry v1.4.6 [INFO] [stderr] Compiling mio v1.0.4 [INFO] [stderr] Compiling socket2 v0.6.0 [INFO] [stderr] Compiling atty v0.2.14 [INFO] [stderr] Compiling markup5ever v0.13.0 [INFO] [stderr] Compiling web_atoms v0.1.3 [INFO] [stderr] Compiling openssl-sys v0.9.109 [INFO] [stderr] Compiling parking_lot v0.12.4 [INFO] [stderr] Compiling native-tls v0.2.14 [INFO] [stderr] Compiling string_cache v0.8.9 [INFO] [stderr] Compiling serde_json v1.0.143 [INFO] [stderr] Compiling serde_urlencoded v0.7.1 [INFO] [stderr] Compiling chrono v0.4.41 [INFO] [stderr] Compiling compression-codecs v0.4.28 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling zerovec-derive v0.11.1 [INFO] [stderr] Compiling phf_macros v0.11.3 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling tracing-attributes v0.1.30 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling html5ever v0.28.0 [INFO] [stderr] Compiling cssparser-macros v0.6.1 [INFO] [stderr] Compiling match_token v0.35.0 [INFO] [stderr] Compiling clap_derive v4.5.45 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.0 [INFO] [stderr] Compiling phf v0.11.3 [INFO] [stderr] Compiling cssparser v0.35.0 [INFO] [stderr] Compiling tokio v1.47.1 [INFO] [stderr] Compiling tracing v0.1.41 [INFO] [stderr] Compiling futures-util v0.3.31 [INFO] [stderr] Compiling markup5ever v0.35.0 [INFO] [stderr] Compiling html5ever v0.35.0 [INFO] [stderr] Compiling xml5ever v0.35.0 [INFO] [stderr] Compiling zerofrom v0.1.6 [INFO] [stderr] Compiling yoke v0.8.0 [INFO] [stderr] Compiling xml5ever v0.19.0 [INFO] [stderr] Compiling zerotrie v0.2.2 [INFO] [stderr] Compiling zerovec v0.11.4 [INFO] [stderr] Compiling markup5ever_rcdom v0.35.0+unofficial [INFO] [stderr] Compiling markup5ever_rcdom v0.4.0-unofficial [INFO] [stderr] Compiling clap v4.5.45 [INFO] [stderr] Compiling tinystr v0.8.1 [INFO] [stderr] Compiling potential_utf v0.1.2 [INFO] [stderr] Compiling icu_collections v2.0.0 [INFO] [stderr] Compiling icu_locale_core v2.0.0 [INFO] [stderr] Compiling icu_provider v2.0.0 [INFO] [stderr] Compiling futures-executor v0.3.31 [INFO] [stderr] Compiling icu_properties v2.0.1 [INFO] [stderr] Compiling icu_normalizer v2.0.0 [INFO] [stderr] Compiling futures v0.3.31 [INFO] [stderr] Compiling idna_adapter v1.2.1 [INFO] [stderr] Compiling idna v1.1.0 [INFO] [stderr] Compiling tokio-util v0.7.16 [INFO] [stderr] Compiling tower v0.5.2 [INFO] [stderr] Compiling tokio-native-tls v0.3.1 [INFO] [stderr] Compiling async-compression v0.4.28 [INFO] [stderr] Compiling url v2.5.6 [INFO] [stderr] Compiling tower-http v0.6.6 [INFO] [stderr] Compiling h2 v0.4.12 [INFO] [stderr] Compiling hyper v1.7.0 [INFO] [stderr] Compiling hyper-util v0.1.16 [INFO] [stderr] Compiling hyper-tls v0.6.0 [INFO] [stderr] Compiling reqwest v0.12.23 [INFO] [stderr] Compiling monolith v2.10.1 [INFO] [stderr] Compiling translation-cli v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `error::TranslationError` [INFO] [stdout] --> src/main.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | use error::TranslationError; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `is_valid_api_url` is never used [INFO] [stdout] --> src/api_constants.rs:118:8 [INFO] [stdout] | [INFO] [stdout] 118 | pub fn is_valid_api_url(url: &str) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `is_supported_language` is never used [INFO] [stdout] --> src/api_constants.rs:123:8 [INFO] [stdout] | [INFO] [stdout] 123 | pub fn is_supported_language(lang: &str) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `BACKUP_API_URLS` is never used [INFO] [stdout] --> src/api_constants.rs:14:15 [INFO] [stdout] | [INFO] [stdout] 14 | pub const BACKUP_API_URLS: &[&str] = &[ [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEFAULT_TARGET_LANG` is never used [INFO] [stdout] --> src/api_constants.rs:24:15 [INFO] [stdout] | [INFO] [stdout] 24 | pub const DEFAULT_TARGET_LANG: &str = "zh"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `SUPPORTED_LANGUAGES` is never used [INFO] [stdout] --> src/api_constants.rs:27:15 [INFO] [stdout] | [INFO] [stdout] 27 | pub const SUPPORTED_LANGUAGES: &[&str] = &[ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEFAULT_MAX_RETRIES` is never used [INFO] [stdout] --> src/api_constants.rs:41:15 [INFO] [stdout] | [INFO] [stdout] 41 | pub const DEFAULT_MAX_RETRIES: usize = 3; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEFAULT_CONCURRENT_BATCHES` is never used [INFO] [stdout] --> src/api_constants.rs:44:15 [INFO] [stdout] | [INFO] [stdout] 44 | pub const DEFAULT_CONCURRENT_BATCHES: usize = 5; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `REQUEST_TIMEOUT_SECONDS` is never used [INFO] [stdout] --> src/api_constants.rs:47:15 [INFO] [stdout] | [INFO] [stdout] 47 | pub const REQUEST_TIMEOUT_SECONDS: u64 = 30; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEFAULT_CRAWL_TIMEOUT` is never used [INFO] [stdout] --> src/api_constants.rs:53:15 [INFO] [stdout] | [INFO] [stdout] 53 | pub const DEFAULT_CRAWL_TIMEOUT: u64 = 30; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEFAULT_USER_AGENT` is never used [INFO] [stdout] --> src/api_constants.rs:56:15 [INFO] [stdout] | [INFO] [stdout] 56 | pub const DEFAULT_USER_AGENT: &str = "Mozilla/5.0 (compatible; TranslationCLI/0.2.0; +https://github.com/translation-cli)"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MAX_CRAWL_RETRIES` is never used [INFO] [stdout] --> src/api_constants.rs:59:15 [INFO] [stdout] | [INFO] [stdout] 59 | pub const MAX_CRAWL_RETRIES: usize = 3; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `RETRY_DELAY_BASE_MS` is never used [INFO] [stdout] --> src/api_constants.rs:62:15 [INFO] [stdout] | [INFO] [stdout] 62 | pub const RETRY_DELAY_BASE_MS: u64 = 1000; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MAX_PAGE_SIZE_BYTES` is never used [INFO] [stdout] --> src/api_constants.rs:65:15 [INFO] [stdout] | [INFO] [stdout] 65 | pub const MAX_PAGE_SIZE_BYTES: usize = 50 * 1024 * 1024; // 50MB [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `NETWORK_ERROR` is never used [INFO] [stdout] --> src/api_constants.rs:71:15 [INFO] [stdout] | [INFO] [stdout] 71 | pub const NETWORK_ERROR: &str = "网络连接失败,请检查网络连接或API地址"; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `AUTH_ERROR` is never used [INFO] [stdout] --> src/api_constants.rs:74:15 [INFO] [stdout] | [INFO] [stdout] 74 | pub const AUTH_ERROR: &str = "API认证失败,请检查API密钥或令牌"; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `UNSUPPORTED_LANGUAGE` is never used [INFO] [stdout] --> src/api_constants.rs:77:15 [INFO] [stdout] | [INFO] [stdout] 77 | pub const UNSUPPORTED_LANGUAGE: &str = "不支持的目标语言"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `FILE_READ_ERROR` is never used [INFO] [stdout] --> src/api_constants.rs:80:15 [INFO] [stdout] | [INFO] [stdout] 80 | pub const FILE_READ_ERROR: &str = "无法读取输入文件"; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `FILE_WRITE_ERROR` is never used [INFO] [stdout] --> src/api_constants.rs:83:15 [INFO] [stdout] | [INFO] [stdout] 83 | pub const FILE_WRITE_ERROR: &str = "无法写入输出文件"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `HTML_PARSE_ERROR` is never used [INFO] [stdout] --> src/api_constants.rs:86:15 [INFO] [stdout] | [INFO] [stdout] 86 | pub const HTML_PARSE_ERROR: &str = "HTML内容解析失败"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `SUB_SECOND_TARGET_MS` is never used [INFO] [stdout] --> src/api_constants.rs:92:15 [INFO] [stdout] | [INFO] [stdout] 92 | pub const SUB_SECOND_TARGET_MS: u128 = 1000; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MEMORY_WARNING_THRESHOLD_BYTES` is never used [INFO] [stdout] --> src/api_constants.rs:95:15 [INFO] [stdout] | [INFO] [stdout] 95 | pub const MEMORY_WARNING_THRESHOLD_BYTES: usize = 100 * 1024 * 1024; // 100MB [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MAX_CONCURRENT_CONNECTIONS` is never used [INFO] [stdout] --> src/api_constants.rs:98:15 [INFO] [stdout] | [INFO] [stdout] 98 | pub const MAX_CONCURRENT_CONNECTIONS: usize = 10; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `target_lang`, `api_url`, `batch_size`, `max_retries`, and `is_cache_enabled` are never used [INFO] [stdout] --> src/config.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 44 | impl LocalTranslationConfig { [INFO] [stdout] | --------------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 64 | pub fn target_lang(&self) -> &str { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 69 | pub fn api_url(&self) -> &str { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 74 | pub fn batch_size(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 79 | pub fn max_retries(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 84 | pub fn is_cache_enabled(&self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `TranslationError` is never used [INFO] [stdout] --> src/error.rs:15:10 [INFO] [stdout] | [INFO] [stdout] 15 | pub enum TranslationError { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `Result` is never used [INFO] [stdout] --> src/error.rs:126:10 [INFO] [stdout] | [INFO] [stdout] 126 | pub type Result = std::result::Result; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `validate_input_file` is never used [INFO] [stdout] --> src/utils.rs:117:8 [INFO] [stdout] | [INFO] [stdout] 117 | pub fn validate_input_file(path: &PathBuf) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `calculate_content_hash` is never used [INFO] [stdout] --> src/utils.rs:223:8 [INFO] [stdout] | [INFO] [stdout] 223 | pub fn calculate_content_hash(content: &str) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `output_to` and `user_agent` are never used [INFO] [stdout] --> src/web_crawler.rs:159:12 [INFO] [stdout] | [INFO] [stdout] 63 | impl WebCrawler { [INFO] [stdout] | --------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 159 | pub fn output_to>(mut self, path: P) -> Self { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 173 | pub fn user_agent(mut self, user_agent: &str) -> Self { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `crawl_url_to_file` is never used [INFO] [stdout] --> src/web_crawler.rs:279:14 [INFO] [stdout] | [INFO] [stdout] 279 | pub async fn crawl_url_to_file>( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `crawl_url_to_string` is never used [INFO] [stdout] --> src/web_crawler.rs:289:14 [INFO] [stdout] | [INFO] [stdout] 289 | pub async fn crawl_url_to_string(url: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple methods are never used [INFO] [stdout] --> src/temp_manager.rs:93:12 [INFO] [stdout] | [INFO] [stdout] 50 | impl TempManager { [INFO] [stdout] | ---------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 93 | pub fn create_temp_dir(&mut self, name: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 123 | pub fn copy_to_temp>(&mut self, source_path: P, suffix: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 143 | pub fn move_to_temp>(&mut self, source_path: P, suffix: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 188 | pub fn get_work_dir(&mut self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 194 | pub fn list_temp_files(&self) -> &[PathBuf] { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 199 | pub fn list_temp_dirs(&self) -> &[PathBuf] { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 204 | pub fn cleanup_file>(&mut self, path: P) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 220 | pub fn cleanup_dir>(&mut self, path: P) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `create_temp_file_with_content` is never used [INFO] [stdout] --> src/temp_manager.rs:325:8 [INFO] [stdout] | [INFO] [stdout] 325 | pub fn create_temp_file_with_content(content: &str, suffix: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `create_temp_work_dir` is never used [INFO] [stdout] --> src/temp_manager.rs:331:8 [INFO] [stdout] | [INFO] [stdout] 331 | pub fn create_temp_work_dir() -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 13s [INFO] running `Command { std: "docker" "inspect" "d7686fce23dd63bb62e8a17994249598f630d37400ac5f82945d3544f3e3a07d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d7686fce23dd63bb62e8a17994249598f630d37400ac5f82945d3544f3e3a07d", kill_on_drop: false }` [INFO] [stdout] d7686fce23dd63bb62e8a17994249598f630d37400ac5f82945d3544f3e3a07d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/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" "+ad85bc524b1ad696e42061ad8338d382dffbdbe5" "test" "--frozen" "--no-run" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 8f728341db3c4a75ffa2b26931a045d959c6394856811f7d8c22364396cbc04e [INFO] running `Command { std: "docker" "start" "-a" "8f728341db3c4a75ffa2b26931a045d959c6394856811f7d8c22364396cbc04e", kill_on_drop: false }` [INFO] [stderr] Compiling translation-cli v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `error::TranslationError` [INFO] [stdout] --> src/main.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | use error::TranslationError; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `BACKUP_API_URLS` is never used [INFO] [stdout] --> src/api_constants.rs:14:15 [INFO] [stdout] | [INFO] [stdout] 14 | pub const BACKUP_API_URLS: &[&str] = &[ [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEFAULT_TARGET_LANG` is never used [INFO] [stdout] --> src/api_constants.rs:24:15 [INFO] [stdout] | [INFO] [stdout] 24 | pub const DEFAULT_TARGET_LANG: &str = "zh"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEFAULT_MAX_RETRIES` is never used [INFO] [stdout] --> src/api_constants.rs:41:15 [INFO] [stdout] | [INFO] [stdout] 41 | pub const DEFAULT_MAX_RETRIES: usize = 3; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEFAULT_CONCURRENT_BATCHES` is never used [INFO] [stdout] --> src/api_constants.rs:44:15 [INFO] [stdout] | [INFO] [stdout] 44 | pub const DEFAULT_CONCURRENT_BATCHES: usize = 5; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `REQUEST_TIMEOUT_SECONDS` is never used [INFO] [stdout] --> src/api_constants.rs:47:15 [INFO] [stdout] | [INFO] [stdout] 47 | pub const REQUEST_TIMEOUT_SECONDS: u64 = 30; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEFAULT_CRAWL_TIMEOUT` is never used [INFO] [stdout] --> src/api_constants.rs:53:15 [INFO] [stdout] | [INFO] [stdout] 53 | pub const DEFAULT_CRAWL_TIMEOUT: u64 = 30; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `DEFAULT_USER_AGENT` is never used [INFO] [stdout] --> src/api_constants.rs:56:15 [INFO] [stdout] | [INFO] [stdout] 56 | pub const DEFAULT_USER_AGENT: &str = "Mozilla/5.0 (compatible; TranslationCLI/0.2.0; +https://github.com/translation-cli)"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MAX_CRAWL_RETRIES` is never used [INFO] [stdout] --> src/api_constants.rs:59:15 [INFO] [stdout] | [INFO] [stdout] 59 | pub const MAX_CRAWL_RETRIES: usize = 3; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `RETRY_DELAY_BASE_MS` is never used [INFO] [stdout] --> src/api_constants.rs:62:15 [INFO] [stdout] | [INFO] [stdout] 62 | pub const RETRY_DELAY_BASE_MS: u64 = 1000; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MAX_PAGE_SIZE_BYTES` is never used [INFO] [stdout] --> src/api_constants.rs:65:15 [INFO] [stdout] | [INFO] [stdout] 65 | pub const MAX_PAGE_SIZE_BYTES: usize = 50 * 1024 * 1024; // 50MB [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `NETWORK_ERROR` is never used [INFO] [stdout] --> src/api_constants.rs:71:15 [INFO] [stdout] | [INFO] [stdout] 71 | pub const NETWORK_ERROR: &str = "网络连接失败,请检查网络连接或API地址"; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `AUTH_ERROR` is never used [INFO] [stdout] --> src/api_constants.rs:74:15 [INFO] [stdout] | [INFO] [stdout] 74 | pub const AUTH_ERROR: &str = "API认证失败,请检查API密钥或令牌"; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `UNSUPPORTED_LANGUAGE` is never used [INFO] [stdout] --> src/api_constants.rs:77:15 [INFO] [stdout] | [INFO] [stdout] 77 | pub const UNSUPPORTED_LANGUAGE: &str = "不支持的目标语言"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `FILE_READ_ERROR` is never used [INFO] [stdout] --> src/api_constants.rs:80:15 [INFO] [stdout] | [INFO] [stdout] 80 | pub const FILE_READ_ERROR: &str = "无法读取输入文件"; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `FILE_WRITE_ERROR` is never used [INFO] [stdout] --> src/api_constants.rs:83:15 [INFO] [stdout] | [INFO] [stdout] 83 | pub const FILE_WRITE_ERROR: &str = "无法写入输出文件"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `HTML_PARSE_ERROR` is never used [INFO] [stdout] --> src/api_constants.rs:86:15 [INFO] [stdout] | [INFO] [stdout] 86 | pub const HTML_PARSE_ERROR: &str = "HTML内容解析失败"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `SUB_SECOND_TARGET_MS` is never used [INFO] [stdout] --> src/api_constants.rs:92:15 [INFO] [stdout] | [INFO] [stdout] 92 | pub const SUB_SECOND_TARGET_MS: u128 = 1000; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MEMORY_WARNING_THRESHOLD_BYTES` is never used [INFO] [stdout] --> src/api_constants.rs:95:15 [INFO] [stdout] | [INFO] [stdout] 95 | pub const MEMORY_WARNING_THRESHOLD_BYTES: usize = 100 * 1024 * 1024; // 100MB [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constant `MAX_CONCURRENT_CONNECTIONS` is never used [INFO] [stdout] --> src/api_constants.rs:98:15 [INFO] [stdout] | [INFO] [stdout] 98 | pub const MAX_CONCURRENT_CONNECTIONS: usize = 10; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `target_lang`, `api_url`, `batch_size`, `max_retries`, and `is_cache_enabled` are never used [INFO] [stdout] --> src/config.rs:64:12 [INFO] [stdout] | [INFO] [stdout] 44 | impl LocalTranslationConfig { [INFO] [stdout] | --------------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 64 | pub fn target_lang(&self) -> &str { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 69 | pub fn api_url(&self) -> &str { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 74 | pub fn batch_size(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 79 | pub fn max_retries(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 84 | pub fn is_cache_enabled(&self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `HtmlParse`, `TranslationApi`, `Configuration`, `InputValidation`, and `TempFileManagement` are never constructed [INFO] [stdout] --> src/error.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 15 | pub enum TranslationError { [INFO] [stdout] | ---------------- variants in this enum [INFO] [stdout] ... [INFO] [stdout] 25 | HtmlParse { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 41 | TranslationApi { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 51 | Configuration { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 59 | InputValidation { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 67 | TempFileManagement { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TranslationError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `Result` is never used [INFO] [stdout] --> src/error.rs:126:10 [INFO] [stdout] | [INFO] [stdout] 126 | pub type Result = std::result::Result; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `validate_input_file` is never used [INFO] [stdout] --> src/utils.rs:117:8 [INFO] [stdout] | [INFO] [stdout] 117 | pub fn validate_input_file(path: &PathBuf) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `calculate_content_hash` is never used [INFO] [stdout] --> src/utils.rs:223:8 [INFO] [stdout] | [INFO] [stdout] 223 | pub fn calculate_content_hash(content: &str) -> u64 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `crawl_url_to_file` is never used [INFO] [stdout] --> src/web_crawler.rs:279:14 [INFO] [stdout] | [INFO] [stdout] 279 | pub async fn crawl_url_to_file>( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `crawl_url_to_string` is never used [INFO] [stdout] --> src/web_crawler.rs:289:14 [INFO] [stdout] | [INFO] [stdout] 289 | pub async fn crawl_url_to_string(url: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `test` profile [unoptimized + debuginfo] target(s) in 7.91s [INFO] running `Command { std: "docker" "inspect" "8f728341db3c4a75ffa2b26931a045d959c6394856811f7d8c22364396cbc04e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "8f728341db3c4a75ffa2b26931a045d959c6394856811f7d8c22364396cbc04e", kill_on_drop: false }` [INFO] [stdout] 8f728341db3c4a75ffa2b26931a045d959c6394856811f7d8c22364396cbc04e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/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" "+ad85bc524b1ad696e42061ad8338d382dffbdbe5" "test" "--frozen", kill_on_drop: false }` [INFO] [stdout] 1be7c3457fe25a3d72f269021d8fdc3a2bf52985efb192584823e1d4e886489e [INFO] running `Command { std: "docker" "start" "-a" "1be7c3457fe25a3d72f269021d8fdc3a2bf52985efb192584823e1d4e886489e", kill_on_drop: false }` [INFO] [stderr] warning: unused import: `error::TranslationError` [INFO] [stderr] --> src/main.rs:25:5 [INFO] [stderr] | [INFO] [stderr] 25 | use error::TranslationError; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stderr] [INFO] [stderr] warning: constant `BACKUP_API_URLS` is never used [INFO] [stderr] --> src/api_constants.rs:14:15 [INFO] [stderr] | [INFO] [stderr] 14 | pub const BACKUP_API_URLS: &[&str] = &[ [INFO] [stderr] | ^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stderr] [INFO] [stderr] warning: constant `DEFAULT_TARGET_LANG` is never used [INFO] [stderr] --> src/api_constants.rs:24:15 [INFO] [stderr] | [INFO] [stderr] 24 | pub const DEFAULT_TARGET_LANG: &str = "zh"; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `DEFAULT_MAX_RETRIES` is never used [INFO] [stderr] --> src/api_constants.rs:41:15 [INFO] [stderr] | [INFO] [stderr] 41 | pub const DEFAULT_MAX_RETRIES: usize = 3; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `DEFAULT_CONCURRENT_BATCHES` is never used [INFO] [stderr] --> src/api_constants.rs:44:15 [INFO] [stderr] | [INFO] [stderr] 44 | pub const DEFAULT_CONCURRENT_BATCHES: usize = 5; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `REQUEST_TIMEOUT_SECONDS` is never used [INFO] [stderr] --> src/api_constants.rs:47:15 [INFO] [stderr] | [INFO] [stderr] 47 | pub const REQUEST_TIMEOUT_SECONDS: u64 = 30; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `DEFAULT_CRAWL_TIMEOUT` is never used [INFO] [stderr] --> src/api_constants.rs:53:15 [INFO] [stderr] | [INFO] [stderr] 53 | pub const DEFAULT_CRAWL_TIMEOUT: u64 = 30; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `DEFAULT_USER_AGENT` is never used [INFO] [stderr] --> src/api_constants.rs:56:15 [INFO] [stderr] | [INFO] [stderr] 56 | pub const DEFAULT_USER_AGENT: &str = "Mozilla/5.0 (compatible; TranslationCLI/0.2.0; +https://github.com/translation-cli)"; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `MAX_CRAWL_RETRIES` is never used [INFO] [stderr] --> src/api_constants.rs:59:15 [INFO] [stderr] | [INFO] [stderr] 59 | pub const MAX_CRAWL_RETRIES: usize = 3; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `RETRY_DELAY_BASE_MS` is never used [INFO] [stderr] --> src/api_constants.rs:62:15 [INFO] [stderr] | [INFO] [stderr] 62 | pub const RETRY_DELAY_BASE_MS: u64 = 1000; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `MAX_PAGE_SIZE_BYTES` is never used [INFO] [stderr] --> src/api_constants.rs:65:15 [INFO] [stderr] | [INFO] [stderr] 65 | pub const MAX_PAGE_SIZE_BYTES: usize = 50 * 1024 * 1024; // 50MB [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `NETWORK_ERROR` is never used [INFO] [stderr] --> src/api_constants.rs:71:15 [INFO] [stderr] | [INFO] [stderr] 71 | pub const NETWORK_ERROR: &str = "网络连接失败,请检查网络连接或API地址"; [INFO] [stderr] | ^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `AUTH_ERROR` is never used [INFO] [stderr] --> src/api_constants.rs:74:15 [INFO] [stderr] | [INFO] [stderr] 74 | pub const AUTH_ERROR: &str = "API认证失败,请检查API密钥或令牌"; [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `UNSUPPORTED_LANGUAGE` is never used [INFO] [stderr] --> src/api_constants.rs:77:15 [INFO] [stderr] | [INFO] [stderr] 77 | pub const UNSUPPORTED_LANGUAGE: &str = "不支持的目标语言"; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `FILE_READ_ERROR` is never used [INFO] [stderr] --> src/api_constants.rs:80:15 [INFO] [stderr] | [INFO] [stderr] 80 | pub const FILE_READ_ERROR: &str = "无法读取输入文件"; [INFO] [stderr] | ^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `FILE_WRITE_ERROR` is never used [INFO] [stderr] --> src/api_constants.rs:83:15 [INFO] [stderr] | [INFO] [stderr] 83 | pub const FILE_WRITE_ERROR: &str = "无法写入输出文件"; [INFO] [stderr] | ^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `HTML_PARSE_ERROR` is never used [INFO] [stderr] --> src/api_constants.rs:86:15 [INFO] [stderr] | [INFO] [stderr] 86 | pub const HTML_PARSE_ERROR: &str = "HTML内容解析失败"; [INFO] [stderr] | ^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `SUB_SECOND_TARGET_MS` is never used [INFO] [stderr] --> src/api_constants.rs:92:15 [INFO] [stderr] | [INFO] [stderr] 92 | pub const SUB_SECOND_TARGET_MS: u128 = 1000; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `MEMORY_WARNING_THRESHOLD_BYTES` is never used [INFO] [stderr] --> src/api_constants.rs:95:15 [INFO] [stderr] | [INFO] [stderr] 95 | pub const MEMORY_WARNING_THRESHOLD_BYTES: usize = 100 * 1024 * 1024; // 100MB [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: constant `MAX_CONCURRENT_CONNECTIONS` is never used [INFO] [stderr] --> src/api_constants.rs:98:15 [INFO] [stderr] | [INFO] [stderr] 98 | pub const MAX_CONCURRENT_CONNECTIONS: usize = 10; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: methods `target_lang`, `api_url`, `batch_size`, `max_retries`, and `is_cache_enabled` are never used [INFO] [stderr] --> src/config.rs:64:12 [INFO] [stderr] | [INFO] [stderr] 44 | impl LocalTranslationConfig { [INFO] [stderr] | --------------------------- methods in this implementation [INFO] [stderr] ... [INFO] [stderr] 64 | pub fn target_lang(&self) -> &str { [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 69 | pub fn api_url(&self) -> &str { [INFO] [stderr] | ^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 74 | pub fn batch_size(&self) -> usize { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 79 | pub fn max_retries(&self) -> usize { [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 84 | pub fn is_cache_enabled(&self) -> bool { [INFO] [stderr] | ^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: variants `HtmlParse`, `TranslationApi`, `Configuration`, `InputValidation`, and `TempFileManagement` are never constructed [INFO] [stderr] --> src/error.rs:25:5 [INFO] [stderr] | [INFO] [stderr] 15 | pub enum TranslationError { [INFO] [stderr] | ---------------- variants in this enum [INFO] [stderr] ... [INFO] [stderr] 25 | HtmlParse { [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 41 | TranslationApi { [INFO] [stderr] | ^^^^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 51 | Configuration { [INFO] [stderr] | ^^^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 59 | InputValidation { [INFO] [stderr] | ^^^^^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 67 | TempFileManagement { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `TranslationError` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stderr] [INFO] [stderr] warning: type alias `Result` is never used [INFO] [stderr] --> src/error.rs:126:10 [INFO] [stderr] | [INFO] [stderr] 126 | pub type Result = std::result::Result; [INFO] [stderr] | ^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: function `validate_input_file` is never used [INFO] [stderr] --> src/utils.rs:117:8 [INFO] [stderr] | [INFO] [stderr] 117 | pub fn validate_input_file(path: &PathBuf) -> Result<()> { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: function `calculate_content_hash` is never used [INFO] [stderr] --> src/utils.rs:223:8 [INFO] [stderr] | [INFO] [stderr] 223 | pub fn calculate_content_hash(content: &str) -> u64 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: function `crawl_url_to_file` is never used [INFO] [stderr] --> src/web_crawler.rs:279:14 [INFO] [stderr] | [INFO] [stderr] 279 | pub async fn crawl_url_to_file>( [INFO] [stderr] | ^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: function `crawl_url_to_string` is never used [INFO] [stderr] --> src/web_crawler.rs:289:14 [INFO] [stderr] | [INFO] [stderr] 289 | pub async fn crawl_url_to_string(url: &str) -> Result { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: `translation-cli` (bin "translation-cli" test) generated 27 warnings (run `cargo fix --bin "translation-cli" --tests` to apply 1 suggestion) [INFO] [stderr] Finished `test` profile [unoptimized + debuginfo] target(s) in 0.43s [INFO] [stderr] Running unittests src/lib.rs (/opt/rustwide/target/debug/deps/translation_cli-1ec8ae990f0fd908) [INFO] [stdout] [INFO] [stdout] running 32 tests [INFO] [stdout] test api_constants::tests::test_api_url_selection ... ok [INFO] [stdout] test api_constants::tests::test_language_validation ... ok [INFO] [stdout] test error::tests::test_error_display ... ok [INFO] [stdout] test error::tests::test_error_macro ... ok [INFO] [stdout] test api_constants::tests::test_api_url_validation ... ok [INFO] [stdout] test temp_manager::tests::test_auto_cleanup_on_drop ... ok [INFO] [stdout] test temp_manager::tests::test_cleanup_all ... ok [INFO] [stdout] test temp_manager::tests::test_write_temp_file ... ok [INFO] [stdout] test temp_manager::tests::test_copy_to_temp ... ok [INFO] [stdout] test web_crawler::tests::test_crawl_invalid_url ... ok [INFO] [stdout] test temp_manager::tests::test_create_temp_html_from_crawl ... ok [INFO] [stdout] test temp_manager::tests::test_convenience_functions ... ok [INFO] [stdout] test web_crawler::tests::test_generate_default_output_path ... ok [INFO] [stdout] test temp_manager::tests::test_get_work_dir ... ok [INFO] [stdout] test web_crawler::tests::test_generate_default_output_path_root ... ok [INFO] [stdout] test temp_manager::tests::test_create_temp_html ... ok [INFO] [stdout] test web_crawler::tests::test_output_path_preparation ... ok [INFO] [stdout] test api_constants::tests::test_batch_size_selection ... ok [INFO] [stdout] test web_crawler::tests::test_url_validation ... ok [INFO] [stdout] test temp_manager::tests::test_temp_dir_creation_and_cleanup ... ok [INFO] [stdout] test web_crawler::tests::test_web_crawler_builder ... ok [INFO] [stdout] test web_crawler::tests::test_web_crawler_config_default ... ok [INFO] [stdout] test temp_manager::tests::test_temp_manager_creation ... ok [INFO] [stdout] test temp_manager::tests::test_file_limit ... ok [INFO] [stdout] test temp_manager::tests::test_unique_id_generation ... ok [INFO] [stdout] test temp_manager::tests::test_move_to_temp ... ok [INFO] [stdout] test temp_manager::tests::test_temp_file_creation_and_cleanup ... ok [INFO] [stdout] test temp_manager::tests::test_temp_manager_config_default ... ok [INFO] [stdout] test web_crawler::tests::test_crawl_workflow_components ... ok [INFO] [stdout] test web_crawler::tests::test_filename_sanitization ... ok [INFO] [stdout] test error::tests::test_anyhow_conversion ... ok [INFO] [stdout] test web_crawler::tests::test_crawl_nonexistent_domain ... ok [INFO] [stdout] [INFO] [stdout] test result: ok. 32 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.49s [INFO] [stdout] [INFO] [stderr] Running unittests src/main.rs (/opt/rustwide/target/debug/deps/translation_cli-30e8eb3129eaa7e4) [INFO] [stdout] [INFO] [stdout] running 32 tests [INFO] [stdout] test api_constants::tests::test_api_url_selection ... ok [INFO] [stdout] test api_constants::tests::test_api_url_validation ... ok [INFO] [stdout] test api_constants::tests::test_language_validation ... ok [INFO] [stdout] test error::tests::test_error_display ... ok [INFO] [stdout] test temp_manager::tests::test_temp_manager_config_default ... ok [INFO] [stdout] test error::tests::test_anyhow_conversion ... ok [INFO] [stdout] test temp_manager::tests::test_temp_manager_creation ... ok [INFO] [stdout] test temp_manager::tests::test_temp_file_creation_and_cleanup ... ok [INFO] [stdout] test temp_manager::tests::test_temp_dir_creation_and_cleanup ... ok [INFO] [stdout] test web_crawler::tests::test_crawl_workflow_components ... ok [INFO] [stdout] test temp_manager::tests::test_cleanup_all ... ok [INFO] [stdout] test temp_manager::tests::test_unique_id_generation ... ok [INFO] [stdout] test temp_manager::tests::test_file_limit ... ok [INFO] [stdout] test temp_manager::tests::test_get_work_dir ... ok [INFO] [stdout] test web_crawler::tests::test_url_validation ... ok [INFO] [stdout] test web_crawler::tests::test_web_crawler_builder ... ok [INFO] [stdout] test web_crawler::tests::test_web_crawler_config_default ... ok [INFO] [stdout] test temp_manager::tests::test_auto_cleanup_on_drop ... ok [INFO] [stdout] test temp_manager::tests::test_create_temp_html ... ok [INFO] [stdout] test temp_manager::tests::test_create_temp_html_from_crawl ... ok [INFO] [stdout] test temp_manager::tests::test_write_temp_file ... ok [INFO] [stdout] test temp_manager::tests::test_convenience_functions ... ok [INFO] [stdout] test web_crawler::tests::test_crawl_invalid_url ... ok [INFO] [stdout] test temp_manager::tests::test_move_to_temp ... ok [INFO] [stdout] test error::tests::test_error_macro ... ok [INFO] [stdout] test temp_manager::tests::test_copy_to_temp ... ok [INFO] [stdout] test web_crawler::tests::test_generate_default_output_path ... ok [INFO] [stdout] test web_crawler::tests::test_generate_default_output_path_root ... ok [INFO] [stdout] test web_crawler::tests::test_filename_sanitization ... ok [INFO] [stdout] test web_crawler::tests::test_output_path_preparation ... ok [INFO] [stdout] test api_constants::tests::test_batch_size_selection ... ok [INFO] [stdout] test web_crawler::tests::test_crawl_nonexistent_domain ... ok [INFO] [stdout] [INFO] [stdout] test result: ok. 32 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 6.45s [INFO] [stdout] [INFO] [stderr] Doc-tests translation_cli [INFO] [stdout] [INFO] [stdout] running 3 tests [INFO] [stdout] test src/translator.rs - translator::translate_with_indexed_mode (line 56) ... FAILED [INFO] [stdout] test src/utils.rs - utils::validate_input_source (line 77) ... FAILED [INFO] [stdout] test src/config.rs - config::LocalTranslationConfig (line 21) ... FAILED [INFO] [stdout] [INFO] [stdout] failures: [INFO] [stdout] [INFO] [stdout] ---- src/translator.rs - translator::translate_with_indexed_mode (line 56) stdout ---- [INFO] [stdout] error[E0728]: `await` is only allowed inside `async` functions and blocks [INFO] [stdout] --> src/translator.rs:66:3 [INFO] [stdout] | [INFO] [stdout] 4 | fn main() { #[allow(non_snake_case)] fn _doctest_main_src_translator_rs_56_0() { [INFO] [stdout] | ----------------------------------------- this is not `async` [INFO] [stdout] ... [INFO] [stdout] 13 | ).await?; [INFO] [stdout] | ^^^^^ only allowed inside `async` functions and blocks [INFO] [stdout] [INFO] [stdout] error: aborting due to 1 previous error [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0728`. [INFO] [stdout] Couldn't compile the test. [INFO] [stdout] ---- src/utils.rs - utils::validate_input_source (line 77) stdout ---- [INFO] [stdout] error[E0433]: failed to resolve: use of undeclared type `InputSource` [INFO] [stdout] --> src/utils.rs:84:5 [INFO] [stdout] | [INFO] [stdout] 10 | InputSource::Url(url) => println!("检测到URL: {}", url), [INFO] [stdout] | ^^^^^^^^^^^ use of undeclared type `InputSource` [INFO] [stdout] | [INFO] [stdout] help: consider importing this enum [INFO] [stdout] | [INFO] [stdout] 2 + use translation_cli::InputSource; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] error[E0433]: failed to resolve: use of undeclared type `InputSource` [INFO] [stdout] --> src/utils.rs:91:5 [INFO] [stdout] | [INFO] [stdout] 17 | InputSource::File(path) => println!("检测到文件: {}", path.display()), [INFO] [stdout] | ^^^^^^^^^^^ use of undeclared type `InputSource` [INFO] [stdout] | [INFO] [stdout] help: consider importing this enum [INFO] [stdout] | [INFO] [stdout] 2 + use translation_cli::InputSource; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] error: aborting due to 2 previous errors [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0433`. [INFO] [stdout] Couldn't compile the test. [INFO] [stdout] ---- src/config.rs - config::LocalTranslationConfig (line 21) stdout ---- [INFO] [stdout] error[E0061]: this method takes 0 arguments but 1 argument was supplied [INFO] [stdout] --> src/config.rs:27:6 [INFO] [stdout] | [INFO] [stdout] 9 | .api_url("http://localhost:1188/translate") [INFO] [stdout] | ^^^^^^^ --------------------------------- unexpected argument of type `&'static str` [INFO] [stdout] | [INFO] [stdout] note: method defined here [INFO] [stdout] --> /opt/rustwide/workdir/src/config.rs:69:12 [INFO] [stdout] | [INFO] [stdout] 69 | pub fn api_url(&self) -> &str { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] help: remove the extra argument [INFO] [stdout] | [INFO] [stdout] 9 - .api_url("http://localhost:1188/translate") [INFO] [stdout] 9 + .api_url() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] error[E0599]: no method named `batch_size` found for reference `&str` in the current scope [INFO] [stdout] --> src/config.rs:28:6 [INFO] [stdout] | [INFO] [stdout] 7 | let config = LocalTranslationConfig::new() [INFO] [stdout] | ----------------------------- [INFO] [stdout] | | [INFO] [stdout] | ______________method `batch_size` is available on `LocalTranslationConfig` [INFO] [stdout] | | [INFO] [stdout] 8 | | .target_language("zh") [INFO] [stdout] | | --------------------- method `batch_size` is available on `&LocalTranslationConfig` [INFO] [stdout] 9 | | .api_url("http://localhost:1188/translate") [INFO] [stdout] 10 | | .batch_size(50) [INFO] [stdout] | | -^^^^^^^^^^ method not found in `&str` [INFO] [stdout] | |_____| [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] error: aborting due to 2 previous errors [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0061, E0599. [INFO] [stdout] For more information about an error, try `rustc --explain E0061`. [INFO] [stdout] Couldn't compile the test. [INFO] [stdout] [INFO] [stdout] failures: [INFO] [stdout] src/config.rs - config::LocalTranslationConfig (line 21) [INFO] [stdout] src/translator.rs - translator::translate_with_indexed_mode (line 56) [INFO] [stdout] src/utils.rs - utils::validate_input_source (line 77) [INFO] [stdout] [INFO] [stdout] test result: FAILED. 0 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.36s [INFO] [stdout] [INFO] [stderr] error: doctest failed, to rerun pass `--doc` [INFO] running `Command { std: "docker" "inspect" "1be7c3457fe25a3d72f269021d8fdc3a2bf52985efb192584823e1d4e886489e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1be7c3457fe25a3d72f269021d8fdc3a2bf52985efb192584823e1d4e886489e", kill_on_drop: false }` [INFO] [stdout] 1be7c3457fe25a3d72f269021d8fdc3a2bf52985efb192584823e1d4e886489e