2 Checks for empty `loop` expressions.
5 These busy loops burn CPU cycles without doing
6 anything. It is _almost always_ a better idea to `panic!` than to have
9 If panicking isn't possible, think of the environment and either:
11 - sleep the thread for some microseconds
12 - yield or pause the thread
14 For `std` targets, this can be done with
15 [`std::thread::sleep`](https://doc.rust-lang.org/std/thread/fn.sleep.html)
16 or [`std::thread::yield_now`](https://doc.rust-lang.org/std/thread/fn.yield_now.html).
18 For `no_std` targets, doing this is more complicated, especially because
19 `#[panic_handler]`s can't panic. To stop/pause the thread, you will
20 probably need to invoke some target-specific intrinsic. Examples include:
21 - [`x86_64::instructions::hlt`](https://docs.rs/x86_64/0.12.2/x86_64/instructions/fn.hlt.html)
22 - [`cortex_m::asm::wfi`](https://docs.rs/cortex-m/0.6.3/cortex_m/asm/fn.wfi.html)