summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/empty_loop_no_std.rs
blob: e742b396fcde080256206a9523a65281e788e636 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// compile-flags: -Clink-arg=-nostartfiles
// ignore-macos

#![warn(clippy::empty_loop)]
#![feature(lang_items, start, libc)]
#![no_std]

use core::panic::PanicInfo;

#[start]
fn main(argc: isize, argv: *const *const u8) -> isize {
    // This should trigger the lint
    loop {}
}

#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
    // This should NOT trigger the lint
    loop {}
}

#[lang = "eh_personality"]
extern "C" fn eh_personality() {
    // This should also trigger the lint
    loop {}
}