Skip to content

refactor: deprecate Show for Option, migrate to Debug#3436

Open
bobzhang wants to merge 5 commits intomainfrom
hongbo/deprecate_option
Open

refactor: deprecate Show for Option, migrate to Debug#3436
bobzhang wants to merge 5 commits intomainfrom
hongbo/deprecate_option

Conversation

@bobzhang
Copy link
Copy Markdown
Contributor

@bobzhang bobzhang commented Apr 17, 2026

Summary

  • Deprecate Show impl for Option and Option::to_string — Option has no meaningful Display representation (same reasoning as Rust's stdlib)
  • Migrate all call sites from inspect to debug_inspect or guard ... is patterns
  • Add Debug impls for JsonDecodeError, JsonPath, and @cmp.Reverse
  • Update expected test content strings for Debug output format differences (StringView, ArrayView, Byte, etc.)

Test plan

  • moon check passes (0 errors, 77 remaining deprecation warnings from structural uses)
  • moon test passes (6319/6319 tests)

🤖 Generated with Claude Code


Open with Devin

@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Apr 17, 2026

Coverage Report for CI Build 3889

Coverage decreased (-0.2%) to 94.729%

Details

  • Coverage decreased (-0.2%) from the base build.
  • Patch coverage: 32 uncovered changes across 4 files (9 of 41 lines covered, 21.95%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
builtin/linked_hash_map.mbt 13 0 0.0%
set/linked_hash_set.mbt 11 0 0.0%
json/json_path.mbt 8 2 25.0%
builtin/autoloc.mbt 2 0 0.0%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 15556
Covered Lines: 14736
Line Coverage: 94.73%
Coverage Strength: 220568.85 hits per line

💛 - Coveralls

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

@peter-jerry-ye peter-jerry-ye self-requested a review April 20, 2026 06:29
bobzhang and others added 3 commits April 22, 2026 10:20
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Show (Display) for Option has no meaningful string representation,
following the same reasoning as Rust's stdlib. Deprecate both the
Show impl for Option and Option::to_string. Migrate all call sites
from inspect to debug_inspect or guard patterns. Add Debug impls
for JsonDecodeError, JsonPath, and Reverse.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Suppress deprecation warnings on structs with Option fields that
  derive Show (ArgsLoc, Entry, value_range)
- Remove unused Eq impl for Entry
- Add Debug impls for Reverse, JsonDecodeError, JsonPath
- Fix all remaining inspect→debug_inspect and assert_eq→@test.assert_eq
- Update expected test content strings for Debug format differences

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@peter-jerry-ye peter-jerry-ye force-pushed the hongbo/deprecate_option branch from c21e49c to a6b0434 Compare April 22, 2026 02:31
@peter-jerry-ye peter-jerry-ye force-pushed the hongbo/deprecate_option branch from a6b0434 to 4d7ee58 Compare April 22, 2026 02:35
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.

3 participants