Skip to content

Commit c79a603

Browse files
committed
build: Fix clippy failures
Signed-off-by: Akira Moroo <retrage01@gmail.com>
1 parent 40d07f3 commit c79a603

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

src/efi/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// Copyright © 2019 Intel Corporation
33

4+
#[cfg(all(not(test), not(feature = "integration_tests")))]
5+
use core::alloc as heap_alloc;
6+
47
use core::{
5-
alloc as heap_alloc,
68
ffi::c_void,
79
mem::{size_of, transmute},
810
ptr::null_mut,
@@ -65,7 +67,7 @@ pub static ALLOCATOR: AtomicRefCell<Allocator> = AtomicRefCell::new(Allocator::n
6567
#[global_allocator]
6668
pub static HEAP_ALLOCATOR: LockedHeap = LockedHeap::empty();
6769

68-
#[cfg(not(test))]
70+
#[cfg(all(not(test), not(feature = "integration_tests")))]
6971
#[alloc_error_handler]
7072
fn heap_alloc_error_handler(layout: heap_alloc::Layout) -> ! {
7173
panic!("heap allocation error: {:?}", layout);

src/main.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,27 @@
22
// Copyright © 2019 Intel Corporation
33

44
#![feature(asm_const)]
5-
#![feature(alloc_error_handler)]
65
#![feature(slice_take)]
76
#![feature(stdsimd)]
87
#![feature(stmt_expr_attributes)]
98
#![cfg_attr(not(test), no_std)]
109
#![cfg_attr(not(test), no_main)]
10+
#![cfg_attr(
11+
all(not(test), not(feature = "integration_tests")),
12+
feature(alloc_error_handler)
13+
)]
1114
#![cfg_attr(test, allow(unused_imports, dead_code))]
1215
#![cfg_attr(not(feature = "log-serial"), allow(unused_variables, unused_imports))]
1316

17+
#[cfg(all(not(test), not(feature = "integration_tests")))]
1418
use core::panic::PanicInfo;
1519

16-
#[cfg(target_arch = "x86_64")]
20+
#[cfg(all(
21+
not(test),
22+
not(feature = "integration_tests"),
23+
target_arch = "x86_64",
24+
feature = "log-panic"
25+
))]
1726
use x86_64::instructions::hlt;
1827

1928
#[cfg(target_arch = "aarch64")]
@@ -60,7 +69,7 @@ mod uart_mmio;
6069
mod uart_pl011;
6170
mod virtio;
6271

63-
#[cfg(all(not(test), feature = "log-panic"))]
72+
#[cfg(all(not(test), not(feature = "integration_tests"), feature = "log-panic"))]
6473
#[panic_handler]
6574
fn panic(info: &PanicInfo) -> ! {
6675
log!("PANIC: {}", info);
@@ -70,7 +79,11 @@ fn panic(info: &PanicInfo) -> ! {
7079
}
7180
}
7281

73-
#[cfg(all(not(test), not(feature = "log-panic")))]
82+
#[cfg(all(
83+
not(test),
84+
not(feature = "integration_tests"),
85+
not(feature = "log-panic")
86+
))]
7487
#[panic_handler]
7588
fn panic(_: &PanicInfo) -> ! {
7689
loop {}

0 commit comments

Comments
 (0)