Redesign GeometryTraitExt to eliminate GAT recursion to work around a Rust compiler bug in 1.90.0#11
Merged
Kontinuation merged 6 commits intogeneric-algfrom Sep 25, 2025
Conversation
Author
|
This is a breaking change, wherobots/wkb needs to be updated as well. We need to merge PRs for both repos at once. |
Member
|
@zhangfengcdt can you review? |
Member
|
I think we might consider to add some new macros to simplify some of the repeated patterns with macro, such as But we can do that later in one PR so we don't mix it with the fix here. |
Kontinuation
added a commit
to wherobots/wkb
that referenced
this pull request
Sep 25, 2025
The change made to GeometryTraitExt is introduced by wherobots/geo#11. This PR should be merged after the wherobots/geo PR is merged.
Kontinuation
added a commit
to apache/sedona-db
that referenced
this pull request
Sep 25, 2025
We've worked around the Rust compiler 1.90.0 regression in its forked dependency wherobots/geo: wherobots/geo#11. Please refer to the description of that PR for details. Once we resolve the compilation issue, we'll start working on moving geo-traits-ext and geo-generic-alg modules into the sedona-db repository, and get rid of our own geo, wkb, and wkt fork. This will unblock us from publishing our sedona-db crate to crates.io, and make the project grow in a healthier state.
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.
This patch removes the GAT
GeometryCollectionTypeExtfromGeometryTraitExtbecause it would introduce recursive GATs such asG::GeometryCollectionTypeExt::GeometryTypeExt::GeometryCollectionTypeExt::...and easilytrigger a Rust compiler bug: rust-lang/rust#128887 and rust-lang/rust#131960. See also geoarrow/geoarrow-rs#1339.
Although this could be worked around by not implementing generic functions using trait-based approach and use
function-based approach instead, see geoarrow/geoarrow-rs#956 and georust/wkb#77, we are not certain if there will be other issues caused by recursive GATs in the future. So we decided to completely get rid of recursive GATs.