diff options
| author | Joe Richey <joerichey@google.com> | 2020-10-11 16:04:33 -0700 |
|---|---|---|
| committer | Joe Richey <joerichey@google.com> | 2020-10-22 22:03:13 -0700 |
| commit | 3807634a470b572303d95feb8a5db273c7cea4af (patch) | |
| tree | 962e0d816220f4277f6529f664e22911123160f6 /tests/ui/empty_loop_no_std.rs | |
| parent | fbe75a84978c1cf7441f044bb4f80346602445c1 (diff) | |
clippy_lints: Update empty_loop lint
We also update the documentation to note that the remediations are different for `std` and `no_std` crates. Signed-off-by: Joe Richey <joerichey@google.com>
Diffstat (limited to 'tests/ui/empty_loop_no_std.rs')
| -rw-r--r-- | tests/ui/empty_loop_no_std.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/empty_loop_no_std.rs b/tests/ui/empty_loop_no_std.rs new file mode 100644 index 00000000000..879d1d5d916 --- /dev/null +++ b/tests/ui/empty_loop_no_std.rs @@ -0,0 +1,22 @@ +// ignore-macos +// ignore-windows + +#![warn(clippy::empty_loop)] +#![feature(lang_items, link_args, start, libc)] +#![link_args = "-nostartfiles"] +#![no_std] + +use core::panic::PanicInfo; + +#[start] +fn main(argc: isize, argv: *const *const u8) -> isize { + loop {} +} + +#[panic_handler] +fn panic(_info: &PanicInfo) -> ! { + loop {} +} + +#[lang = "eh_personality"] +extern "C" fn eh_personality() {} |
