[INFO] cloning repository https://github.com/SparkByte-main/hush_demo [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/SparkByte-main/hush_demo" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FSparkByte-main%2Fhush_demo", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FSparkByte-main%2Fhush_demo'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] f06ecc37761cc7707b5b3af2c23479fa9007b75b [INFO] building SparkByte-main/hush_demo against master#ad85bc524b1ad696e42061ad8338d382dffbdbe5 for pr-146237-1 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FSparkByte-main%2Fhush_demo" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/SparkByte-main/hush_demo [INFO] finished tweaking git repo https://github.com/SparkByte-main/hush_demo [INFO] tweaked toml for git repo https://github.com/SparkByte-main/hush_demo written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/SparkByte-main/hush_demo 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/SparkByte-main/hush_demo 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 impl-more v0.1.9 [INFO] [stderr] Downloaded actix-server v2.6.0 [INFO] [stderr] Downloaded actix-service v2.0.3 [INFO] [stderr] Downloaded bytestring v1.4.0 [INFO] [stderr] Downloaded zstd v0.13.3 [INFO] [stderr] Downloaded zstd-safe v7.2.4 [INFO] [stderr] Downloaded actix-web v4.11.0 [INFO] [stderr] Downloaded derive_more-impl v2.0.1 [INFO] [stderr] Downloaded derive_more v2.0.1 [INFO] [stderr] Downloaded actix-http v3.11.0 [INFO] [stderr] Downloaded io-uring v0.7.9 [INFO] [stderr] Downloaded zstd-sys v2.0.15+zstd.1.5.7 [INFO] [stderr] Downloaded brotli-decompressor v5.0.0 [INFO] [stderr] Downloaded brotli v8.0.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 4ca69cc8cbf90eaa125f9d47bd2fbeba2aa1db2645ade9ce6b0e2b893da9c2e6 [INFO] running `Command { std: "docker" "start" "-a" "4ca69cc8cbf90eaa125f9d47bd2fbeba2aa1db2645ade9ce6b0e2b893da9c2e6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "4ca69cc8cbf90eaa125f9d47bd2fbeba2aa1db2645ade9ce6b0e2b893da9c2e6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4ca69cc8cbf90eaa125f9d47bd2fbeba2aa1db2645ade9ce6b0e2b893da9c2e6", kill_on_drop: false }` [INFO] [stdout] 4ca69cc8cbf90eaa125f9d47bd2fbeba2aa1db2645ade9ce6b0e2b893da9c2e6 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 1252ba50f05cffbd6e1209d9d3e2b9318cc4d4f23f67da7edad70f1566d5c888 [INFO] running `Command { std: "docker" "start" "-a" "1252ba50f05cffbd6e1209d9d3e2b9318cc4d4f23f67da7edad70f1566d5c888", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.95 [INFO] [stderr] Compiling unicode-ident v1.0.18 [INFO] [stderr] Compiling libc v0.2.174 [INFO] [stderr] Compiling cfg-if v1.0.1 [INFO] [stderr] Compiling pin-project-lite v0.2.16 [INFO] [stderr] Compiling smallvec v1.15.1 [INFO] [stderr] Compiling log v0.4.27 [INFO] [stderr] Compiling stable_deref_trait v1.2.0 [INFO] [stderr] Compiling autocfg v1.5.0 [INFO] [stderr] Compiling bytes v1.10.1 [INFO] [stderr] Compiling parking_lot_core v0.9.11 [INFO] [stderr] Compiling futures-core v0.3.31 [INFO] [stderr] Compiling itoa v1.0.15 [INFO] [stderr] Compiling typenum v1.18.0 [INFO] [stderr] Compiling litemap v0.8.0 [INFO] [stderr] Compiling once_cell v1.21.3 [INFO] [stderr] Compiling getrandom v0.3.3 [INFO] [stderr] Compiling writeable v0.6.1 [INFO] [stderr] Compiling lock_api v0.4.13 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Compiling memchr v2.7.5 [INFO] [stderr] Compiling pkg-config v0.3.32 [INFO] [stderr] Compiling tracing-core v0.1.34 [INFO] [stderr] Compiling generic-array v0.14.7 [INFO] [stderr] Compiling icu_normalizer_data v2.0.0 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Compiling zerocopy v0.8.26 [INFO] [stderr] Compiling icu_properties_data v2.0.1 [INFO] [stderr] Compiling syn v2.0.104 [INFO] [stderr] Compiling futures-sink v0.3.31 [INFO] [stderr] Compiling futures-task v0.3.31 [INFO] [stderr] Compiling crc32fast v1.5.0 [INFO] [stderr] Compiling zstd-safe v7.2.4 [INFO] [stderr] Compiling jobserver v0.1.33 [INFO] [stderr] Compiling mio v1.0.4 [INFO] [stderr] Compiling signal-hook-registry v1.4.5 [INFO] [stderr] Compiling parking_lot v0.12.4 [INFO] [stderr] Compiling cc v1.2.30 [INFO] [stderr] Compiling socket2 v0.5.10 [INFO] [stderr] Compiling http v0.2.12 [INFO] [stderr] Compiling rand_core v0.9.3 [INFO] [stderr] Compiling futures-util v0.3.31 [INFO] [stderr] Compiling aho-corasick v1.1.3 [INFO] [stderr] Compiling crypto-common v0.1.6 [INFO] [stderr] Compiling block-buffer v0.10.4 [INFO] [stderr] Compiling ppv-lite86 v0.2.21 [INFO] [stderr] Compiling time-core v0.1.4 [INFO] [stderr] Compiling unicode-xid v0.2.6 [INFO] [stderr] Compiling adler2 v2.0.1 [INFO] [stderr] Compiling hashbrown v0.15.4 [INFO] [stderr] Compiling regex-syntax v0.8.5 [INFO] [stderr] Compiling equivalent v1.0.2 [INFO] [stderr] Compiling httparse v1.10.1 [INFO] [stderr] Compiling zstd-sys v2.0.15+zstd.1.5.7 [INFO] [stderr] Compiling indexmap v2.10.0 [INFO] [stderr] Compiling bytestring v1.4.0 [INFO] [stderr] Compiling miniz_oxide v0.8.9 [INFO] [stderr] Compiling time-macros v0.2.22 [INFO] [stderr] Compiling deranged v0.4.0 [INFO] [stderr] Compiling rand_chacha v0.9.0 [INFO] [stderr] Compiling tracing v0.1.41 [INFO] [stderr] Compiling digest v0.10.7 [INFO] [stderr] Compiling brotli-decompressor v5.0.0 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling actix-utils v3.0.1 [INFO] [stderr] Compiling regex-automata v0.4.9 [INFO] [stderr] Compiling actix-service v2.0.3 [INFO] [stderr] Compiling cookie v0.16.2 [INFO] [stderr] Compiling slab v0.4.10 [INFO] [stderr] Compiling ryu v1.0.20 [INFO] [stderr] Compiling bitflags v2.9.1 [INFO] [stderr] Compiling utf8_iter v1.0.4 [INFO] [stderr] Compiling serde_json v1.0.141 [INFO] [stderr] Compiling sha1 v0.10.6 [INFO] [stderr] Compiling time v0.3.41 [INFO] [stderr] Compiling flate2 v1.1.2 [INFO] [stderr] Compiling brotli v8.0.1 [INFO] [stderr] Compiling actix-router v0.5.3 [INFO] [stderr] Compiling rand v0.9.2 [INFO] [stderr] Compiling local-channel v0.1.5 [INFO] [stderr] Compiling encoding_rs v0.8.35 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.0 [INFO] [stderr] Compiling zerovec-derive v0.11.1 [INFO] [stderr] Compiling zerofrom v0.1.6 [INFO] [stderr] Compiling yoke v0.8.0 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling zerovec v0.11.2 [INFO] [stderr] Compiling zerotrie v0.2.2 [INFO] [stderr] Compiling tokio v1.46.1 [INFO] [stderr] Compiling tracing-attributes v0.1.30 [INFO] [stderr] Compiling derive_more-impl v2.0.1 [INFO] [stderr] Compiling regex v1.11.1 [INFO] [stderr] Compiling tinystr v0.8.1 [INFO] [stderr] Compiling potential_utf v0.1.2 [INFO] [stderr] Compiling icu_locale_core v2.0.0 [INFO] [stderr] Compiling icu_collections v2.0.0 [INFO] [stderr] Compiling foldhash v0.1.5 [INFO] [stderr] Compiling actix-web-codegen v4.3.0 [INFO] [stderr] Compiling icu_provider v2.0.0 [INFO] [stderr] Compiling actix-macros v0.2.4 [INFO] [stderr] Compiling icu_properties v2.0.1 [INFO] [stderr] Compiling icu_normalizer v2.0.0 [INFO] [stderr] Compiling serde_urlencoded v0.7.1 [INFO] [stderr] Compiling impl-more v0.1.9 [INFO] [stderr] Compiling uuid v1.17.0 [INFO] [stderr] Compiling derive_more v2.0.1 [INFO] [stderr] Compiling idna_adapter v1.2.1 [INFO] [stderr] Compiling idna v1.0.3 [INFO] [stderr] Compiling url v2.5.4 [INFO] [stderr] Compiling zstd v0.13.3 [INFO] [stderr] Compiling tokio-util v0.7.15 [INFO] [stderr] Compiling actix-rt v2.10.0 [INFO] [stderr] Compiling actix-server v2.6.0 [INFO] [stderr] Compiling actix-codec v0.5.2 [INFO] [stderr] Compiling h2 v0.3.27 [INFO] [stderr] Compiling actix-http v3.11.0 [INFO] [stderr] Compiling actix-web v4.11.0 [INFO] [stderr] Compiling hush_demo v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `CString` [INFO] [stdout] --> src/core/types.rs:6:24 [INFO] [stdout] | [INFO] [stdout] 6 | use std::ffi::{c_char, CString}; [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: `ErrorCode`, `HushError`, and `HushResult` [INFO] [stdout] --> src/core/mod.rs:11:17 [INFO] [stdout] | [INFO] [stdout] 11 | pub use error::{HushError, HushResult, ErrorCode}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `FFIResult`, `from_c_string`, `handle_ffi_result`, and `to_c_string` [INFO] [stdout] --> src/core/mod.rs:12:15 [INFO] [stdout] | [INFO] [stdout] 12 | pub use ffi::{FFIResult, to_c_string, from_c_string, handle_ffi_result}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `CStringWrapper` and `MemoryManager` [INFO] [stdout] --> src/core/mod.rs:13:18 [INFO] [stdout] | [INFO] [stdout] 13 | pub use memory::{MemoryManager, CStringWrapper}; [INFO] [stdout] | ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `RequestContext` and `ResponseContext` [INFO] [stdout] --> src/core/mod.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | pub use types::{RequestContext, ResponseContext}; [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `WebServerConfig` and `WebServer` [INFO] [stdout] --> src/web/mod.rs:17:18 [INFO] [stdout] | [INFO] [stdout] 17 | pub use server::{WebServer, WebServerConfig}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `RouteMatcher` and `Router` [INFO] [stdout] --> src/web/mod.rs:18:18 [INFO] [stdout] | [INFO] [stdout] 18 | pub use router::{Router, RouteMatcher}; [INFO] [stdout] | ^^^^^^ ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `RequestHandler` and `ResponseBuilder` [INFO] [stdout] --> src/web/mod.rs:19:19 [INFO] [stdout] | [INFO] [stdout] 19 | pub use handler::{RequestHandler, ResponseBuilder}; [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `MiddlewareChain`, `MiddlewareContext`, `MiddlewareHandler`, `MiddlewareResult`, `Middleware`, and `NextFunction` [INFO] [stdout] --> src/middleware/mod.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | Middleware, MiddlewareChain, MiddlewareResult, MiddlewareContext, [INFO] [stdout] | ^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ [INFO] [stdout] 15 | MiddlewareHandler, NextFunction [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `HushMiddlewareHandler`, `HushMiddleware`, `HushRequestContext`, `hush_middleware_add_auth_jwt`, `hush_middleware_add_cors`, `hush_middleware_add_logger`, `hush_middleware_add_rate_limit_by_user`, `hush_middleware_add_rate_limit`, `hush_middleware_add`, `hush_middleware_free`, and `hush_middleware_new` [INFO] [stdout] --> src/middleware/mod.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | HushMiddleware, HushMiddlewareHandler, HushRequestContext, [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 19 | hush_middleware_new, hush_middleware_add, hush_middleware_free, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 20 | hush_middleware_add_cors, hush_middleware_add_auth_jwt, hush_middleware_add_logger, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 21 | hush_middleware_add_rate_limit, hush_middleware_add_rate_limit_by_user [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AuthMiddleware`, `CorsMiddleware`, `LoggerMiddleware`, and `RateLimitMiddleware` [INFO] [stdout] --> src/middleware/mod.rs:23:19 [INFO] [stdout] | [INFO] [stdout] 23 | pub use builtin::{CorsMiddleware, LoggerMiddleware, AuthMiddleware, RateLimitMiddleware}; [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `router_data` [INFO] [stdout] --> src/web/server.rs:230:9 [INFO] [stdout] | [INFO] [stdout] 230 | router_data: web::Data>>, [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_router_data` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `name` [INFO] [stdout] --> src/core/ffi.rs:43:41 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn check_null_ptr(ptr: *const T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `name` [INFO] [stdout] --> src/core/ffi.rs:52:43 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn check_null_mut_ptr(ptr: *mut T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `new_layout` [INFO] [stdout] --> src/core/memory.rs:182:29 [INFO] [stdout] | [INFO] [stdout] 182 | (Ok(old_layout), Ok(new_layout)) => unsafe { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_new_layout` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ctx` [INFO] [stdout] --> src/middleware/core.rs:183:63 [INFO] [stdout] | [INFO] [stdout] 183 | let recursive_next: NextFunction = Box::new(move |ctx: &mut MiddlewareContext| -> HushResult { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ctx` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `FFIResult` is never used [INFO] [stdout] --> src/core/ffi.rs:9:10 [INFO] [stdout] | [INFO] [stdout] 9 | pub type FFIResult = Result; [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 `handle_ffi_result` is never used [INFO] [stdout] --> src/core/ffi.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | pub fn handle_ffi_result(result: HushResult) -> FFIResult { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `check_null_ptr` is never used [INFO] [stdout] --> src/core/ffi.rs:43:8 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn check_null_ptr(ptr: *const T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `check_null_mut_ptr` is never used [INFO] [stdout] --> src/core/ffi.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn check_null_mut_ptr(ptr: *mut T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `free_c_string` and `clone_c_string` are never used [INFO] [stdout] --> src/core/memory.rs:27:12 [INFO] [stdout] | [INFO] [stdout] 14 | impl MemoryManager { [INFO] [stdout] | ------------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 27 | pub fn free_c_string(&self, ptr: *mut c_char) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 36 | pub fn clone_c_string(&self, ptr: *const c_char) -> HushResult<*mut c_char> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `CStringWrapper` is never constructed [INFO] [stdout] --> src/core/memory.rs:51:12 [INFO] [stdout] | [INFO] [stdout] 51 | pub struct CStringWrapper { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `as_ptr`, and `into_raw` are never used [INFO] [stdout] --> src/core/memory.rs:57:12 [INFO] [stdout] | [INFO] [stdout] 56 | impl CStringWrapper { [INFO] [stdout] | ------------------- associated items in this implementation [INFO] [stdout] 57 | pub fn new(s: &str, manager: Arc) -> HushResult { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 62 | pub fn as_ptr(&self) -> *const c_char { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 66 | pub fn into_raw(self) -> *mut c_char { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ByteArray` is never constructed [INFO] [stdout] --> src/core/memory.rs:94:12 [INFO] [stdout] | [INFO] [stdout] 94 | pub struct ByteArray { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `from_vec`, `as_ptr`, `len`, and `into_vec` are never used [INFO] [stdout] --> src/core/memory.rs:101:12 [INFO] [stdout] | [INFO] [stdout] 100 | impl ByteArray { [INFO] [stdout] | -------------- associated items in this implementation [INFO] [stdout] 101 | pub fn from_vec(mut vec: Vec) -> Self { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 110 | pub fn as_ptr(&self) -> *const u8 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 114 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 118 | pub fn into_vec(self) -> Vec { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `method`, `path`, and `handler_name` are never read [INFO] [stdout] --> src/core/types.rs:211:9 [INFO] [stdout] | [INFO] [stdout] 210 | pub struct RouteInfo { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 211 | pub method: HttpMethod, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 212 | pub path: String, [INFO] [stdout] | ^^^^ [INFO] [stdout] 213 | pub handler_name: String, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RouteInfo` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `route_key` is never used [INFO] [stdout] --> src/core/types.rs:225:12 [INFO] [stdout] | [INFO] [stdout] 216 | impl RouteInfo { [INFO] [stdout] | -------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 225 | pub fn route_key(&self) -> String { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `remove_route`, `get_routes`, `has_route`, `route_count`, `clear`, and `get_supported_methods` are never used [INFO] [stdout] --> src/web/router.rs:45:12 [INFO] [stdout] | [INFO] [stdout] 16 | impl Router { [INFO] [stdout] | ----------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 45 | pub fn remove_route(&mut self, method: HttpMethod, path: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 69 | pub fn get_routes(&self) -> &Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 74 | pub fn has_route(&self, method: HttpMethod, path: &str) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 80 | pub fn route_count(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 85 | pub fn clear(&mut self) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 91 | pub fn get_supported_methods(&self, path: &str) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `RouteMatcher` is never constructed [INFO] [stdout] --> src/web/router.rs:123:12 [INFO] [stdout] | [INFO] [stdout] 123 | pub struct RouteMatcher { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `matches`, `param_names`, and `pattern` are never used [INFO] [stdout] --> src/web/router.rs:130:12 [INFO] [stdout] | [INFO] [stdout] 128 | impl RouteMatcher { [INFO] [stdout] | ----------------- associated items in this implementation [INFO] [stdout] 129 | /// 创建新的路由匹配器 [INFO] [stdout] 130 | pub fn new(pattern: &str) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 147 | pub fn matches(&self, path: &str) -> Option> { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 173 | pub fn param_names(&self) -> &Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 178 | pub fn pattern(&self) -> &str { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `body`, `json`, `html`, and `header` are never used [INFO] [stdout] --> src/web/handler.rs:56:12 [INFO] [stdout] | [INFO] [stdout] 47 | impl ResponseBuilder { [INFO] [stdout] | -------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 56 | pub fn body(mut self, body: Vec) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 68 | pub fn json(mut self, json: &str) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 75 | pub fn html(mut self, html: &str) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 82 | pub fn header(mut self, key: &str, value: &str) -> Self { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `text_handler` is never used [INFO] [stdout] --> src/web/handler.rs:98:8 [INFO] [stdout] | [INFO] [stdout] 98 | pub fn text_handler(text: &'static str) -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `json_handler` is never used [INFO] [stdout] --> src/web/handler.rs:107:8 [INFO] [stdout] | [INFO] [stdout] 107 | pub fn json_handler(json: &'static str) -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `html_handler` is never used [INFO] [stdout] --> src/web/handler.rs:116:8 [INFO] [stdout] | [INFO] [stdout] 116 | pub fn html_handler(html: &'static str) -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `not_found_handler` is never used [INFO] [stdout] --> src/web/handler.rs:125:8 [INFO] [stdout] | [INFO] [stdout] 125 | pub fn not_found_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `internal_error_handler` is never used [INFO] [stdout] --> src/web/handler.rs:134:8 [INFO] [stdout] | [INFO] [stdout] 134 | pub fn internal_error_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `echo_handler` is never used [INFO] [stdout] --> src/web/handler.rs:143:8 [INFO] [stdout] | [INFO] [stdout] 143 | pub fn echo_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `health_check_handler` is never used [INFO] [stdout] --> src/web/handler.rs:161:8 [INFO] [stdout] | [INFO] [stdout] 161 | pub fn health_check_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `MiddlewareFn` is never used [INFO] [stdout] --> src/web/handler.rs:175:10 [INFO] [stdout] | [INFO] [stdout] 175 | pub type MiddlewareFn = dyn Fn(&mut RequestContext, &dyn Fn(&RequestContext) -> HushResult) -> HushResult src/web/handler.rs:178:12 [INFO] [stdout] | [INFO] [stdout] 178 | pub struct Middleware { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new` and `apply` are never used [INFO] [stdout] --> src/web/handler.rs:184:12 [INFO] [stdout] | [INFO] [stdout] 182 | impl Middleware { [INFO] [stdout] | --------------- associated items in this implementation [INFO] [stdout] 183 | /// 创建新的中间件 [INFO] [stdout] 184 | pub fn new(middleware: F) -> Self [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 194 | pub fn apply(&self, handler: RequestHandler) -> RequestHandler { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `logging_middleware` is never used [INFO] [stdout] --> src/web/handler.rs:205:8 [INFO] [stdout] | [INFO] [stdout] 205 | pub fn logging_middleware() -> Middleware { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `cors_middleware` is never used [INFO] [stdout] --> src/web/handler.rs:227:8 [INFO] [stdout] | [INFO] [stdout] 227 | pub fn cors_middleware(allowed_origins: &'static str) -> Middleware { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `demo_middleware_integration` is never used [INFO] [stdout] --> src/web/middleware_demo.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn demo_middleware_integration() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `with_priority` is never used [INFO] [stdout] --> src/middleware/core.rs:88:12 [INFO] [stdout] | [INFO] [stdout] 76 | impl FunctionMiddleware { [INFO] [stdout] | ----------------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 88 | pub fn with_priority(name: String, priority: i32, handler: F) -> Self [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `add_function_with_priority` and `is_empty` are never used [INFO] [stdout] --> src/middleware/core.rs:143:12 [INFO] [stdout] | [INFO] [stdout] 119 | impl MiddlewareChain { [INFO] [stdout] | -------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 143 | pub fn add_function_with_priority(&mut self, name: String, priority: i32, handler: F) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 218 | pub fn is_empty(&self) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `permissive`, `with_methods`, `with_headers`, and `with_max_age` are never used [INFO] [stdout] --> src/middleware/builtin.rs:28:12 [INFO] [stdout] | [INFO] [stdout] 18 | impl CorsMiddleware { [INFO] [stdout] | ------------------- associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 28 | pub fn permissive() -> Self { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 37 | pub fn with_methods(mut self, methods: String) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 42 | pub fn with_headers(mut self, headers: String) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 47 | pub fn with_max_age(mut self, max_age: u32) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `requests_only`, `responses_only`, `detailed`, `with_headers`, and `with_body` are never used [INFO] [stdout] --> src/middleware/builtin.rs:135:12 [INFO] [stdout] | [INFO] [stdout] 125 | impl LoggerMiddleware { [INFO] [stdout] | --------------------- associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 135 | pub fn requests_only() -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 144 | pub fn responses_only() -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 153 | pub fn detailed() -> Self { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 162 | pub fn with_headers(mut self) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 167 | pub fn with_body(mut self) -> Self { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `secret` is never read [INFO] [stdout] --> src/middleware/builtin.rs:287:5 [INFO] [stdout] | [INFO] [stdout] 286 | pub struct AuthMiddleware { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] 287 | secret: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `with_skip_paths` and `with_header_name` are never used [INFO] [stdout] --> src/middleware/builtin.rs:301:12 [INFO] [stdout] | [INFO] [stdout] 292 | impl AuthMiddleware { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 301 | pub fn with_skip_paths(mut self, paths: Vec) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 306 | pub fn with_header_name(mut self, header_name: String) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `with_user_limits` is never used [INFO] [stdout] --> src/middleware/builtin.rs:403:12 [INFO] [stdout] | [INFO] [stdout] 386 | impl RateLimitMiddleware { [INFO] [stdout] | ------------------------ associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 403 | pub fn with_user_limits(max_requests: u32, window_seconds: u64) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/lib.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if ZIG_HANDLERS.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/lib.rs:57:14 [INFO] [stdout] | [INFO] [stdout] 57 | unsafe { ZIG_HANDLERS.clone() } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/web/middleware_demo.rs:38:55 [INFO] [stdout] | [INFO] [stdout] 38 | ctx.set_data("request_count".to_string(), COUNTER.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/web/middleware_demo.rs:39:48 [INFO] [stdout] | [INFO] [stdout] 39 | println!(" -> 处理第 {} 个请求: {} {}", COUNTER, ctx.request.method.as_str(), ctx.request.path); [INFO] [stdout] | ^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2m 18s [INFO] running `Command { std: "docker" "inspect" "1252ba50f05cffbd6e1209d9d3e2b9318cc4d4f23f67da7edad70f1566d5c888", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1252ba50f05cffbd6e1209d9d3e2b9318cc4d4f23f67da7edad70f1566d5c888", kill_on_drop: false }` [INFO] [stdout] 1252ba50f05cffbd6e1209d9d3e2b9318cc4d4f23f67da7edad70f1566d5c888 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] e16495ca3fa29d0d0ea566dd961daedab148866b9c802b4a8c03b1a9e9dd67f3 [INFO] running `Command { std: "docker" "start" "-a" "e16495ca3fa29d0d0ea566dd961daedab148866b9c802b4a8c03b1a9e9dd67f3", kill_on_drop: false }` [INFO] [stdout] warning: unused import: `CString` [INFO] [stdout] --> src/core/types.rs:6:24 [INFO] [stdout] | [INFO] [stdout] 6 | use std::ffi::{c_char, CString}; [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: `ErrorCode`, `HushError`, and `HushResult` [INFO] [stdout] --> src/core/mod.rs:11:17 [INFO] [stdout] | [INFO] [stdout] 11 | pub use error::{HushError, HushResult, ErrorCode}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `FFIResult`, `from_c_string`, `handle_ffi_result`, and `to_c_string` [INFO] [stdout] --> src/core/mod.rs:12:15 [INFO] [stdout] | [INFO] [stdout] 12 | pub use ffi::{FFIResult, to_c_string, from_c_string, handle_ffi_result}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `CStringWrapper` and `MemoryManager` [INFO] [stdout] --> src/core/mod.rs:13:18 [INFO] [stdout] | [INFO] [stdout] 13 | pub use memory::{MemoryManager, CStringWrapper}; [INFO] [stdout] | ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `RequestContext` and `ResponseContext` [INFO] [stdout] --> src/core/mod.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | pub use types::{RequestContext, ResponseContext}; [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `WebServerConfig` and `WebServer` [INFO] [stdout] --> src/web/mod.rs:17:18 [INFO] [stdout] | [INFO] [stdout] 17 | pub use server::{WebServer, WebServerConfig}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `RouteMatcher` and `Router` [INFO] [stdout] --> src/web/mod.rs:18:18 [INFO] [stdout] | [INFO] [stdout] 18 | pub use router::{Router, RouteMatcher}; [INFO] [stdout] | ^^^^^^ ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `RequestHandler` and `ResponseBuilder` [INFO] [stdout] --> src/web/mod.rs:19:19 [INFO] [stdout] | [INFO] [stdout] 19 | pub use handler::{RequestHandler, ResponseBuilder}; [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `MiddlewareChain`, `MiddlewareContext`, `MiddlewareHandler`, `MiddlewareResult`, `Middleware`, and `NextFunction` [INFO] [stdout] --> src/middleware/mod.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | Middleware, MiddlewareChain, MiddlewareResult, MiddlewareContext, [INFO] [stdout] | ^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ [INFO] [stdout] 15 | MiddlewareHandler, NextFunction [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `HushMiddlewareHandler`, `HushMiddleware`, `HushRequestContext`, `hush_middleware_add_auth_jwt`, `hush_middleware_add_cors`, `hush_middleware_add_logger`, `hush_middleware_add_rate_limit_by_user`, `hush_middleware_add_rate_limit`, `hush_middleware_add`, `hush_middleware_free`, and `hush_middleware_new` [INFO] [stdout] --> src/middleware/mod.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | HushMiddleware, HushMiddlewareHandler, HushRequestContext, [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 19 | hush_middleware_new, hush_middleware_add, hush_middleware_free, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 20 | hush_middleware_add_cors, hush_middleware_add_auth_jwt, hush_middleware_add_logger, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 21 | hush_middleware_add_rate_limit, hush_middleware_add_rate_limit_by_user [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AuthMiddleware`, `CorsMiddleware`, `LoggerMiddleware`, and `RateLimitMiddleware` [INFO] [stdout] --> src/middleware/mod.rs:23:19 [INFO] [stdout] | [INFO] [stdout] 23 | pub use builtin::{CorsMiddleware, LoggerMiddleware, AuthMiddleware, RateLimitMiddleware}; [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `router_data` [INFO] [stdout] --> src/web/server.rs:230:9 [INFO] [stdout] | [INFO] [stdout] 230 | router_data: web::Data>>, [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_router_data` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `name` [INFO] [stdout] --> src/core/ffi.rs:43:41 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn check_null_ptr(ptr: *const T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `name` [INFO] [stdout] --> src/core/ffi.rs:52:43 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn check_null_mut_ptr(ptr: *mut T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `new_layout` [INFO] [stdout] --> src/core/memory.rs:182:29 [INFO] [stdout] | [INFO] [stdout] 182 | (Ok(old_layout), Ok(new_layout)) => unsafe { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_new_layout` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ctx` [INFO] [stdout] --> src/middleware/core.rs:183:63 [INFO] [stdout] | [INFO] [stdout] 183 | let recursive_next: NextFunction = Box::new(move |ctx: &mut MiddlewareContext| -> HushResult { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ctx` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `FFIResult` is never used [INFO] [stdout] --> src/core/ffi.rs:9:10 [INFO] [stdout] | [INFO] [stdout] 9 | pub type FFIResult = Result; [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 `handle_ffi_result` is never used [INFO] [stdout] --> src/core/ffi.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | pub fn handle_ffi_result(result: HushResult) -> FFIResult { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `check_null_ptr` is never used [INFO] [stdout] --> src/core/ffi.rs:43:8 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn check_null_ptr(ptr: *const T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `check_null_mut_ptr` is never used [INFO] [stdout] --> src/core/ffi.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn check_null_mut_ptr(ptr: *mut T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `free_c_string` and `clone_c_string` are never used [INFO] [stdout] --> src/core/memory.rs:27:12 [INFO] [stdout] | [INFO] [stdout] 14 | impl MemoryManager { [INFO] [stdout] | ------------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 27 | pub fn free_c_string(&self, ptr: *mut c_char) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 36 | pub fn clone_c_string(&self, ptr: *const c_char) -> HushResult<*mut c_char> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `CStringWrapper` is never constructed [INFO] [stdout] --> src/core/memory.rs:51:12 [INFO] [stdout] | [INFO] [stdout] 51 | pub struct CStringWrapper { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `as_ptr`, and `into_raw` are never used [INFO] [stdout] --> src/core/memory.rs:57:12 [INFO] [stdout] | [INFO] [stdout] 56 | impl CStringWrapper { [INFO] [stdout] | ------------------- associated items in this implementation [INFO] [stdout] 57 | pub fn new(s: &str, manager: Arc) -> HushResult { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 62 | pub fn as_ptr(&self) -> *const c_char { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 66 | pub fn into_raw(self) -> *mut c_char { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ByteArray` is never constructed [INFO] [stdout] --> src/core/memory.rs:94:12 [INFO] [stdout] | [INFO] [stdout] 94 | pub struct ByteArray { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `from_vec`, `as_ptr`, `len`, and `into_vec` are never used [INFO] [stdout] --> src/core/memory.rs:101:12 [INFO] [stdout] | [INFO] [stdout] 100 | impl ByteArray { [INFO] [stdout] | -------------- associated items in this implementation [INFO] [stdout] 101 | pub fn from_vec(mut vec: Vec) -> Self { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 110 | pub fn as_ptr(&self) -> *const u8 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 114 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 118 | pub fn into_vec(self) -> Vec { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling hush_demo v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: fields `method`, `path`, and `handler_name` are never read [INFO] [stdout] --> src/core/types.rs:211:9 [INFO] [stdout] | [INFO] [stdout] 210 | pub struct RouteInfo { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 211 | pub method: HttpMethod, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 212 | pub path: String, [INFO] [stdout] | ^^^^ [INFO] [stdout] 213 | pub handler_name: String, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RouteInfo` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `route_key` is never used [INFO] [stdout] --> src/core/types.rs:225:12 [INFO] [stdout] | [INFO] [stdout] 216 | impl RouteInfo { [INFO] [stdout] | -------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 225 | pub fn route_key(&self) -> String { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `remove_route`, `get_routes`, `has_route`, `route_count`, `clear`, and `get_supported_methods` are never used [INFO] [stdout] --> src/web/router.rs:45:12 [INFO] [stdout] | [INFO] [stdout] 16 | impl Router { [INFO] [stdout] | ----------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 45 | pub fn remove_route(&mut self, method: HttpMethod, path: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 69 | pub fn get_routes(&self) -> &Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 74 | pub fn has_route(&self, method: HttpMethod, path: &str) -> bool { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 80 | pub fn route_count(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 85 | pub fn clear(&mut self) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 91 | pub fn get_supported_methods(&self, path: &str) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `RouteMatcher` is never constructed [INFO] [stdout] --> src/web/router.rs:123:12 [INFO] [stdout] | [INFO] [stdout] 123 | pub struct RouteMatcher { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `matches`, `param_names`, and `pattern` are never used [INFO] [stdout] --> src/web/router.rs:130:12 [INFO] [stdout] | [INFO] [stdout] 128 | impl RouteMatcher { [INFO] [stdout] | ----------------- associated items in this implementation [INFO] [stdout] 129 | /// 创建新的路由匹配器 [INFO] [stdout] 130 | pub fn new(pattern: &str) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 147 | pub fn matches(&self, path: &str) -> Option> { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 173 | pub fn param_names(&self) -> &Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 178 | pub fn pattern(&self) -> &str { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `body`, `json`, `html`, and `header` are never used [INFO] [stdout] --> src/web/handler.rs:56:12 [INFO] [stdout] | [INFO] [stdout] 47 | impl ResponseBuilder { [INFO] [stdout] | -------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 56 | pub fn body(mut self, body: Vec) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 68 | pub fn json(mut self, json: &str) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 75 | pub fn html(mut self, html: &str) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 82 | pub fn header(mut self, key: &str, value: &str) -> Self { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `text_handler` is never used [INFO] [stdout] --> src/web/handler.rs:98:8 [INFO] [stdout] | [INFO] [stdout] 98 | pub fn text_handler(text: &'static str) -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `json_handler` is never used [INFO] [stdout] --> src/web/handler.rs:107:8 [INFO] [stdout] | [INFO] [stdout] 107 | pub fn json_handler(json: &'static str) -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `html_handler` is never used [INFO] [stdout] --> src/web/handler.rs:116:8 [INFO] [stdout] | [INFO] [stdout] 116 | pub fn html_handler(html: &'static str) -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `not_found_handler` is never used [INFO] [stdout] --> src/web/handler.rs:125:8 [INFO] [stdout] | [INFO] [stdout] 125 | pub fn not_found_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `internal_error_handler` is never used [INFO] [stdout] --> src/web/handler.rs:134:8 [INFO] [stdout] | [INFO] [stdout] 134 | pub fn internal_error_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `echo_handler` is never used [INFO] [stdout] --> src/web/handler.rs:143:8 [INFO] [stdout] | [INFO] [stdout] 143 | pub fn echo_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `health_check_handler` is never used [INFO] [stdout] --> src/web/handler.rs:161:8 [INFO] [stdout] | [INFO] [stdout] 161 | pub fn health_check_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `MiddlewareFn` is never used [INFO] [stdout] --> src/web/handler.rs:175:10 [INFO] [stdout] | [INFO] [stdout] 175 | pub type MiddlewareFn = dyn Fn(&mut RequestContext, &dyn Fn(&RequestContext) -> HushResult) -> HushResult src/web/handler.rs:178:12 [INFO] [stdout] | [INFO] [stdout] 178 | pub struct Middleware { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new` and `apply` are never used [INFO] [stdout] --> src/web/handler.rs:184:12 [INFO] [stdout] | [INFO] [stdout] 182 | impl Middleware { [INFO] [stdout] | --------------- associated items in this implementation [INFO] [stdout] 183 | /// 创建新的中间件 [INFO] [stdout] 184 | pub fn new(middleware: F) -> Self [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 194 | pub fn apply(&self, handler: RequestHandler) -> RequestHandler { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `logging_middleware` is never used [INFO] [stdout] --> src/web/handler.rs:205:8 [INFO] [stdout] | [INFO] [stdout] 205 | pub fn logging_middleware() -> Middleware { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `cors_middleware` is never used [INFO] [stdout] --> src/web/handler.rs:227:8 [INFO] [stdout] | [INFO] [stdout] 227 | pub fn cors_middleware(allowed_origins: &'static str) -> Middleware { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `demo_middleware_integration` is never used [INFO] [stdout] --> src/web/middleware_demo.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn demo_middleware_integration() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `with_priority` is never used [INFO] [stdout] --> src/middleware/core.rs:88:12 [INFO] [stdout] | [INFO] [stdout] 76 | impl FunctionMiddleware { [INFO] [stdout] | ----------------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 88 | pub fn with_priority(name: String, priority: i32, handler: F) -> Self [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `add_function_with_priority` and `is_empty` are never used [INFO] [stdout] --> src/middleware/core.rs:143:12 [INFO] [stdout] | [INFO] [stdout] 119 | impl MiddlewareChain { [INFO] [stdout] | -------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 143 | pub fn add_function_with_priority(&mut self, name: String, priority: i32, handler: F) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 218 | pub fn is_empty(&self) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `permissive`, `with_methods`, `with_headers`, and `with_max_age` are never used [INFO] [stdout] --> src/middleware/builtin.rs:28:12 [INFO] [stdout] | [INFO] [stdout] 18 | impl CorsMiddleware { [INFO] [stdout] | ------------------- associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 28 | pub fn permissive() -> Self { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 37 | pub fn with_methods(mut self, methods: String) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 42 | pub fn with_headers(mut self, headers: String) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 47 | pub fn with_max_age(mut self, max_age: u32) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `requests_only`, `responses_only`, `detailed`, `with_headers`, and `with_body` are never used [INFO] [stdout] --> src/middleware/builtin.rs:135:12 [INFO] [stdout] | [INFO] [stdout] 125 | impl LoggerMiddleware { [INFO] [stdout] | --------------------- associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 135 | pub fn requests_only() -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 144 | pub fn responses_only() -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 153 | pub fn detailed() -> Self { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 162 | pub fn with_headers(mut self) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 167 | pub fn with_body(mut self) -> Self { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `secret` is never read [INFO] [stdout] --> src/middleware/builtin.rs:287:5 [INFO] [stdout] | [INFO] [stdout] 286 | pub struct AuthMiddleware { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] 287 | secret: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `with_skip_paths` and `with_header_name` are never used [INFO] [stdout] --> src/middleware/builtin.rs:301:12 [INFO] [stdout] | [INFO] [stdout] 292 | impl AuthMiddleware { [INFO] [stdout] | ------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 301 | pub fn with_skip_paths(mut self, paths: Vec) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 306 | pub fn with_header_name(mut self, header_name: String) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `with_user_limits` is never used [INFO] [stdout] --> src/middleware/builtin.rs:403:12 [INFO] [stdout] | [INFO] [stdout] 386 | impl RateLimitMiddleware { [INFO] [stdout] | ------------------------ associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 403 | pub fn with_user_limits(max_requests: u32, window_seconds: u64) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/lib.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if ZIG_HANDLERS.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/lib.rs:57:14 [INFO] [stdout] | [INFO] [stdout] 57 | unsafe { ZIG_HANDLERS.clone() } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/web/middleware_demo.rs:38:55 [INFO] [stdout] | [INFO] [stdout] 38 | ctx.set_data("request_count".to_string(), COUNTER.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/web/middleware_demo.rs:39:48 [INFO] [stdout] | [INFO] [stdout] 39 | println!(" -> 处理第 {} 个请求: {} {}", COUNTER, ctx.request.method.as_str(), ctx.request.path); [INFO] [stdout] | ^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `CString` [INFO] [stdout] --> src/core/types.rs:6:24 [INFO] [stdout] | [INFO] [stdout] 6 | use std::ffi::{c_char, CString}; [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: `ErrorCode`, `HushError`, and `HushResult` [INFO] [stdout] --> src/core/mod.rs:11:17 [INFO] [stdout] | [INFO] [stdout] 11 | pub use error::{HushError, HushResult, ErrorCode}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `FFIResult`, `from_c_string`, `handle_ffi_result`, and `to_c_string` [INFO] [stdout] --> src/core/mod.rs:12:15 [INFO] [stdout] | [INFO] [stdout] 12 | pub use ffi::{FFIResult, to_c_string, from_c_string, handle_ffi_result}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `CStringWrapper` and `MemoryManager` [INFO] [stdout] --> src/core/mod.rs:13:18 [INFO] [stdout] | [INFO] [stdout] 13 | pub use memory::{MemoryManager, CStringWrapper}; [INFO] [stdout] | ^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `RequestContext` and `ResponseContext` [INFO] [stdout] --> src/core/mod.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | pub use types::{RequestContext, ResponseContext}; [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::core::error::HushResult` [INFO] [stdout] --> src/web/middleware_integration_tests.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | use crate::core::error::HushResult; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `MiddlewareContext` [INFO] [stdout] --> src/web/middleware_integration_tests.rs:11:35 [INFO] [stdout] | [INFO] [stdout] 11 | use crate::middleware::core::{MiddlewareContext, MiddlewareResult}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `WebServerConfig` and `WebServer` [INFO] [stdout] --> src/web/mod.rs:17:18 [INFO] [stdout] | [INFO] [stdout] 17 | pub use server::{WebServer, WebServerConfig}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `RouteMatcher` and `Router` [INFO] [stdout] --> src/web/mod.rs:18:18 [INFO] [stdout] | [INFO] [stdout] 18 | pub use router::{Router, RouteMatcher}; [INFO] [stdout] | ^^^^^^ ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `RequestHandler` and `ResponseBuilder` [INFO] [stdout] --> src/web/mod.rs:19:19 [INFO] [stdout] | [INFO] [stdout] 19 | pub use handler::{RequestHandler, ResponseBuilder}; [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `HttpStatus` [INFO] [stdout] --> src/middleware/core.rs:237:42 [INFO] [stdout] | [INFO] [stdout] 237 | use crate::core::types::{HttpMethod, HttpStatus}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `MiddlewareChain`, `MiddlewareContext`, `MiddlewareHandler`, `MiddlewareResult`, `Middleware`, and `NextFunction` [INFO] [stdout] --> src/middleware/mod.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | Middleware, MiddlewareChain, MiddlewareResult, MiddlewareContext, [INFO] [stdout] | ^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ [INFO] [stdout] 15 | MiddlewareHandler, NextFunction [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `HushMiddlewareHandler`, `HushMiddleware`, `HushRequestContext`, `hush_middleware_add_auth_jwt`, `hush_middleware_add_cors`, `hush_middleware_add_logger`, `hush_middleware_add_rate_limit_by_user`, `hush_middleware_add_rate_limit`, `hush_middleware_add`, `hush_middleware_free`, and `hush_middleware_new` [INFO] [stdout] --> src/middleware/mod.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | HushMiddleware, HushMiddlewareHandler, HushRequestContext, [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 19 | hush_middleware_new, hush_middleware_add, hush_middleware_free, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 20 | hush_middleware_add_cors, hush_middleware_add_auth_jwt, hush_middleware_add_logger, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 21 | hush_middleware_add_rate_limit, hush_middleware_add_rate_limit_by_user [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AuthMiddleware`, `CorsMiddleware`, `LoggerMiddleware`, and `RateLimitMiddleware` [INFO] [stdout] --> src/middleware/mod.rs:23:19 [INFO] [stdout] | [INFO] [stdout] 23 | pub use builtin::{CorsMiddleware, LoggerMiddleware, AuthMiddleware, RateLimitMiddleware}; [INFO] [stdout] | ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `router_data` [INFO] [stdout] --> src/web/server.rs:230:9 [INFO] [stdout] | [INFO] [stdout] 230 | router_data: web::Data>>, [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_router_data` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `name` [INFO] [stdout] --> src/core/ffi.rs:43:41 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn check_null_ptr(ptr: *const T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `name` [INFO] [stdout] --> src/core/ffi.rs:52:43 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn check_null_mut_ptr(ptr: *mut T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_name` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `new_layout` [INFO] [stdout] --> src/core/memory.rs:182:29 [INFO] [stdout] | [INFO] [stdout] 182 | (Ok(old_layout), Ok(new_layout)) => unsafe { [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_new_layout` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ctx` [INFO] [stdout] --> src/middleware/core.rs:183:63 [INFO] [stdout] | [INFO] [stdout] 183 | let recursive_next: NextFunction = Box::new(move |ctx: &mut MiddlewareContext| -> HushResult { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ctx` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `FFIResult` is never used [INFO] [stdout] --> src/core/ffi.rs:9:10 [INFO] [stdout] | [INFO] [stdout] 9 | pub type FFIResult = Result; [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 `handle_ffi_result` is never used [INFO] [stdout] --> src/core/ffi.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | pub fn handle_ffi_result(result: HushResult) -> FFIResult { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `check_null_ptr` is never used [INFO] [stdout] --> src/core/ffi.rs:43:8 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn check_null_ptr(ptr: *const T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `check_null_mut_ptr` is never used [INFO] [stdout] --> src/core/ffi.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn check_null_mut_ptr(ptr: *mut T, name: &str) -> HushResult<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `free_c_string` and `clone_c_string` are never used [INFO] [stdout] --> src/core/memory.rs:27:12 [INFO] [stdout] | [INFO] [stdout] 14 | impl MemoryManager { [INFO] [stdout] | ------------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 27 | pub fn free_c_string(&self, ptr: *mut c_char) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 36 | pub fn clone_c_string(&self, ptr: *const c_char) -> HushResult<*mut c_char> { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `CStringWrapper` is never constructed [INFO] [stdout] --> src/core/memory.rs:51:12 [INFO] [stdout] | [INFO] [stdout] 51 | pub struct CStringWrapper { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `as_ptr`, and `into_raw` are never used [INFO] [stdout] --> src/core/memory.rs:57:12 [INFO] [stdout] | [INFO] [stdout] 56 | impl CStringWrapper { [INFO] [stdout] | ------------------- associated items in this implementation [INFO] [stdout] 57 | pub fn new(s: &str, manager: Arc) -> HushResult { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 62 | pub fn as_ptr(&self) -> *const c_char { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 66 | pub fn into_raw(self) -> *mut c_char { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ByteArray` is never constructed [INFO] [stdout] --> src/core/memory.rs:94:12 [INFO] [stdout] | [INFO] [stdout] 94 | pub struct ByteArray { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `from_vec`, `as_ptr`, `len`, and `into_vec` are never used [INFO] [stdout] --> src/core/memory.rs:101:12 [INFO] [stdout] | [INFO] [stdout] 100 | impl ByteArray { [INFO] [stdout] | -------------- associated items in this implementation [INFO] [stdout] 101 | pub fn from_vec(mut vec: Vec) -> Self { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 110 | pub fn as_ptr(&self) -> *const u8 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 114 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 118 | pub fn into_vec(self) -> Vec { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `handler_name` is never read [INFO] [stdout] --> src/core/types.rs:213:9 [INFO] [stdout] | [INFO] [stdout] 210 | pub struct RouteInfo { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 213 | pub handler_name: String, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `RouteInfo` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get_routes`, `clear`, and `get_supported_methods` are never used [INFO] [stdout] --> src/web/router.rs:69:12 [INFO] [stdout] | [INFO] [stdout] 16 | impl Router { [INFO] [stdout] | ----------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 69 | pub fn get_routes(&self) -> &Vec { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 85 | pub fn clear(&mut self) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 91 | pub fn get_supported_methods(&self, path: &str) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `params` is never read [INFO] [stdout] --> src/web/router.rs:125:5 [INFO] [stdout] | [INFO] [stdout] 123 | pub struct RouteMatcher { [INFO] [stdout] | ------------ field in this struct [INFO] [stdout] 124 | pattern: String, [INFO] [stdout] 125 | params: Vec, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `param_names` and `pattern` are never used [INFO] [stdout] --> src/web/router.rs:173:12 [INFO] [stdout] | [INFO] [stdout] 128 | impl RouteMatcher { [INFO] [stdout] | ----------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 173 | pub fn param_names(&self) -> &Vec { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 178 | pub fn pattern(&self) -> &str { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `body` and `html` are never used [INFO] [stdout] --> src/web/handler.rs:56:12 [INFO] [stdout] | [INFO] [stdout] 47 | impl ResponseBuilder { [INFO] [stdout] | -------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 56 | pub fn body(mut self, body: Vec) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 75 | pub fn html(mut self, html: &str) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `html_handler` is never used [INFO] [stdout] --> src/web/handler.rs:116:8 [INFO] [stdout] | [INFO] [stdout] 116 | pub fn html_handler(html: &'static str) -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `not_found_handler` is never used [INFO] [stdout] --> src/web/handler.rs:125:8 [INFO] [stdout] | [INFO] [stdout] 125 | pub fn not_found_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `internal_error_handler` is never used [INFO] [stdout] --> src/web/handler.rs:134:8 [INFO] [stdout] | [INFO] [stdout] 134 | pub fn internal_error_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `echo_handler` is never used [INFO] [stdout] --> src/web/handler.rs:143:8 [INFO] [stdout] | [INFO] [stdout] 143 | pub fn echo_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `health_check_handler` is never used [INFO] [stdout] --> src/web/handler.rs:161:8 [INFO] [stdout] | [INFO] [stdout] 161 | pub fn health_check_handler() -> RequestHandler { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `MiddlewareFn` is never used [INFO] [stdout] --> src/web/handler.rs:175:10 [INFO] [stdout] | [INFO] [stdout] 175 | pub type MiddlewareFn = dyn Fn(&mut RequestContext, &dyn Fn(&RequestContext) -> HushResult) -> HushResult src/web/handler.rs:178:12 [INFO] [stdout] | [INFO] [stdout] 178 | pub struct Middleware { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new` and `apply` are never used [INFO] [stdout] --> src/web/handler.rs:184:12 [INFO] [stdout] | [INFO] [stdout] 182 | impl Middleware { [INFO] [stdout] | --------------- associated items in this implementation [INFO] [stdout] 183 | /// 创建新的中间件 [INFO] [stdout] 184 | pub fn new(middleware: F) -> Self [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 194 | pub fn apply(&self, handler: RequestHandler) -> RequestHandler { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `logging_middleware` is never used [INFO] [stdout] --> src/web/handler.rs:205:8 [INFO] [stdout] | [INFO] [stdout] 205 | pub fn logging_middleware() -> Middleware { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `cors_middleware` is never used [INFO] [stdout] --> src/web/handler.rs:227:8 [INFO] [stdout] | [INFO] [stdout] 227 | pub fn cors_middleware(allowed_origins: &'static str) -> Middleware { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `demo_middleware_integration` is never used [INFO] [stdout] --> src/web/middleware_demo.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn demo_middleware_integration() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `make_http_request` is never used [INFO] [stdout] --> src/web/end_to_end_middleware_tests.rs:34:8 [INFO] [stdout] | [INFO] [stdout] 34 | fn make_http_request(url: &str) -> Result> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `responses_only` is never used [INFO] [stdout] --> src/middleware/builtin.rs:144:12 [INFO] [stdout] | [INFO] [stdout] 125 | impl LoggerMiddleware { [INFO] [stdout] | --------------------- associated function in this implementation [INFO] [stdout] ... [INFO] [stdout] 144 | pub fn responses_only() -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `secret` is never read [INFO] [stdout] --> src/middleware/builtin.rs:287:5 [INFO] [stdout] | [INFO] [stdout] 286 | pub struct AuthMiddleware { [INFO] [stdout] | -------------- field in this struct [INFO] [stdout] 287 | secret: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/lib.rs:49:12 [INFO] [stdout] | [INFO] [stdout] 49 | if ZIG_HANDLERS.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/lib.rs:57:14 [INFO] [stdout] | [INFO] [stdout] 57 | unsafe { ZIG_HANDLERS.clone() } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/web/middleware_demo.rs:38:55 [INFO] [stdout] | [INFO] [stdout] 38 | ctx.set_data("request_count".to_string(), COUNTER.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> src/web/middleware_demo.rs:39:48 [INFO] [stdout] | [INFO] [stdout] 39 | println!(" -> 处理第 {} 个请求: {} {}", COUNTER, ctx.request.method.as_str(), ctx.request.path); [INFO] [stdout] | ^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `test` profile [unoptimized + debuginfo] target(s) in 6.02s [INFO] running `Command { std: "docker" "inspect" "e16495ca3fa29d0d0ea566dd961daedab148866b9c802b4a8c03b1a9e9dd67f3", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e16495ca3fa29d0d0ea566dd961daedab148866b9c802b4a8c03b1a9e9dd67f3", kill_on_drop: false }` [INFO] [stdout] e16495ca3fa29d0d0ea566dd961daedab148866b9c802b4a8c03b1a9e9dd67f3