| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…of_core clippy rules * Manually changed part of the code to use core/alloc
* Imported Range in vm/src/anystr.rs
|
Important Review skippedToo many files! 35 files out of 185 files are above the max files limit of 150. You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file. 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. ❤️ ShareComment @coderabbitai help to get the list of available commands and usage tips. |
Sorry, something went wrong.
|
Code has been automatically formatted The code in this PR has been formatted using cargo fmt --all. git pull origin main |
Sorry, something went wrong.
|
Most things were straightforward replacing std:: with their respective core::/alloc:: equivalents. There were a couple of cases where I had to add additional specifiers (::alloc:: for example) In crates/stdlib/src/ssl/cert.rs and vm/src/anystr.rs I also condensed some of the imports into a general use statement at the top, just because I thought it would be neater. Let me know if I should undo those changes |
Sorry, something went wrong.
|
Thank you so much! And the changes in cert.rs and anystr.rs is also looking reasonable. |
Sorry, something went wrong.
|
To prevent further conflict, if you create a separated PR without the cargo.toml changes, I will immediately merge it |
Sorry, something went wrong.
Changes SummaryThis PR addresses issue #6380 by systematically migrating the RustPython codebase to prefer core:: and alloc:: imports over std:: imports where appropriate, following Rust best practices for no-std compatibility. The work involves 184 changed files across all crates (codegen, common, compiler-core, stdlib, vm, etc.) and concludes with an auto-formatting pass to maintain consistency. Type: refactoring Components Affected: codegen, common, compiler-core, compiler, derive-impl, derive, literal, sre_engine, stdlib, vm, venvlauncher, examples Files Changed
Risk Areas: Widespread import changes across 184 files could introduce subtle runtime behavior changes if core:: and std:: implementations differ, Changes to memory safety operations (mem::size_of, mem::swap, slice operations) need verification that no subtle bugs were introduced, Clippy lint enforcement (alloc_instead_of_core, std_instead_of_alloc) could break existing tooling if lints are too strict, Import reordering (as part of rustfmt) could affect code readability or introduce merge conflicts Suggestions
Full review in progress... | Powered by diffray |
Sorry, something went wrong.
Review Summary
Validated 10 issues: 4 kept (valid performance/quality concerns), 6 filtered (speculative, incorrect analysis, or low value) Issues Found: 4📊 2 unique issue type(s) across 4 location(s) 📋 Full issue list (click to expand)🟠 HIGH - Multiple expect() calls on module initialization without error handling (2 occurrences)Agent: rust Category: quality Why this matters: This pattern commonly causes runtime bugs. 📍 View all locations
Rule: rust_unwrap_panic 🟡 MEDIUM - Redundant cloning in tuple flattening operation (2 occurrences)Agent: performance Category: performance Why this matters: Poor performance degrades user experience. 📍 View all locations
Rule: rust_clone_in_loop ℹ️ 4 issue(s) outside PR diff (click to expand)
🟠 HIGH - Multiple expect() calls on module initialization without error handling (2 occurrences)Agent: rust Category: quality Why this matters: This pattern commonly causes runtime bugs. 📍 View all locations
Rule: rust_unwrap_panic 🟡 MEDIUM - Redundant cloning in tuple flattening operation (2 occurrences)Agent: performance Category: performance Why this matters: Poor performance degrades user experience. 📍 View all locations
Rule: rust_clone_in_loop Review ID: a7c99827-4b9a-4d34-bb85-366902dc73b2 |
Sorry, something went wrong.
|
Hey, sorry about the late response! I just updated jit, so everything should be good (unless there are other crates I'm missing which I'm currently looking through). I'm unsure about how I should merge the conflicts. Am I good to just accept the incoming changes? |
Sorry, something went wrong.
|
(Wrote a comment on the wrong PR. This one should be fine to merge, once conflicts are resolved) |
Sorry, something went wrong.
|
@terryluan12 I think accepting new code, change std again to core is more easy in this case |
Sorry, something went wrong.
|
Sounds good. Just fixed the conflicts! |
Sorry, something went wrong.
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
There was a problem hiding this comment.
@terryluan12 Thank you so much for working on this huge task!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Hey there, because it seemed fairly straightforward, I ended up just adding it; I hope that's alright! Please let me know if there is anything I should change.
This addresses issue #6380