Skip to content

Conversation

@Veykril
Copy link
Member

@Veykril Veykril commented Jan 4, 2026

All of these were AI generated and then hand-picked/cleaned up by me

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 4, 2026
Comment on lines 383 to +389
pub fn empty(span: DelimSpan) -> Self {
Self {
repr: TopSubtreeRepr::SpanStorage96(Box::new([TokenTree::Subtree {
len: 0,
delim_kind: DelimiterKind::Invisible,
open_span: SpanStorage96::new(span.open.range, 0),
close_span: SpanStorage96::new(span.close.range, 1),
}])),
span_parts: Box::new([
CompressedSpanPart::from_span(&span.open),
CompressedSpanPart::from_span(&span.close),
]),
}
TopSubtreeBuilder::new(crate::Delimiter {
kind: DelimiterKind::Invisible,
open: span.open,
close: span.close,
})
.build()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notable change, given that the eq impl of TopSubtree relies on the backing span store, we should make sure that building an empty tree results in the same object no matter what constructor is being used, thus this change

@Veykril Veykril enabled auto-merge January 4, 2026 16:51
@Veykril Veykril force-pushed the push-pxvkpllmpoty branch from 3c4ad7e to 794c4c2 Compare January 4, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants