Component bindgen fails when a parameter or field is named `b`
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
该错误位于 src/hyperlight_component_util/src/hl.rs 中的代码生成器里:解码器把字节计数存放在名为 b 的局部变量中,而这与名为 b 的 WIT 参数或字段发生冲突。issue 将第 64 行链接为第一处出现位置。请使用 host_bindgen! 配合 issue 中的 WIT 片段进行复现,然后在 hl.rs 中找出其他沿用这一模式的计数器局部变量。当 WIT 名称为 b 时生成的代码能够编译,并且计数器改用从 id 派生的名称,即视为完成。
由索引模型根据 Issue 内容生成。
描述
host_bindgen! output doesn't compile when a WIT parameter or record field is named b:
package a:b;
world w { export f: func(a: u32, b: string) -> u32; }
error[E0608]: cannot index into a value of type `usize`
let b_field = &r#b[b_cursor..];
The generated decoder stores byte counts in a local named b, for example at hl.rs#L64. The WIT name b becomes the identifier r#b, which is the same name, so the counter shadows the value. The same pattern appears in several other places in hl.rs.
The counters need names that can't collide with WIT names, for example derived from id as other temporaries are.
- 主要语言
- Rust
- 星标
- 4.7k
- 派生
- 217
- 平均合并
- 2 天 55 分钟
- 30 天内合并 PR
- 56
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
hyperlight-dev/hyperlight 的其他 Issue
-
lifecycle/needs-review
难度 2/5 1-3 小时 新手友好度 78/100
hyperlight-dev/hyperlight#1939 ·
维护者通常 1 天内回复
-
lifecycle/needs-review
难度 2/5 1-3 小时 新手友好度 68/100
hyperlight-dev/hyperlight#1842 ·
维护者通常 1 天内回复
-
lifecycle/needs-review
难度 2/5 1-3 小时 新手友好度 72/100
hyperlight-dev/hyperlight#1836 ·
维护者通常 1 天内回复
-
Remove `UninitializedSandbox` and `SandboxConfiguration` from the public API可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭lifecycle/needs-review
难度 2/5 1-3 小时 新手友好度 68/100
hyperlight-dev/hyperlight#1804 ·
维护者通常 1 天内回复
-
lifecycle/confirmed
难度 2/5 1-3 小时 新手友好度 65/100
hyperlight-dev/hyperlight#1700 · 2 条评论 ·
维护者通常 1 天内回复
查看 hyperlight-dev/hyperlight 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 82/100
521xueweihan/HelloGitHub#4023 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
nautechsystems/nautilus_trader#5365 ·
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 78/100
IntersectMBO/developer-experience#347 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
registrystack/registry-stack#2168 ·
维护者通常 1 天内回复
-
bug crate: 3d help wanted triage
难度 2/5 1-3 小时 新手友好度 78/100
kornia/kornia-rs#1203 · 1 条评论 ·
维护者通常 1 天内回复