mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00
macros: improve select! error message (#3352)
Co-authored-by: Alice Ryhl <alice@ryhl.io>
This commit is contained in:
parent
770044caa7
commit
0048d43713
@ -446,7 +446,7 @@ macro_rules! select {
|
|||||||
|
|
||||||
(@ { $($t:tt)* } ) => {
|
(@ { $($t:tt)* } ) => {
|
||||||
// No `else` branch
|
// 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 $(,)?) => {
|
(@ { $($t:tt)* } else => $else:expr $(,)?) => {
|
||||||
$crate::select!(@{ $($t)*; $else })
|
$crate::select!(@{ $($t)*; $else })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user