Skip to content

Commit d8867e2

Browse files
committed
chore: cleanup.
1 parent dc7c02a commit d8867e2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tasks/ast_codegen/src/layout.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ impl KnownLayout {
6868
self.trailing_pad
6969
}
7070

71-
/// number of unused bits scatered throughout layout, this doesn't contain the `trailing_pad`
72-
/// bits.
71+
/// number of available niches
7372
#[inline]
7473
pub fn niches(&self) -> u128 {
7574
self.niches
@@ -88,7 +87,7 @@ impl KnownLayout {
8887
self.niches -= 1;
8988
} else if can_eat_pad && self.trailing_pad() > 0 {
9089
// consume one byte of padding at the end
91-
self.trailing_pad -= 1;
90+
self.consume_trailing_pad(1);
9291
// consume one and add the remaining values of one byte as niches.
9392
self.niches = (u8::MAX - 1) as u128;
9493
} else if can_resize {
@@ -97,7 +96,7 @@ impl KnownLayout {
9796
self.trailing_pad += align;
9897
self.consume_niches(n, can_eat_pad, can_resize);
9998
} else {
100-
panic!("`consume_bit` called on a layout without enough space.");
99+
panic!("`{}` called on a layout without enough space.", stringify!(consume_niches));
101100
}
102101
}
103102

0 commit comments

Comments
 (0)