Fix clippy warning#8249
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThis PR simplifies Rust AST pattern matching, option/error control flow, formatting arguments, and Clippy annotations across codegen, VM, standard-library, host-environment, derive, and entry-point code without changing public declarations. ChangesRust cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
decb75c to
89c7d08
Compare
|
The following error might be a bug in the latest stable rust. As it requires a unstable feature. |
I was going to suggest reporting it to https://github.com/rust-lang/rust-clippy/issues, but this might be a duplicate of rust-lang/rust-clippy#15836. |
|
Forgot to say, I think it will be better for us to pin the channel at https://github.com/RustPython/RustPython/blob/main/rust-toolchain.toml to a specific version, like 1.96 for now. It's not ideal for us to have the CI break every couple of months every time a new stable version releases |
- exceptions.rs: {b:#02x} -> {b:#04x} (unused_format_specs); output
unchanged for decode-error bytes (always >= 0x80)
- binascii.rs: [b'\r', b'\n'] -> b"\r\n" (byte_str_slice)
- host_env, _io.rs, ssl.rs, pyexpat.rs: expect std_instead_of_core where
the suggested core::io items (ErrorKind, Cursor) are unstable (core_io);
use expect so the suppression is flagged for removal once core::io
stabilizes. build_posix_spawn_attrs co-gates the expect with the cfg
block so it is not left unfulfilled on platforms compiling it out.
Assisted-by: Claude
| // _Py_fopen_obj in cpython (Python/fileutils.c:1757-1835) | ||
| // Open a file using std::fs::File and convert to FILE* | ||
| // Automatically handles path encoding and EINTR retries | ||
| #[expect(clippy::std_instead_of_core)] // false positive: core::io::ErrorKind is unstable (core_io) |
There was a problem hiding this comment.
Can you convert those to #[expect(..., reason="...")] please
Summary by CodeRabbit
UnicodeDecodeError, and cleaner formatting arguments for various builtins/IO/type messages).