Skip to content

Commit e0775db

Browse files
committed
fix(no instructions): dead_code
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
1 parent e90ca7e commit e0775db

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

src/addr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ impl VirtAddr {
240240
}
241241

242242
// FIXME: Move this into the `Step` impl, once `Step` is stabilized.
243+
#[cfg(any(feature = "instructions", feature = "step_trait"))]
243244
pub(crate) fn steps_between_impl(start: &Self, end: &Self) -> Option<usize> {
244245
let mut steps = end.0.checked_sub(start.0)?;
245246

src/registers/model_specific.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use bitflags::bitflags;
66
use crate::registers::segmentation::{FS, GS};
77

88
/// A model specific register.
9+
#[cfg_attr(not(feature = "instructions"), allow(dead_code))] // FIXME
910
#[derive(Debug)]
1011
pub struct Msr(u32);
1112

src/structures/paging/mapper/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,7 @@ pub trait Mapper<S: PageSize> {
383383
/// changed the mapping of a page to ensure that the TLB flush is not forgotten.
384384
#[derive(Debug)]
385385
#[must_use = "Page Table changes must be flushed or ignored."]
386+
#[cfg_attr(not(feature = "instructions"), allow(dead_code))] // FIXME
386387
pub struct MapperFlush<S: PageSize>(Page<S>);
387388

388389
impl<S: PageSize> MapperFlush<S> {

src/structures/paging/page.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,14 @@ impl<S: PageSize> Page<S> {
159159
}
160160

161161
// FIXME: Move this into the `Step` impl, once `Step` is stabilized.
162+
#[cfg(any(feature = "instructions", feature = "step_trait"))]
162163
pub(crate) fn steps_between_impl(start: &Self, end: &Self) -> Option<usize> {
163164
VirtAddr::steps_between_impl(&start.start_address, &end.start_address)
164165
.map(|steps| steps / S::SIZE as usize)
165166
}
166167

167168
// FIXME: Move this into the `Step` impl, once `Step` is stabilized.
169+
#[cfg(any(feature = "instructions", feature = "step_trait"))]
168170
pub(crate) fn forward_checked_impl(start: Self, count: usize) -> Option<Self> {
169171
let count = count.checked_mul(S::SIZE as usize)?;
170172
let start_address = VirtAddr::forward_checked_impl(start.start_address, count)?;

0 commit comments

Comments
 (0)