From 8f2b0a1dcb85343158301c46160ee4f41b9baf3f Mon Sep 17 00:00:00 2001 From: YoursFunny Date: Fri, 14 Aug 2026 19:00:00 +0800 Subject: [PATCH] docs: note AFIT dyn retest on rustc 1.97.1 --- docs/site-registry-refactor.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/site-registry-refactor.md b/docs/site-registry-refactor.md index ea722d1..448b9c7 100644 --- a/docs/site-registry-refactor.md +++ b/docs/site-registry-refactor.md @@ -156,11 +156,12 @@ static SITES: LazyLock>> = LazyLock::new(|| vec![ **async 形态**(实施结论):**原生 AFIT 不可行**。 -- 实测(rustc 1.95.0,edition 2024):trait 里写 `async fn` 报 - "method is `async`"(非 dyn 兼容);写反糖 `-> impl Future<...> + Send + '_` - 报 "references an `impl Trait` type in its return type"(同样非 dyn 兼容); - 纯 RPITIT(无 `+ Send`)也一样。即:**RPITIT/AFIT 目前无法用于 - `Vec>` 注册表**,与早期设计的判断相反。 +- 实测(rustc 1.95.0,edition 2024;**1.97.1 复测一致**):trait 里写 + `async fn` 报 "method is `async`"(非 dyn 兼容);写反糖 + `-> impl Future<...> + Send + '_` 报 "references an `impl Trait` type in its + return type"(同样非 dyn 兼容);纯 RPITIT(无 `+ Send`)也一样。即: + **RPITIT/AFIT 目前无法用于 `Vec>` 注册表**,与早期设计的 + 判断相反。 - **为什么**:dyn 分派要求调用方在编译期知道返回值大小以分配空间,而 `async fn`/RPITIT 返回不透明的 Future——这是"非定长返回值走 dyn"的普遍问题, 与 async 无关。Rust 1.75 稳定的 AFIT 只覆盖**静态分派**,dyn 路径被排除;