Skip to content

feat: upgrade to Rust edition 2024, resolve TODOs, add rustdoc CI#143

Merged
konard merged 6 commits into
mainfrom
issue-142-bd959714447f
Apr 11, 2026
Merged

feat: upgrade to Rust edition 2024, resolve TODOs, add rustdoc CI#143
konard merged 6 commits into
mainfrom
issue-142-bd959714447f

Conversation

@konard
Copy link
Copy Markdown
Member

@konard konard commented Apr 11, 2026

Summary

Comprehensive audit of the Rust codebase per issue #142, confirming no non-stable features are used and upgrading to the latest Rust edition and best practices.

Changes

  • Upgrade Rust edition 2021 → 2024 (stable since Rust 1.85, Feb 2025) — zero code changes required for migration
  • Bump MSRV 1.70 → 1.85 — required for edition 2024; downstream users on older toolchains get compatible older versions automatically via the MSRV-aware resolver (Rust 1.84+)
  • Implement for_each_integer_type! macro — resolves the original // TODO: Create macro foreach by DRYing up repetitive per-type macro invocations
  • Document IDE alias design decision — resolves the original // TODO: Not use alias by adding a # Design note in the LinkReference doc comment explaining why supertraits are listed explicitly
  • Move tests to tests/ directory — all unit tests moved from src/imp.rs to rust/tests/traits.rs as proper integration tests
  • Add 8 new integration tests — covering ToPrimitive, PrimInt operations, FromPrimitive, Send + Sync, Display, Hash, and overflow scenarios (total: 75 integration + 6 doc = 81 tests)
  • Add crate-level documentation — comprehensive //! docs in lib.rs with trait summary table and usage example
  • Integrate automated Rust docs deployment — added deploy-docs job to rust.yml that generates cargo doc and deploys to the rust/ subdirectory on gh-pages only after a successful release (matching the project's release-driven docs strategy)
  • Remove separate deploy-rust-docs.yml — docs deployment is now part of the main Rust CI/CD pipeline
  • Fix CONTRIBUTING.md — incorrectly stated "nightly toolchain" when the project uses stable
  • Fix rust/README.md — installation example showed version 0.4 instead of current 0.5
  • Regenerate Cargo.lock — was showing version 0.4.0 instead of 0.5.0
  • Update case study — detailed audit findings in docs/case-studies/issue-142/

Audit Results

Check Result
Non-stable features ✅ None found — crate is fully stable Rust
Dependencies num-traits 0.2.19 is latest
Edition 2024 migration ✅ Clean — zero code changes
Clippy ✅ Zero warnings
Formatting ✅ Clean
Tests ✅ 75 integration + 6 doc tests pass
Documentation sync ✅ Fixed and enhanced
Automated docs CI ✅ Integrated into main rust.yml (runs after release)

Fixes #142

Test plan

  • cargo fmt --check — clean
  • cargo clippy --all-targets --all-features — zero warnings
  • cargo test --all-features — 75 integration + 6 doc tests pass
  • cargo doc --no-deps — documentation generates successfully
  • Verify edition 2024 compiles without migration issues
  • Verify no tests remain in src/ folder

🤖 Generated with Claude Code

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #142
@konard konard self-assigned this Apr 11, 2026
Migrate to Rust edition 2024 (stable since 1.85) with zero code changes
required. Fix documentation inaccuracies and remove stale TODO comments.

Changes:
- Upgrade edition 2021 → 2024, MSRV 1.70 → 1.85
- Fix CONTRIBUTING.md: "nightly toolchain" → "stable toolchain"
- Fix rust/README.md: install version 0.4 → 0.5
- Remove stale TODO comments from imp.rs
- Regenerate Cargo.lock to match version 0.5.0
- Add case study for issue #142 audit findings
- Add changelog fragment

Closes #142

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title [WIP] Double check we don't depend on any non stable features of rust and use all the latest best practices of rust in the code feat: upgrade to Rust edition 2024 and audit codebase for best practices Apr 11, 2026
@konard konard marked this pull request as ready for review April 11, 2026 01:59
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 11, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Public pricing estimate: $3.661450
  • Calculated by Anthropic: $3.701450
  • Difference: $0.040000 (+1.09%)

📊 Context and tokens usage:

Claude Opus 4.6:

  • Context window: 84.5K / 1M (8%) input tokens, 18.1K / 128K (14%) output tokens

Total: (91.3K + 4.9M cached) input tokens, 18.1K output tokens, $3.482209 cost

Claude Haiku 4.5:

Total: (102.9K + 216.3K cached) input tokens, 6.3K / 64K (10%) output tokens, $0.179241 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Main model: Claude Opus 4.6 (claude-opus-4-6)
  • Additional models:
    • Claude Haiku 4.5 (claude-haiku-4-5-20251001)

📎 Log file uploaded as Gist (1484KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 11, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 11, 2026

TODO cannot be just removed - we should either implement them in this pull request, or create issues for the future. Double check if it possible to increase tests coverage and docs coverage. And also if it possible to make automated documentation generation as we do for C#, so the final website published in GitHub Pages contains generated documentation for all supported languages. Also code should contain all comments necessary to generate high quality documentation.

Also no tests should be in src folder, use tests folder for tests.

@konard konard marked this pull request as draft April 11, 2026 02:30
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 11, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-04-11T02:30:16.870Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

- Implement `for_each_integer_type!` macro (resolves TODO "Create macro foreach")
- Document IDE alias design decision in LinkReference (resolves TODO "Not use alias")
- Move all tests from src/imp.rs to tests/traits.rs (integration tests)
- Add 8 new tests (ToPrimitive, PrimInt ops, FromPrimitive, Send+Sync, Display, Hash)
- Add crate-level documentation in lib.rs with trait summary table
- Add deploy-rust-docs.yml workflow for automated docs on GitHub Pages
- Update case study with new findings

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard changed the title feat: upgrade to Rust edition 2024 and audit codebase for best practices feat: upgrade to Rust edition 2024, resolve TODOs, add rustdoc CI Apr 11, 2026
@konard konard marked this pull request as ready for review April 11, 2026 02:37
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 11, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $2.627869

📊 Context and tokens usage:

  • Context window: 87.8K / 1M (9%) input tokens, 23.9K / 128K (19%) output tokens

Total: (78.0K + 3.1M cached) input tokens, 23.9K output tokens, $2.627869 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.6 (claude-opus-4-6)

📎 Log file uploaded as Gist (1157KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 11, 2026

Generated documentation deploy should be done only if release of new version is successful, so it should be integrated to main rust workflow.

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 11, 2026

🤖 AI Work Session Started

Starting automated work session at 2026-04-11T05:39:13.473Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

konard and others added 2 commits April 11, 2026 05:42
Move rustdoc generation and GitHub Pages deployment from a separate
deploy-rust-docs.yml workflow into the main rust.yml pipeline as a
deploy-docs job that runs only after a successful release (auto-release
or manual-release), matching the project's release-driven docs strategy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Accurately describe TODO resolution (implemented, not removed),
add entries for new tests, docs deployment, and test restructuring.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@konard konard marked this pull request as ready for review April 11, 2026 05:47
@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 11, 2026

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $2.569131

📊 Context and tokens usage:

Claude Opus 4.6:

  • Context window: 66.6K / 1M (7%) input tokens, 11.8K / 128K (9%) output tokens

Total: (62.5K + 3.6M cached) input tokens, 11.8K output tokens, $2.460475 cost

Claude Haiku 4.5:

Total: (47.2K + 281.4K cached) input tokens, 4.4K / 64K (7%) output tokens, $0.108656 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Main model: Claude Opus 4.6 (claude-opus-4-6)
  • Additional models:
    • Claude Haiku 4.5 (claude-haiku-4-5-20251001)

📎 Log file uploaded as Gist (1917KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
Copy link
Copy Markdown
Member Author

konard commented Apr 11, 2026

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

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.

Double check we don't depend on any non stable features of rust and use all the latest best practices of rust in the code

1 participant