Skip to content

Commit e7a2c50

Browse files
00xcandreeaflorescu
authored andcommitted
Add missing Debug derives
Add free Debug derives plus a lint to prevent future issues. Signed-off-by: Carlos López <[email protected]>
1 parent be4bff8 commit e7a2c50

File tree

6 files changed

+11
-0
lines changed

6 files changed

+11
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## Upcoming version
4+
5+
- [[#266](https://github.com/rust-vmm/vm-memory/pull/266)] Derive `Debug` for several
6+
types that were missing it.
7+
38
## [v0.13.1]
49

510
### Added

src/atomic.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ impl<M: GuestMemory> Deref for GuestMemoryLoadGuard<M> {
124124
/// this structure is dropped (falls out of scope) the lock will be unlocked,
125125
/// possibly after updating the memory map represented by the
126126
/// `GuestMemoryAtomic` that created the guard.
127+
#[derive(Debug)]
127128
pub struct GuestMemoryExclusiveGuard<'a, M: GuestMemory> {
128129
parent: &'a GuestMemoryAtomic<M>,
129130
_guard: MutexGuard<'a, ()>,

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
1919
#![deny(clippy::doc_markdown)]
2020
#![deny(missing_docs)]
21+
#![deny(missing_debug_implementations)]
2122

2223
#[macro_use]
2324
pub mod address;

src/mmap.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ impl<B: Bitmap> GuestMemoryMmap<B> {
616616
/// An iterator over the elements of `GuestMemoryMmap`.
617617
///
618618
/// This struct is created by `GuestMemory::iter()`. See its documentation for more.
619+
#[derive(Debug)]
619620
pub struct Iter<'a, B>(std::slice::Iter<'a, Arc<GuestRegionMmap<B>>>);
620621

621622
impl<'a, B> Iterator for Iter<'a, B> {

src/mmap_unix.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ pub enum Error {
5252
pub type Result<T> = result::Result<T, Error>;
5353

5454
/// A factory struct to build `MmapRegion` objects.
55+
#[derive(Debug)]
5556
pub struct MmapRegionBuilder<B = ()> {
5657
size: usize,
5758
prot: i32,

src/volatile_memory.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ impl<'a> From<&'a mut [u8]> for VolatileSlice<'a, ()> {
302302
struct Packed<T>(T);
303303

304304
/// A guard to perform mapping and protect unmapping of the memory.
305+
#[derive(Debug)]
305306
pub struct PtrGuard {
306307
addr: *mut u8,
307308
len: usize,
@@ -347,6 +348,7 @@ impl PtrGuard {
347348
}
348349

349350
/// A mutable guard to perform mapping and protect unmapping of the memory.
351+
#[derive(Debug)]
350352
pub struct PtrGuardMut(PtrGuard);
351353

352354
#[allow(clippy::len_without_is_empty)]

0 commit comments

Comments
 (0)