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