Skip to content

Commit c6f3b7d

Browse files
committed
Reserve appropriate number of tuple labels
The upper bound of the range is exclusive, but the reserve function is inclusive.
1 parent 9ab9fc9 commit c6f3b7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fathom/src/source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl StringInterner {
101101

102102
/// Get or intern a slice of strings in the form `_{index}` for each index in `range`.
103103
pub fn get_tuple_labels(&mut self, range: Range<usize>) -> &[StringId] {
104-
self.reserve_tuple_labels(range.end);
104+
self.reserve_tuple_labels(range.end.saturating_sub(1));
105105
&self.tuple_labels[range]
106106
}
107107

0 commit comments

Comments
 (0)