RQ-58-OBJECT (#938): compile against object 0.40 — three newtype surfaces, 16 errors, 4 files - #1008
Merged
Conversation
Bumps [object](https://github.com/gimli-rs/object) from 0.39.1 to 0.40.0. - [Changelog](https://github.com/gimli-rs/object/blob/main/CHANGELOG.md) - [Commits](gimli-rs/object@v0.39.1...v0.40.0) --- updated-dependencies: - dependency-name: object dependency-version: 0.40.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
…6 errors, 4 files
object 0.40.0 replaced several bare integer accessors with newtypes. Three
distinct surfaces broke, and they are NOT reachable from one search:
1. `Rel*::r_type()` now returns `elf::RelocationType` instead of u32 —
2 sites (the .rel.text match in main.rs, the assert in
elf_tooling_637_656.rs). Read through the newtype's public field.
2. `RelocationFlags::Elf { r_type }` DESTRUCTURING — 4 more sites
(wast_compile.rs x2, dwarf_debug_line_emit_394.rs x2). These are a
struct pattern, not a method call, so no '.r_type(' search finds them.
Only the comparison operand needs .0; the newtype impls Display, so
'{r_type}' in the assert messages still renders.
3. `st_bind()`/`st_type()` now return `SymbolBind`/`SymbolType`, and
object's own `STB_*`/`STT_*` constants are themselves typed now — so
typing the `SymEntry` alias fixes all 10 remaining errors at once and
every downstream `== elf::STB_LOCAL` comparison keeps working unchanged.
The local `const R_ARM_*: u32` values stay: they document the ABI numbers
at the point of use, and adopting object's typed constants would make
those match arms depend on structural-match of an external newtype.
METHOD NOTE: an earlier revision of this commit asserted the fix was
complete on the strength of a 'grep -rn \.r_type(' sweep. That was wrong
twice over — 2 sites became 6, then 16 across 4 files. A grep is a
hypothesis about where a change lands; the compiler is the oracle. The
completeness claim here rests on a clean `cargo test --workspace --no-run`,
not on a search.
Gates (exit codes captured directly, not through a pipe): fmt 0, clippy
-D warnings 0, cargo test --workspace 0 (146 result blocks, 0 failures),
claim_check 49/49, model_coverage_audit --check 0.
Refs #938.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Supersedes #938 (dependabot's bare bump, which was red on
Test+Clippyand based on a week-oldv0.56.1main). This branch carries dependabot's bump commit rebased onto currentmain, plus the code changes that make it compile.Why the bump was held
objectis the crate the ELF differentials read symtabs and relocations with, so a 0.x-minor here is genuinely breaking — the 0.x-minor hold exists for exactly this. Three separate newtype conversions broke, on surfaces that are not reachable from one search:Rel*::r_type()→elf::RelocationType(wasu32)RelocationFlags::Elf { r_type }destructuring.0on the comparison operand onlyst_bind()/st_type()→SymbolBind/SymbolTypeSymEntryalias onceSurface 2 is a struct pattern, not a method call, so no
.r_type(search finds it. Surface 3 has nothing to do with relocations at all. For (2), the newtype implsDisplay, so{r_type}in the assert messages still renders. For (3), object's ownSTB_*/STT_*constants are now typed too, so typing the alias fixes all 10 errors at once and every downstream== elf::STB_LOCALkeeps working unchanged.The local
const R_ARM_*: u32values are deliberately kept — they document the ABI numbers at the point of use, and adopting object's typed constants would make those match arms depend on structural-match of an external newtype.Method note, recorded because it cost two rounds
An earlier revision of the fix commit asserted completeness on the strength of a
grep -rn '\.r_type('sweep. That was wrong twice over: 2 sites → 6 → 16, across 4 files. A grep is a hypothesis about where a change lands; the compiler is the oracle. The completeness claim here rests on a cleancargo test --workspace --no-run, not on a search.Gates
Exit codes captured directly, not through a pipe (a piped
grep/tailreturns tail's status and reports a clean-looking green over a failed run):cargo test --workspace: 146 result blocks, 0 failures.claim_check.py49/49.model_coverage_audit.py --checkok.Closes #938. Refs #965, #242.