File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -531,8 +531,10 @@ impl Sub<PhysAddr> for PhysAddr {
531
531
532
532
/// Align address downwards.
533
533
///
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".
536
538
#[ inline]
537
539
pub const fn align_down ( addr : u64 , align : u64 ) -> u64 {
538
540
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 {
541
543
542
544
/// Align address upwards.
543
545
///
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".
546
550
#[ inline]
547
551
pub const fn align_up ( addr : u64 , align : u64 ) -> u64 {
548
552
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 {
141
141
const_fn ! {
142
142
/// Adds the given segment descriptor to the GDT, returning the segment selector.
143
143
///
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".
145
146
#[ inline]
146
147
pub fn add_entry( & mut self , entry: Descriptor ) -> SegmentSelector {
147
148
let index = match entry {
You can’t perform that action at this time.
0 commit comments