'Macro_InvokeRules_MatchPattern - No arm matched' error in mrustc
Code
$ cat 2.rs
code:
macro_rules! cbor_map {
($key:expr) => {
$key.signum();
};
}
fn main() {
cbor_map! {
#[cfg(test)]
8
};
}
It seems that the macro expansion failed to match any arms in the cbor_map! macro definition.
Command
mrustc -L output-1.54.0 2.rs
Output
Setup: V V V
(0.00 s) Setup: DONE
Target Load: V V V
(0.00 s) Target Load: DONE
Parse: V V V
(0.00 s) Parse: DONE
LoadCrates: V V V
(0.39 s) LoadCrates: DONE
Expand: V V V
/home/interesting/mrustc/2.rs:11:7 BUG:src/macro_rules/eval.cpp:1920: TODO: Macro_InvokeRules_MatchPattern - No arm matched - (0, 21)
Aborted (core dumped)
Version
I build the mrustc by using build-1.54.0.sh
mrustc --version
rustc 1.29.100 (mrustc v0.10.0 master:4c7e8171)
release: 1.29.100
- Build time: Tue, 26 Sep 2023 07:36:21 +0000
- Commit: 4c7e81716493678df9fe9cac86ea9beedc57db44
Looks like :expr isn't matching attributes
Looks like
:exprisn't matching attributes
Is this an issue with the code itself or an internal error in the compiler? I initially thought it was an internal issue with the compiler when encountering the BUG statement. Of course, there are syntax errors in the code itself.
If rustc accepts that code, then it's a mrustc bug and will be addressed next time I do a push to clean up tickets.