diff --git a/Changelog.md b/Changelog.md index 187cc5d9..cc926ce0 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,8 @@ - [make `OffsetPageTable` a type alias](https://github.com/rust-osdev/x86_64/pull/576) - To migrate, replace `OffsetPageTable::new` with `OffsetPageTable::from_phys_offset` or `MappedPageTable::from_phys_offset`. - `OffsetPageTable`'s `PageTableFrameMapping` implementation is now public as `PhysOffset`. +- [make range types `!Copy`](https://github.com/rust-osdev/x86_64/pull/581) + - To migrate, use `.clone()` if necessary. # 0.15.4 – 2025-11-24 diff --git a/src/instructions/tlb.rs b/src/instructions/tlb.rs index d96cc895..911a80e6 100644 --- a/src/instructions/tlb.rs +++ b/src/instructions/tlb.rs @@ -314,7 +314,7 @@ where /// Execute the flush. pub fn flush(&self) { - if let Some(mut pages) = self.page_range { + if let Some(mut pages) = self.page_range.clone() { while !pages.is_empty() { // Calculate out how many pages we still need to flush. let count = Page::::steps_between_impl(&pages.start, &pages.end).0; diff --git a/src/structures/paging/frame.rs b/src/structures/paging/frame.rs index c4a8c97a..2961e977 100644 --- a/src/structures/paging/frame.rs +++ b/src/structures/paging/frame.rs @@ -133,7 +133,7 @@ impl Sub> for PhysFrame { } /// An range of physical memory frames, exclusive the upper bound. -#[derive(Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, PartialEq, Eq, Hash)] #[repr(C)] pub struct PhysFrameRange { /// The start of the range, inclusive. @@ -191,7 +191,7 @@ impl fmt::Debug for PhysFrameRange { } /// An range of physical memory frames, inclusive the upper bound. -#[derive(Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, PartialEq, Eq, Hash)] #[repr(C)] pub struct PhysFrameRangeInclusive { /// The start of the range, inclusive. diff --git a/src/structures/paging/page.rs b/src/structures/paging/page.rs index a51b4df4..d0e19b4c 100644 --- a/src/structures/paging/page.rs +++ b/src/structures/paging/page.rs @@ -325,7 +325,7 @@ impl Step for Page { } /// A range of pages with exclusive upper bound. -#[derive(Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, PartialEq, Eq, Hash)] #[repr(C)] pub struct PageRange { /// The start of the range, inclusive. @@ -394,7 +394,7 @@ impl fmt::Debug for PageRange { } /// A range of pages with inclusive upper bound. -#[derive(Clone, Copy, PartialEq, Eq, Hash)] +#[derive(Clone, PartialEq, Eq, Hash)] #[repr(C)] pub struct PageRangeInclusive { /// The start of the range, inclusive.