]> git.lizzy.rs Git - rust.git/blob - tests/ui/empty_loop_no_std.rs
Improved shared_code_in_if_blocks message and added test stderrs
[rust.git] / tests / ui / empty_loop_no_std.rs
1 // ignore-macos
2 // ignore-windows
3
4 #![warn(clippy::empty_loop)]
5 #![feature(lang_items, link_args, start, libc)]
6 #![link_args = "-nostartfiles"]
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 }