]> git.lizzy.rs Git - rust.git/blob - tests/ui/empty_loop_no_std.rs
Auto merge of #88214 - notriddle:notriddle/for-loop-span-drop-temps-mut, r=nagisa
[rust.git] / tests / ui / empty_loop_no_std.rs
1 // compile-flags: -Clink-arg=-nostartfiles
2 // ignore-macos
3 // ignore-windows
4
5 #![warn(clippy::empty_loop)]
6 #![feature(lang_items, start, libc)]
7 #![no_std]
8
9 use core::panic::PanicInfo;
10
11 #[start]
12 fn main(argc: isize, argv: *const *const u8) -> isize {
13     // This should trigger the lint
14     loop {}
15 }
16
17 #[panic_handler]
18 fn panic(_info: &PanicInfo) -> ! {
19     // This should NOT trigger the lint
20     loop {}
21 }
22
23 #[lang = "eh_personality"]
24 extern "C" fn eh_personality() {
25     // This should also trigger the lint
26     loop {}
27 }