cpubits: single 16 => { ... } macro arm fails expansion with error: no rules expected ','
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず 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分
- マージ済み PR(30日)
- 31
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信
RustCrypto/utils の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
max-sixty/worktrunk#4727 · コメント 7 件 · リアクション 1 件 ·
メンテナーはふだん 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 日以内に返信