macros: improve select! error message (#3352)

Co-authored-by: Alice Ryhl <[email protected]>
This commit is contained in:
zhongjn
2020-12-27 23:50:32 +09:00
committed by GitHub
co-authored by Alice Ryhl
parent 770044caa7
commit 0048d43713
+1 -1
View File
@@ -446,7 +446,7 @@ macro_rules! select {
(@ { $($t:tt)* } ) => {
// No `else` branch
$crate::select!(@{ $($t)*; unreachable!() })
$crate::select!(@{ $($t)*; panic!("all branches are disabled and there is no else branch") })
};
(@ { $($t:tt)* } else => $else:expr $(,)?) => {
$crate::select!(@{ $($t)*; $else })