Skip to content

RQ-58-OBJECT (#938): compile against object 0.40 — three newtype surfaces, 16 errors, 4 files - #1008

Merged
avrabe merged 2 commits into
mainfrom
fix/object-040
Aug 20, 2026
Merged

RQ-58-OBJECT (#938): compile against object 0.40 — three newtype surfaces, 16 errors, 4 files#1008
avrabe merged 2 commits into
mainfrom
fix/object-040

Conversation

@avrabe

@avrabe avrabe commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Supersedes #938 (dependabot's bare bump, which was red on Test + Clippy and based on a week-old v0.56.1 main). This branch carries dependabot's bump commit rebased onto current main, plus the code changes that make it compile.

Why the bump was held

object is 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:

# surface sites fix
1 Rel*::r_type()elf::RelocationType (was u32) 2 read through the newtype's public field
2 RelocationFlags::Elf { r_type } destructuring 4 .0 on the comparison operand only
3 st_bind()/st_type()SymbolBind/SymbolType 10 type the SymEntry alias once

Surface 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 impls Display, so {r_type} in the assert messages still renders. For (3), object's own STB_*/STT_* constants are now typed too, so typing the alias fixes all 10 errors at once and every downstream == elf::STB_LOCAL keeps working unchanged.

The local const R_ARM_*: u32 values 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 clean cargo test --workspace --no-run, not on a search.

Gates

Exit codes captured directly, not through a pipe (a piped grep/tail returns tail's status and reports a clean-looking green over a failed run):

FMT_EXIT=0   CLIPPY_EXIT=0   TEST_EXIT=0   CLAIM_EXIT=0   MODELCOV_EXIT=0

cargo test --workspace: 146 result blocks, 0 failures. claim_check.py 49/49. model_coverage_audit.py --check ok.

Closes #938. Refs #965, #242.

dependabot Bot and others added 2 commits August 20, 2026 06:25
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.
@avrabe
avrabe merged commit 71d11a8 into main Aug 20, 2026
60 checks passed
@avrabe
avrabe deleted the fix/object-040 branch August 20, 2026 05:12
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant