Auto merge of #5086 - Areredify:issue-3746, r=phansch

don't fire `empty_loop` in `no_std` crates

closes #3746.
changelog: move no_std detection to utils, don't fire empty_loop in no_std crates
This commit is contained in:
bors
2020-01-24 21:42:46 +00:00
4 changed files with 39 additions and 15 deletions

22
tests/ui/issue-3746.rs Normal file
View File

@@ -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() {}