@@ -745,7 +745,7 @@ struct LocalScope<'a> {
745 local_defs: Vec<LocalDef<'a>>,
745 local_defs: Vec<LocalDef<'a>>,
748−struct HighlightIter<'a, F>
748+struct HighlightIter<'a, 'tree: 'a, F>
750 F: FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a,
750 F: FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a,
@@ -753,16 +753,16 @@ where
753 byte_offset: usize,
753 byte_offset: usize,
754 injection_callback: F,
754 injection_callback: F,
755 cancellation_flag: Option<&'a AtomicUsize>,
755 cancellation_flag: Option<&'a AtomicUsize>,
756− layers: Vec<HighlightIterLayer<'a>>,
756+ layers: Vec<HighlightIterLayer<'a, 'tree>>,
757 iter_count: usize,
757 iter_count: usize,
758 next_event: Option<HighlightEvent>,
758 next_event: Option<HighlightEvent>,
759 last_highlight_range: Option<(usize, usize, usize)>,
759 last_highlight_range: Option<(usize, usize, usize)>,
762−struct HighlightIterLayer<'a> {
762+struct HighlightIterLayer<'a, 'tree: 'a> {
763 _tree: Option<Tree>,
763 _tree: Option<Tree>,
764 cursor: QueryCursor,
764 cursor: QueryCursor,
765− captures: iter::Peekable<QueryCaptures<'a, Cow<'a, [u8]>>>,
765+ captures: iter::Peekable<QueryCaptures<'a, 'tree, Cow<'a, [u8]>>>,
766 config: &'a HighlightConfiguration,
766 config: &'a HighlightConfiguration,
767 highlight_end_stack: Vec<usize>,
767 highlight_end_stack: Vec<usize>,
768 scope_stack: Vec<LocalScope<'a>>,
768 scope_stack: Vec<LocalScope<'a>>,
@@ -929,7 +929,7 @@ impl HighlightConfiguration {
932−impl<'a> HighlightIterLayer<'a> {
932+impl<'a, 'tree: 'a> HighlightIterLayer<'a, 'tree> {
933 /// Create a new 'layer' of highlighting for this document.
933 /// Create a new 'layer' of highlighting for this document.
935 /// In the even that the new layer contains "combined injections" (injections where multiple
935 /// In the even that the new layer contains "combined injections" (injections where multiple
@@ -1193,7 +1193,7 @@ impl<'a> HighlightIterLayer<'a> {
1196−impl<'a, F> HighlightIter<'a, F>
1196+impl<'a, 'tree: 'a, F> HighlightIter<'a, 'tree, F>
1198 F: FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a,
1198 F: FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a,
@@ -1244,7 +1244,7 @@ where
1247− fn insert_layer(&mut self, mut layer: HighlightIterLayer<'a>) {
1247+ fn insert_layer(&mut self, mut layer: HighlightIterLayer<'a, 'tree>) {
1248 if let Some(sort_key) = layer.sort_key() {
1248 if let Some(sort_key) = layer.sort_key() {
1249 let mut i = 1;
1249 let mut i = 1;
1250 while i < self.layers.len() {
1250 while i < self.layers.len() {
@@ -1263,7 +1263,7 @@ where
1266−impl<'a, F> Iterator for HighlightIter<'a, F>
1266+impl<'a, 'tree: 'a, F> Iterator for HighlightIter<'a, 'tree, F>
1268 F: FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a,
1268 F: FnMut(&str) -> Option<&'a HighlightConfiguration> + 'a,