diff --git a/CHANGELOG.md b/CHANGELOG.md index 0efec250..1fcdbd0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## Upcoming version + +- [[#266](https://github.com/rust-vmm/vm-memory/pull/266)] Derive `Debug` for several + types that were missing it. + ## [v0.13.1] ### Added diff --git a/coverage_config_x86_64.json b/coverage_config_x86_64.json index 33cef401..58b5f3e9 100644 --- a/coverage_config_x86_64.json +++ b/coverage_config_x86_64.json @@ -1,5 +1,5 @@ { - "coverage_score": 86.72, + "coverage_score": 86.07, "exclude_path": "mmap_windows.rs", "crate_features": "backend-mmap,backend-atomic,backend-bitmap" } diff --git a/src/atomic.rs b/src/atomic.rs index ae102245..4b20b2c4 100644 --- a/src/atomic.rs +++ b/src/atomic.rs @@ -124,6 +124,7 @@ impl Deref for GuestMemoryLoadGuard { /// this structure is dropped (falls out of scope) the lock will be unlocked, /// possibly after updating the memory map represented by the /// `GuestMemoryAtomic` that created the guard. +#[derive(Debug)] pub struct GuestMemoryExclusiveGuard<'a, M: GuestMemory> { parent: &'a GuestMemoryAtomic, _guard: MutexGuard<'a, ()>, diff --git a/src/lib.rs b/src/lib.rs index ca1870f8..6688b1d6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,6 +18,7 @@ #![deny(clippy::doc_markdown)] #![deny(missing_docs)] +#![deny(missing_debug_implementations)] #[macro_use] pub mod address; diff --git a/src/mmap.rs b/src/mmap.rs index f0bc5d9c..ebd84a05 100644 --- a/src/mmap.rs +++ b/src/mmap.rs @@ -616,6 +616,7 @@ impl GuestMemoryMmap { /// An iterator over the elements of `GuestMemoryMmap`. /// /// This struct is created by `GuestMemory::iter()`. See its documentation for more. +#[derive(Debug)] pub struct Iter<'a, B>(std::slice::Iter<'a, Arc>>); impl<'a, B> Iterator for Iter<'a, B> { diff --git a/src/mmap_unix.rs b/src/mmap_unix.rs index c1d1adb2..b0001821 100644 --- a/src/mmap_unix.rs +++ b/src/mmap_unix.rs @@ -52,6 +52,7 @@ pub enum Error { pub type Result = result::Result; /// A factory struct to build `MmapRegion` objects. +#[derive(Debug)] pub struct MmapRegionBuilder { size: usize, prot: i32, diff --git a/src/volatile_memory.rs b/src/volatile_memory.rs index 5ad0ab27..9e394f84 100644 --- a/src/volatile_memory.rs +++ b/src/volatile_memory.rs @@ -302,6 +302,7 @@ impl<'a> From<&'a mut [u8]> for VolatileSlice<'a, ()> { struct Packed(T); /// A guard to perform mapping and protect unmapping of the memory. +#[derive(Debug)] pub struct PtrGuard { addr: *mut u8, len: usize, @@ -347,6 +348,7 @@ impl PtrGuard { } /// A mutable guard to perform mapping and protect unmapping of the memory. +#[derive(Debug)] pub struct PtrGuardMut(PtrGuard); #[allow(clippy::len_without_is_empty)]