File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -531,8 +531,10 @@ impl Sub<PhysAddr> for PhysAddr {
531531
532532/// Align address downwards.
533533///
534- /// Returns the greatest x with alignment `align` so that x <= addr. The alignment must be
535- /// a power of 2.
534+ /// Returns the greatest `x` with alignment `align` so that `x <= addr`.
535+ ///
536+ /// Panics if the alignment is not a power of two. Without the `const_fn`
537+ /// feature, the panic message will be "index out of bounds".
536538#[ inline]
537539pub const fn align_down ( addr : u64 , align : u64 ) -> u64 {
538540 const_assert ! ( align. is_power_of_two( ) , "`align` must be a power of two" ) ;
@@ -541,8 +543,10 @@ pub const fn align_down(addr: u64, align: u64) -> u64 {
541543
542544/// Align address upwards.
543545///
544- /// Returns the smallest x with alignment `align` so that x >= addr. The alignment must be
545- /// a power of 2.
546+ /// Returns the smallest `x` with alignment `align` so that `x >= addr`.
547+ ///
548+ /// Panics if the alignment is not a power of two. Without the `const_fn`
549+ /// feature, the panic message will be "index out of bounds".
546550#[ inline]
547551pub const fn align_up ( addr : u64 , align : u64 ) -> u64 {
548552 const_assert ! ( align. is_power_of_two( ) , "`align` must be a power of two" ) ;
Original file line number Diff line number Diff line change @@ -141,7 +141,8 @@ impl GlobalDescriptorTable {
141141 const_fn ! {
142142 /// Adds the given segment descriptor to the GDT, returning the segment selector.
143143 ///
144- /// Panics if the GDT has no free entries left.
144+ /// Panics if the GDT has no free entries left. Without the `const_fn`
145+ /// feature, the panic message will be "index out of bounds".
145146 #[ inline]
146147 pub fn add_entry( & mut self , entry: Descriptor ) -> SegmentSelector {
147148 let index = match entry {
You can’t perform that action at this time.
0 commit comments