Repository navigation
Refactor CTrieRef into TermsTrie and SuffixTrie - #10886
Merged
Merged
Conversation
CTrieRef into TermsTrie and SuffixTrie
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10886 +/- ##
==========================================
- Coverage 83.21% 82.21% -1.00%
==========================================
Files 606 630 +24
Lines 80993 82123 +1130
Branches 36254 37381 +1127
==========================================
+ Hits 67399 67521 +122
- Misses 13247 14255 +1008
Partials 347 347
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
1 of 4 tasks
daxhuiberts
force-pushed
the
dax-ctrie-refactor
branch
from
August 12, 2026 17:27
a9a4cb4 to
6ab4fcf
Compare
|
memark
approved these changes
Aug 13, 2026
1 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Describe the changes in the pull request
CTrieRefwraps a bare*mut ffi::Triewith no lifetime and no notion ofwhich kind of trie it holds. Handing a suffix walk the primary terms trie is type
confusion the compiler cannot catch, and the rule that a trie must not be mutated
while a walk is in progress can only be stated in prose — so all four iteration
methods are
unsafe fn.CTrieRefbecomes two#[repr(transparent)]types,TermsTrieandSuffixTrie, borrowed as&/&mutrather than owned. The trie kind is now part ofthe type, mutators take
&mut selfwhile walks take&self, andtimeoutis passedby value instead of as a caller-owned pointer.
unsafe fnleave the public surfacebecause the borrow checker now enforces what their safety sections asked for, and the
terms/suffix mix-up becomes a compile error.
Which additional issues this PR fixes
N/A
Main objects this PR modified
c_trie::TermsTrie/c_trie::SuffixTrie— replaceCTrieRef; construction moves tofrom_raw/from_raw_mut, which carry the validity obligations.iterate_contains,iterate_wildcardon each type) — now safe.as_ptr/as_mut_ptr— split, so a shared borrow can no longer hand C a pointer tomutate through.
query_eval::nodes::{prefix, token, wildcard_query}— the only call sites.Mark if applicable
Release Notes