-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Impl Point for [RTreeNum; N] const generic N #115
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think directionally this change makes sense.
One weird edge case I was thinking about - won't this newly impl Point
for [S; 1]
and [S; 0]
?
Admittedly it probably doesn't make sense to try to use RTree with those parameters, but it would be ideal to have the compiler enforce that. IIRC someone requesting support previously tried to build an RTree with 1 dimensional points.
If it's not possible to enforce that with the compiler, maybe a runtime panic with a clear message is preferable.
Fair point. Unfortunately this is a pain point of the current const generics spec. The only other way I can find is to use an associated trait:
Then one of the functions in
The error message is not terrible, but the code is hacky and would put an extra trait into the docs. |
That I agree that the straight-forward runtime panic for this rare case is preferable. Maybe once we get these two RFC's stabilized we could do something cleaner:
|
Yes that error is at compile time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, but I'll leave it open a couple days in case someone else wants to weigh in.
bors r+ |
115: Impl Point for [RTreeNum; N] on all N r=michaelkirk a=dominikWin - [X] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md). - [X] I added an entry to `rstar/CHANGELOG.md` if knowledge of this change could be valuable to users. --- Point is now implemented for `[RTreeNum; N]` where `N` is a `usize`. Previously it was only for N values between 2 and 9. Const generics are stable in every supported version of Rust. Co-authored-by: Dominik Winecki <dominikwinecki@gmail.com>
Build failed: |
Looks like we'll need to bump our MSRV (which I think is just fine - currently it's very old). @dominikWin - can you verify what minimum version of rust is required to build this branch? |
1.55 is when |
We should still aim for 1.55 then and use |
It appears that we have effectively bumped our MSRV to 1.63 at this point. @dominikWin Could you rebase this? Thanks! |
What moves rstar to rely on 1.63? I can't seem to find anything mentioned elsewhere. |
The changes to GitHub workflow, i.e. f5f0cb1, which tests our MSRV. But indeed, there is no changelog entry and the EDIT: #124 is that separate PR. |
8b8564f
to
ae7d38c
Compare
bors try |
🔒 Permission denied Existing reviewers: click here to make dominikWin a reviewer |
bors ATM does not check anything that the CI itself does, so if you rebased and the CI is happen, you're golden. I think the changelog entry is misplaced though? It still refers to the already released 0.10 section instead of the unreleased section. |
Whoops. Should be fixed now |
bors r=michaelkirk |
Build succeeded: |
rstar/CHANGELOG.md
if knowledge of this change could be valuable to users.Point is now implemented for
[RTreeNum; N]
whereN
is ausize
. Previously it was only for N values between 2 and 9. Const generics are stable in every supported version of Rust.