File tree 1 file changed +3
-4
lines changed 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -68,8 +68,7 @@ impl KnownLayout {
68
68
self . trailing_pad
69
69
}
70
70
71
- /// number of unused bits scatered throughout layout, this doesn't contain the `trailing_pad`
72
- /// bits.
71
+ /// number of available niches
73
72
#[ inline]
74
73
pub fn niches ( & self ) -> u128 {
75
74
self . niches
@@ -88,7 +87,7 @@ impl KnownLayout {
88
87
self . niches -= 1 ;
89
88
} else if can_eat_pad && self . trailing_pad ( ) > 0 {
90
89
// consume one byte of padding at the end
91
- self . trailing_pad -= 1 ;
90
+ self . consume_trailing_pad ( 1 ) ;
92
91
// consume one and add the remaining values of one byte as niches.
93
92
self . niches = ( u8:: MAX - 1 ) as u128 ;
94
93
} else if can_resize {
@@ -97,7 +96,7 @@ impl KnownLayout {
97
96
self . trailing_pad += align;
98
97
self . consume_niches ( n, can_eat_pad, can_resize) ;
99
98
} else {
100
- panic ! ( "`consume_bit ` called on a layout without enough space." ) ;
99
+ panic ! ( "`{} ` called on a layout without enough space." , stringify! ( consume_niches ) ) ;
101
100
}
102
101
}
103
102
You can’t perform that action at this time.
0 commit comments