-
Notifications
You must be signed in to change notification settings - Fork 177
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
Rust modules: Revise BTreeIndexBounds
#1815
Merged
Merged
Conversation
This file contains 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
…rable types And add some comments to the macros which implement it. For reasons that escape me, this breaks inference on integer literals: they get defaulted too early to `i32`, even when the indexed column is of a different type like `u32` or `i64`. We could potentially work around this by making `i32` a `FilterableValue` for any integer column type, but that opens the door for some nasty truncation-related bugs.
Centril
reviewed
Oct 14, 2024
coolreader18
approved these changes
Oct 15, 2024
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 guess if that's the direction we wanna go, these changes look good to me.
gefjon
added a commit
to clockworklabs/spacetime-docs
that referenced
this pull request
Oct 22, 2024
Companion to clockworklabs/SpacetimeDB#1815 Also fix surrounding example code and text: you filter on indices, not columns.
gefjon
added a commit
to clockworklabs/spacetime-docs
that referenced
this pull request
Oct 22, 2024
Companion to clockworklabs/SpacetimeDB#1815 Also fix surrounding example code and text: you filter on indices, not columns.
bfops
added a commit
to clockworklabs/spacetime-docs
that referenced
this pull request
Nov 6, 2024
* Whitespace (#98) * Add note about integer literal type inference (#100) Companion to clockworklabs/SpacetimeDB#1815 Also fix surrounding example code and text: you filter on indices, not columns. --------- Co-authored-by: Tyler Cloutier <[email protected]> Co-authored-by: Phoebe Goldman <[email protected]>
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.
Description of Changes
Copy
types, so that diagnostics prefer to suggest&x
instead ofx.clone()
.String
columns can be queried by&str
arguments and ranges thereof.BTreeIndexBounds
, because it's a doozy.For reasons that escape me, this breaks inference on integer literals: they get defaulted too early to
i32
, even when the indexed column is of a different type likeu32
ori64
. We could potentially work around this by makingi32
aFilterableValue
for any integer column type, but that opens the door for some nasty truncation-related bugs. Failing that, we'll have to decide whether allowing&str
forString
, and owned values forCopy
types, is more valuable than correctly inferring the types of integer literals (which would in that case be&0
instead of0i64
).API and ABI breaking changes
BTreeIndexBounds
is now less permissive than it was in the 0.12 release. Also the integer literal thing.Expected complexity level and risk
3 - Complex macros and traits, but relatively contained. The only undesirable interactions I can forsee are other cases like the integer literal thing where type inference gets less reliable because we have more complex traits involved.
Testing
Describe any testing you've done, and any testing you'd like your reviewers to do,
so that you're confident that all the changes work as expected!
rust-wasm-test
which demonstrates many combinations of valid args.