finish no_std clippy by youknowone · Pull Request #6587 · RustPython/RustPython
Caution
Review failed
The pull request is closed.
📝 Walkthrough
Walkthrough
This PR systematically replaces standard library (std::) import paths with their core:: and alloc:: equivalents across 15+ files. Changes include shifting memory utilities, pointer operations, synchronization primitives, and type constructors to achieve no-std/alloc compatibility throughout multiple crates.
Changes
| Cohort / File(s) | Summary |
|---|---|
Memory and utility operations crates/common/src/os.rs, crates/stdlib/src/sqlite.rs, crates/vm/src/function/builtin.rs |
std::mem, std::str replaced with core::mem, core::str equivalents for UTF-8 decoding, size computation, and slice creation |
Pointer and slice operations crates/stdlib/src/socket.rs, crates/vm/src/stdlib/ctypes/simple.rs, crates/vm/src/stdlib/os.rs, crates/vm/src/stdlib/posix.rs |
std::ptr and std::slice → core::ptr and core::slice for pointer arithmetic, null construction, and raw slice creation |
Type system and operators crates/jit/tests/common.rs, crates/sre_engine/benches/benches.rs |
std::ops::{ControlFlow, Range} replaced with core::ops::* equivalents |
FFI and string types crates/stdlib/src/scproxy.rs, crates/stdlib/src/socket.rs, crates/vm/src/stdlib/ctypes.rs |
std::borrow::Cow → alloc::borrow::Cow and std::ffi::CString → alloc::ffi::CString |
Array and container internals crates/vm/src/stdlib/ctypes/array.rs |
Imports shifted to alloc::borrow::Cow and core::slice::from_raw_parts_mut |
Atomic synchronization crates/vm/src/stdlib/thread.rs |
All std::sync::atomic::* replaced with core::sync::atomic::* in RLock implementation, including AtomicUsize and Ordering variants |
WebAssembly/WASM bindings crates/wasm/src/{browser_module,js_module,lib,vm_class}.rs |
std::{cell, rc, fmt, future} replaced with core::* and alloc::rc::* equivalents; added extern crate alloc at crate root |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
#6564: Modifiescrates/stdlib/src/socket.rswith overlapping changes to getaddrinfo and address encoding logic, both affecting the same file's memory/alloc pathways.
Suggested reviewers
- arihant2math
Poem
🐰 The rabbit hops through code so neat,
Swapping std for core so sweet,
No_std paths now align,
Alloc imports, memories align,
One hop closer to no-std's goal! ✨
✨ Finishing touches
- 📝 Generate docstrings
📜 Recent review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (17)
crates/common/src/os.rscrates/jit/tests/common.rscrates/sre_engine/benches/benches.rscrates/stdlib/src/scproxy.rscrates/stdlib/src/socket.rscrates/stdlib/src/sqlite.rscrates/vm/src/function/builtin.rscrates/vm/src/stdlib/ctypes.rscrates/vm/src/stdlib/ctypes/array.rscrates/vm/src/stdlib/ctypes/simple.rscrates/vm/src/stdlib/os.rscrates/vm/src/stdlib/posix.rscrates/vm/src/stdlib/thread.rscrates/wasm/src/browser_module.rscrates/wasm/src/js_module.rscrates/wasm/src/lib.rscrates/wasm/src/vm_class.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.