Skip to content

Commit

Permalink
debug/stacktrace: fix unused import warnings when enable-stacktrace i…
Browse files Browse the repository at this point in the history
…s disabled

Gate unused imports behind a cfg(feature) directive.

Signed-off-by: Carlos López <carlos.lopez@suse.com>
  • Loading branch information
00xc committed Jan 24, 2024
1 parent dc48e7a commit 11640f3
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/debug/stacktrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@
//
// Author: Nicolai Stange <nstange@suse.de>

use crate::address::{Address, VirtAddr};
#[cfg(feature = "enable-stacktrace")]
use crate::cpu::idt::common::is_exception_handler_return_site;
use crate::cpu::idt::common::X86ExceptionContext;
use crate::cpu::percpu::this_cpu;
use crate::{
address::{Address, VirtAddr},
cpu::idt::common::{is_exception_handler_return_site, X86ExceptionContext},
cpu::percpu::this_cpu,
mm::address_space::STACK_SIZE,
};
#[cfg(feature = "enable-stacktrace")]
use crate::mm::address_space::STACK_SIZE;
#[cfg(feature = "enable-stacktrace")]
use core::arch::asm;
#[cfg(feature = "enable-stacktrace")]
use core::mem;
use core::{arch::asm, mem};

#[cfg(feature = "enable-stacktrace")]
#[derive(Debug, Default)]
Expand Down

0 comments on commit 11640f3

Please sign in to comment.