Move typeid into vtable by coolreader18 · Pull Request #6231 · RustPython/RustPython
Caution
Review failed
The pull request is closed.
📝 Walkthrough
Walkthrough
Workspace Rust toolchain minimum bumped from "1.89.0" to "1.91.0" in Cargo.toml. Several implementations of ::rustpython_vm::PyPayload replace the payload_type_id() function with an associated constant PAYLOAD_TYPE_ID (using core::any::TypeId) in generated and builtin types.
Changes
| Cohort / File(s) | Summary |
|---|---|
Toolchain Version Bump Cargo.toml |
Updated workspace.package.rust-version from "1.89.0" to "1.91.0". |
Derived PyPayload impls crates/derive-impl/src/pyclass.rs, crates/derive-impl/src/pystructseq.rs |
Replaced fn payload_type_id() -> ::std::any::TypeId with an associated const PAYLOAD_TYPE_ID: ::core::any::TypeId; constants initialized from base type PAYLOAD_TYPE_ID. |
Builtin payload const crates/vm/src/builtins/str.rs |
Removed payload_type_id() and added public PAYLOAD_TYPE_ID: core::any::TypeId = core::any::TypeId::of::<PyStr>();. |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
- Wtf8-compatible fixes #5985: Changes the
PyPayloadAPI by replacingpayload_type_id()with an associated constantPAYLOAD_TYPE_ID, which directly relates to the trait-implementation updates here.
Poem
🐰
I nibbled code beneath a moonlit patch,
Replaced a function with a constant hatch,
From std to core the TypeId springs,
Toolchain hops up—new tiny things!
Pre-merge checks
❌ Failed checks (2 warnings)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Title check | The PR title 'Move typeid into vtable' does not match the changeset, which only updates the Rust toolchain version from 1.89.0 to 1.91.0 in Cargo.toml. | Update the PR title to accurately reflect the actual change, such as 'Bump Rust toolchain requirement to 1.91.0' or 'Update workspace rust-version to 1.91.0'. | |
| Docstring Coverage | Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
✅ Passed checks (1 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
📜 Recent review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
Cargo.tomlcrates/derive-impl/src/pyclass.rscrates/derive-impl/src/pystructseq.rscrates/vm/src/builtins/str.rs
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.
Comment @coderabbitai help to get the list of available commands and usage tips.