From bb167fb4108fddd713105e1ce28fdfe2413fb651 Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Fri, 28 Aug 2026 11:47:10 +0100 Subject: [PATCH] DOC-7012 Declare futures-util so rust-async cmds_generic compiles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `run_rust_async`'s Cargo.toml deps string never declared `futures-util`, so `cargo test` failed with `unresolved import futures_util` wherever an example calls `.collect().await` on an `AsyncIter` (needs `StreamExt` in scope). cmds_generic's rust-async example already imports `futures_util::StreamExt` correctly for its four scan steps — the crate itself was just never wired into the harness. This was mischaracterized on DOC-6968 as "async iteration API drift in the pinned redis-rs." It isn't: the example's own import was already correct, and redis-rs's `AsyncIter` hasn't changed shape. It's a plain missing dependency in the harness's own Cargo.toml template. Regression-checked every other rust-async set. cmds_stream and client-specific still fail, both for reasons unrelated to this fix: the ambient local Redis 7.2.7 doesn't support IDMP (cmds_stream's xadd2, same gap as DOC-7011's HEXPIRE/FT.CREATE/TS.CREATE case), and client-specific needs the redis crate's `json` feature plus `serde_json`, neither declared here (RedisJSON support, out of scope for this ticket). Learned: rust_run only writes work/rust-async/Cargo.toml if it doesn't already exist, so a deps-string edit in run.sh needs the cached Cargo.toml (and Cargo.lock) deleted before the new dependency takes effect — same caching trap as the Java pom.xml one already in memory, just for Cargo instead of Maven Constraint: Cargo.toml uses the hyphenated crate name `futures-util`; Rust source imports it as `futures_util` (underscore) — Cargo translates automatically, don't "fix" the hyphen to match the import Gaps: client-specific/rust-async fails on missing JsonAsyncCommands/serde_json (RedisJSON support never wired into this harness) — separate issue, worth its own ticket if RedisJSON rust-async examples are added later Ticket: DOC-7012 --- build/example-test-harness/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/example-test-harness/run.sh b/build/example-test-harness/run.sh index d79afddfbd..3adf12f665 100755 --- a/build/example-test-harness/run.sh +++ b/build/example-test-harness/run.sh @@ -386,7 +386,8 @@ run_go() { } run_rust_sync() { rust_run "$WORK/rust-sync" "$1" 'redis = "1.3"' ; } run_rust_async(){ rust_run "$WORK/rust-async" "$1" 'redis = { version = "1.3", features = ["tokio-comp"] } -tokio = { version = "1", features = ["macros", "rt-multi-thread"] }' ; } +tokio = { version = "1", features = ["macros", "rt-multi-thread"] } +futures-util = "0.3"' ; } rust_run() { local d="$1" src="$2" deps="$3"; mkdir -p "$d/src" if [ ! -f "$d/Cargo.toml" ]; then