From eec5d2554a40f6f981beba7282b094460df361b9 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Mon, 7 Oct 2024 20:47:26 +0200 Subject: [PATCH 1/2] Break long doc paragraph --- src/instructions/mod.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/instructions/mod.rs b/src/instructions/mod.rs index 4b676c55..8018698c 100644 --- a/src/instructions/mod.rs +++ b/src/instructions/mod.rs @@ -32,8 +32,11 @@ pub fn nop() { } } -/// Emits a '[magic breakpoint](https://wiki.osdev.org/Bochs#Magic_Breakpoint)' instruction for the [Bochs](http://bochs.sourceforge.net/) CPU -/// emulator. Make sure to set `magic_break: enabled=1` in your `.bochsrc` file. +/// Emits a '[magic breakpoint](https://wiki.osdev.org/Bochs#Magic_Breakpoint)' +/// instruction for the [Bochs](http://bochs.sourceforge.net/) CPU +/// emulator. +/// +/// Make sure to set `magic_break: enabled=1` in your `.bochsrc` file. #[inline] pub fn bochs_breakpoint() { unsafe { From 1829dc13b1777c3d6c0f3d6195bd026366fb7188 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Mon, 7 Oct 2024 20:49:11 +0200 Subject: [PATCH 2/2] Elide explicit lifetimes when possible --- src/structures/paging/mapper/mapped_page_table.rs | 10 +++++----- src/structures/paging/mapper/offset_page_table.rs | 10 +++++----- src/structures/paging/mapper/recursive_page_table.rs | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/structures/paging/mapper/mapped_page_table.rs b/src/structures/paging/mapper/mapped_page_table.rs index 830b4759..b50f072e 100644 --- a/src/structures/paging/mapper/mapped_page_table.rs +++ b/src/structures/paging/mapper/mapped_page_table.rs @@ -150,7 +150,7 @@ impl<'a, P: PageTableFrameMapping> MappedPageTable<'a, P> { } } -impl<'a, P: PageTableFrameMapping> Mapper for MappedPageTable<'a, P> { +impl Mapper for MappedPageTable<'_, P> { #[inline] unsafe fn map_to_with_table_flags( &mut self, @@ -258,7 +258,7 @@ impl<'a, P: PageTableFrameMapping> Mapper for MappedPageTable<'a, P> { } } -impl<'a, P: PageTableFrameMapping> Mapper for MappedPageTable<'a, P> { +impl Mapper for MappedPageTable<'_, P> { #[inline] unsafe fn map_to_with_table_flags( &mut self, @@ -386,7 +386,7 @@ impl<'a, P: PageTableFrameMapping> Mapper for MappedPageTable<'a, P> { } } -impl<'a, P: PageTableFrameMapping> Mapper for MappedPageTable<'a, P> { +impl Mapper for MappedPageTable<'_, P> { #[inline] unsafe fn map_to_with_table_flags( &mut self, @@ -530,7 +530,7 @@ impl<'a, P: PageTableFrameMapping> Mapper for MappedPageTable<'a, P> { } } -impl<'a, P: PageTableFrameMapping> Translate for MappedPageTable<'a, P> { +impl Translate for MappedPageTable<'_, P> { #[allow(clippy::inconsistent_digit_grouping)] fn translate(&self, addr: VirtAddr) -> TranslateResult { let p4 = &self.level_4_table; @@ -594,7 +594,7 @@ impl<'a, P: PageTableFrameMapping> Translate for MappedPageTable<'a, P> { } } -impl<'a, P: PageTableFrameMapping> CleanUp for MappedPageTable<'a, P> { +impl CleanUp for MappedPageTable<'_, P> { #[inline] unsafe fn clean_up(&mut self, frame_deallocator: &mut D) where diff --git a/src/structures/paging/mapper/offset_page_table.rs b/src/structures/paging/mapper/offset_page_table.rs index 37c9cca2..6fb86e79 100644 --- a/src/structures/paging/mapper/offset_page_table.rs +++ b/src/structures/paging/mapper/offset_page_table.rs @@ -65,7 +65,7 @@ unsafe impl PageTableFrameMapping for PhysOffset { // delegate all trait implementations to inner -impl<'a> Mapper for OffsetPageTable<'a> { +impl Mapper for OffsetPageTable<'_> { #[inline] unsafe fn map_to_with_table_flags( &mut self, @@ -134,7 +134,7 @@ impl<'a> Mapper for OffsetPageTable<'a> { } } -impl<'a> Mapper for OffsetPageTable<'a> { +impl Mapper for OffsetPageTable<'_> { #[inline] unsafe fn map_to_with_table_flags( &mut self, @@ -203,7 +203,7 @@ impl<'a> Mapper for OffsetPageTable<'a> { } } -impl<'a> Mapper for OffsetPageTable<'a> { +impl Mapper for OffsetPageTable<'_> { #[inline] unsafe fn map_to_with_table_flags( &mut self, @@ -272,14 +272,14 @@ impl<'a> Mapper for OffsetPageTable<'a> { } } -impl<'a> Translate for OffsetPageTable<'a> { +impl Translate for OffsetPageTable<'_> { #[inline] fn translate(&self, addr: VirtAddr) -> TranslateResult { self.inner.translate(addr) } } -impl<'a> CleanUp for OffsetPageTable<'a> { +impl CleanUp for OffsetPageTable<'_> { #[inline] unsafe fn clean_up(&mut self, frame_deallocator: &mut D) where diff --git a/src/structures/paging/mapper/recursive_page_table.rs b/src/structures/paging/mapper/recursive_page_table.rs index 1e8a3b18..ff427ffa 100644 --- a/src/structures/paging/mapper/recursive_page_table.rs +++ b/src/structures/paging/mapper/recursive_page_table.rs @@ -299,7 +299,7 @@ impl<'a> RecursivePageTable<'a> { } } -impl<'a> Mapper for RecursivePageTable<'a> { +impl Mapper for RecursivePageTable<'_> { #[inline] unsafe fn map_to_with_table_flags( &mut self, @@ -419,7 +419,7 @@ impl<'a> Mapper for RecursivePageTable<'a> { } } -impl<'a> Mapper for RecursivePageTable<'a> { +impl Mapper for RecursivePageTable<'_> { #[inline] unsafe fn map_to_with_table_flags( &mut self, @@ -574,7 +574,7 @@ impl<'a> Mapper for RecursivePageTable<'a> { } } -impl<'a> Mapper for RecursivePageTable<'a> { +impl Mapper for RecursivePageTable<'_> { #[inline] unsafe fn map_to_with_table_flags( &mut self, @@ -763,7 +763,7 @@ impl<'a> Mapper for RecursivePageTable<'a> { } } -impl<'a> Translate for RecursivePageTable<'a> { +impl Translate for RecursivePageTable<'_> { #[allow(clippy::inconsistent_digit_grouping)] fn translate(&self, addr: VirtAddr) -> TranslateResult { let page = Page::containing_address(addr); @@ -836,7 +836,7 @@ impl<'a> Translate for RecursivePageTable<'a> { } } -impl<'a> CleanUp for RecursivePageTable<'a> { +impl CleanUp for RecursivePageTable<'_> { #[inline] unsafe fn clean_up(&mut self, frame_deallocator: &mut D) where