diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-07-18 11:36:15 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-07-18 11:36:15 +0000 |
| commit | 5236df97c65fb30885d0304cdbca3d92986ac8bb (patch) | |
| tree | dcfcb2fd9aeaabae8b4a2c4e8255813f9e8c2504 /embassy-sync/src | |
| parent | e54c753537b4b12c3d2fd03ad8e8ba9eaaded06e (diff) | |
| parent | 255864f46c1eac35333b5173f88df221a645abfc (diff) | |
Merge pull request #3193 from taaki2311/main
Reduced the definition for 'unreachable!' to a single macro rule
Diffstat (limited to 'embassy-sync/src')
| -rw-r--r-- | embassy-sync/src/fmt.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/embassy-sync/src/fmt.rs b/embassy-sync/src/fmt.rs index 35b929fde..8ca61bc39 100644 --- a/embassy-sync/src/fmt.rs +++ b/embassy-sync/src/fmt.rs | |||
| @@ -90,19 +90,15 @@ macro_rules! todo { | |||
| 90 | }; | 90 | }; |
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | #[cfg(not(feature = "defmt"))] | ||
| 94 | #[collapse_debuginfo(yes)] | ||
| 95 | macro_rules! unreachable { | ||
| 96 | ($($x:tt)*) => { | ||
| 97 | ::core::unreachable!($($x)*) | ||
| 98 | }; | ||
| 99 | } | ||
| 100 | |||
| 101 | #[cfg(feature = "defmt")] | ||
| 102 | #[collapse_debuginfo(yes)] | 93 | #[collapse_debuginfo(yes)] |
| 103 | macro_rules! unreachable { | 94 | macro_rules! unreachable { |
| 104 | ($($x:tt)*) => { | 95 | ($($x:tt)*) => { |
| 105 | ::defmt::unreachable!($($x)*) | 96 | { |
| 97 | #[cfg(not(feature = "defmt"))] | ||
| 98 | ::core::unreachable!($($x)*); | ||
| 99 | #[cfg(feature = "defmt")] | ||
| 100 | ::defmt::unreachable!($($x)*); | ||
| 101 | } | ||
| 106 | }; | 102 | }; |
| 107 | } | 103 | } |
| 108 | 104 | ||
