Skip to content

Conversation

@coolreader18
Copy link
Member

@coolreader18 coolreader18 commented Jan 23, 2026

New in 1.93 - replaces our ad-hoc equivalent types.

Summary by CodeRabbit

  • Chores
    • Updated minimum supported Rust version to 1.93.0

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

Rust version bumped to 1.93.0 in Cargo.toml. Two codebases refactored to use fmt::from_fn instead of custom display wrappers, removing lifetime parameters in method signatures. A new helper function added to resolve hard dependencies in the update library script.

Changes

Cohort / File(s) Summary
Rust Version Bump
Cargo.toml
Updated workspace.package rust-version from "1.91.0" to "1.93.0"
Display Refactoring
crates/codegen/src/unparse.rs
Replaced custom to_string_fmt helper with fmt::from_fn-based construction in unparse_formatted and unparse_fstring, removing the standalone helper function while preserving string-accumulation behavior
Trait Method Simplification
crates/compiler-core/src/bytecode/instruction.rs
Simplified InstructionMetadata::display method signature by removing explicit lifetime parameters and internal wrapper type, now returning impl fmt::Display directly via fmt::from_fn; updated AnyInstruction implementation to match
Dependency Resolution
scripts/update_lib/deps.py
Added new function resolve_hard_dep_parent(name: str) -> str | None to resolve hard dependency names to their parent module names

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • youknowone
  • moreal

Poem

🐰 With fmt::from_fn, we hop along,
Old wrappers gone, our code more strong,
Lifetimes released, and helpers freed,
Rust marches on to version's need,
A cleaner way, a brighter sight! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'Use std::fmt::from_fn' directly reflects the main change: refactoring code to use the standard library's std::fmt::from_fn introduced in Rust 1.93, replacing custom formatting helper types across multiple files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

Code has been automatically formatted

The code in this PR has been formatted using:

  • cargo fmt --all
  • ruff format
    Please pull the latest changes before pushing again:
git pull origin fmt-from-fn

@youknowone youknowone merged commit f842fbe into RustPython:main Jan 24, 2026
13 checks passed
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.

2 participants