refactor: deprecate Show for Option, migrate to Debug#3436
refactor: deprecate Show for Option, migrate to Debug#3436
Conversation
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>
Coverage Report for CI Build 3840Coverage decreased (-0.2%) to 94.692%Details
Uncovered Changes
Coverage Regressions6 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
- 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>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add deprecated inner() accessors for newtype structs that the stable toolchain (0.1.20260409) generates but the newer local version omits. Remove unsupported #deprecated annotation on impl in mbti. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| ///| | ||
| /// Number-of-values constraint for an argument. | ||
| #warnings("-deprecated_syntax") | ||
| #warnings("-deprecated_syntax-deprecated") |
There was a problem hiding this comment.
🟡 Likely malformed #warnings directive combining two flags with ambiguous syntax
The directive #warnings("-deprecated_syntax-deprecated") is the only instance in the entire codebase that attempts to combine two warning flags. Every other #warnings usage suppresses exactly one flag (e.g., #warnings("-deprecated") or #warnings("-deprecated_syntax")). The concatenated format -deprecated_syntax-deprecated is ambiguous — it may be parsed as a single unrecognized warning name deprecated_syntax-deprecated rather than two separate flags. The struct ValueRange has a field upper : Int? and derive(Eq, Show), so it needs both -deprecated_syntax (for the old struct syntax) and -deprecated (because Show for Int? is now deprecated). If neither flag is properly suppressed, the code would emit warnings.
Was this helpful? React with 👍 or 👎 to provide feedback.
Summary
Showimpl forOptionandOption::to_string— Option has no meaningful Display representation (same reasoning as Rust's stdlib)inspecttodebug_inspectorguard ... ispatternsDebugimpls forJsonDecodeError,JsonPath, and@cmp.ReverseTest plan
moon checkpasses (0 errors, 77 remaining deprecation warnings from structural uses)moon testpasses (6319/6319 tests)🤖 Generated with Claude Code