Skip to content

Commit e0c5679

Browse files
committed
fix PhysAddr::align_up
1 parent e58e5e1 commit e0c5679

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/addr.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,12 +483,17 @@ impl PhysAddr {
483483
/// Aligns the physical address upwards to the given alignment.
484484
///
485485
/// See the `align_up` function for more information.
486+
///
487+
/// # Panics
488+
///
489+
/// This function panics if the resulting address has a bit in the range 52
490+
/// to 64 set.
486491
#[inline]
487492
pub fn align_up<U>(self, align: U) -> Self
488493
where
489494
U: Into<u64>,
490495
{
491-
PhysAddr(align_up(self.0, align.into()))
496+
PhysAddr::new(align_up(self.0, align.into()))
492497
}
493498

494499
/// Aligns the physical address downwards to the given alignment.

0 commit comments

Comments
 (0)