-
-
Notifications
You must be signed in to change notification settings - Fork 121
Closed
Description
Code like this fails to compile, while it compiles with std panic!().
let foo: u32 = match version {
4 => 123,
5 => 456,
_ => defmt::panic!("unknown version {:?}", version),
};error: macro expansion ignores token `;` and any following
--> firmware/qemu/src/bin/panic.rs:14:14
|
14 | _ => defmt::panic!("unknown version {:?}", version),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^- help: you might be missing a semicolon here: `;`
| |
| caused by the macro expansion here
|
= note: the usage of `defmt::panic!` is likely invalid in expression context
error[E0308]: mismatched types
--> firmware/qemu/src/bin/panic.rs:14:14
|
14 | _ => defmt::panic!("unknown version {:?}", version),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `()`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels