Repository navigation
Box the TableTypeMismatch and TypeDefinitionChanged details, and report the requested types - #1642
Merged
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
cberner
force-pushed
the
claude/sweet-hypatia-m4vct7-type-mismatch
branch
from
November 9, 2026 01:52
b2ac52b to
832a023
Compare
cberner
commented
Nov 9, 2026
…rt the requested types A TableTypeMismatch reported only the types a table was stored with, and named it Table<..> even when it was a multimap table. For a table of Option<T> written before T declared a niche, the stored name prints the same as the type the caller asked for, which made the error read as a contradiction. The message no longer names the table type. Under experimental-api-5 the TableTypeMismatch and TypeDefinitionChanged variants of TableError and Error hold a boxed TableTypeMismatch or TypeDefinitionInfo, with accessors, and TableTypeMismatch also reports the requested key and value types. Boxing keeps both error enums at 32 bytes, and private fields let later releases add to them. Assisted-by: Claude Code Claude-Session: https://claude.ai/code/session_01ALhxet6NP69dCfAUv8TAhR
cberner
force-pushed
the
claude/sweet-hypatia-m4vct7-type-mismatch
branch
from
November 9, 2026 03:18
832a023 to
1f2b002
Compare
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.
TableTypeMismatchreported only the types a table is stored with, as{table} is of type Table<K, V>. Two problems:Option<&str>written by redb 2.6, opened with redb 5's nicheOption<&str>, failed withvalues is of type Table<u64, Option<&str>>, which is exactly the type the caller asked for. The stored spelling and the niche spelling print the same in that message.Table<..>.Changes:
Wording, in both modes: the message no longer names the table type:
{table} has key type K and value type V.Under
experimental-api-5: theTableTypeMismatchandTypeDefinitionChangedvariants ofTableErrorandErrorhold a boxed struct,TableTypeMismatchorTypeDefinitionInfo, with private fields and accessors:TableTypeMismatch:table(),stored_key(),stored_value(),requested_key(),requested_value().TypeDefinitionInfo:name(),alignment(),width().Boxing makes
TableErrorandError32 bytes, down from 88 on master. With the requested types inline they would have been 152, over clippy'sresult_large_errlimit at 20 functions. Private fields mean later releases can add to the structs without a break.New message under the feature: the message adds the requested types:
values has key type u64 and value type Option<&str>, but was opened with key type u64 and value type niche::Option<&str>.Without the feature, the variants keep their 4.x fields; only the wording above changes.
Construction goes through
TableError::type_mismatch()andtype_definition_changed(), sotable_tree_base.rshas nocfgs.Patterns: existing
TableTypeMismatch { .. }patterns still compile against the tuple variants.Tests:
niche_tests: checks the exact message on a real table written by redb 2.6.multimap_tests: checks the wording in both modes.basic_tests: checks the accessors and the message for au32/NonZeroU32mismatch.Checked:
cargo fmt.--all --all-targets, with and without--all-features.cargo doc.cargo test --all-featuresandcargo testwith default features: the full suites before review, and the lib tests plus niche, multimap and basic tests after the review changes.🤖 Generated with Claude Code
https://claude.ai/code/session_01ALhxet6NP69dCfAUv8TAhR