cpubits: single 16 => { ... } macro arm fails expansion with error: no rules expected ','
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先找到 crate cpubits 中宏 cpubits! 的定义,并将 16 => { ... } 的展开路径与可正常工作的单分支形式 32 和 64 进行比较。首先要编译的是 issue 中的复现用例;当它能够编译,且列出的可正常工作形式仍能编译时,任务就算完成。
由索引模型根据 Issue 内容生成。
描述
Component
cpubits (v0.1.1)
Description
Calling the cpubits! macro with only the 16-bit branch (single 16) fails to expand at compile time with a syntax error. Other single-branch forms (32 => { ... } and 64 => { ... }), pairs, and the full triple compile as expected.
Minimal Reproduction Example
use cpubits::cpubits;
cpubits! {
16 => {
pub type Word = u16;
}
}
fn main() {}
Compiler Output
error: no rules expected `,`
--> src/main.rs:3:1
|
3 | / cpubits! {
4 | | 16 => {
5 | | pub type Word = u16;
6 | | }
7 | | }
| |_^ no rules expected this token in macro call
|
= note: this error originates in the macro `cpubits::cpubits`
Root Cause
During macro expansion of the single 16 => { ... } pattern, the macro inserts a comma after its first generated branch, but the internal two-branch/downstream matcher in cpubits! does not accept a comma at that position.
Observed shapes probe results:
single16: ❌exit 1(error: no rules expected ',')single32: ✅exit 0single64: ✅exit 0group16_32: ✅exit 0group32_64: ✅exit 0pair16_32: ✅exit 0pair32_64: ✅exit 0triple: ✅exit 0
- 主要语言
- Rust
- 星标
- 688
- 派生
- 177
- 平均合并
- 2 小时 31 分钟
- 30 天内合并 PR
- 31
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RustCrypto/utils 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
RustCrypto/utils#1555 · 3 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
RustCrypto/utils#1546 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 59/100
RustCrypto/utils#1589 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 42/100
RustCrypto/utils#1562 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
RustCrypto/utils#1537 · 7 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
max-sixty/worktrunk#4727 · 7 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
follow-up
难度 2/5 1-3 小时 新手友好度 73/100
carrick-sh/carrick#1859 ·
维护者通常 1 天内回复
-
crate: spate-kafka documentation priority: medium
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复