Skip to content

stdlib: remove unused warning on sock_wait() - #8303

Merged
youknowone merged 1 commit into
RustPython:mainfrom
lsahn-gh:lsahn-socket
Jul 19, 2026
Merged

youknowone merged 1 commit into
RustPython:mainfrom
lsahn-gh:lsahn-socket

Conversation

@lsahn-gh

@lsahn-gh lsahn-gh commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The function is used in 'feature = ssl'. However, the current codebase defines it without a conditional compilation expression and always be compiled.

This commit removes the unused warning by adding a conditional compilation expression, '#[cfg(feature = "ssl")]'.

Summary by CodeRabbit

  • Bug Fixes
    • Improved builds for configurations without SSL support by limiting SSL-specific socket functionality to SSL-enabled builds.

The function is used in 'feature = ssl'. However, the current codebase
defines it without a conditional compilation expression and always be
compiled.

This commit removes the unused warning by adding a conditional
compilation expression, '#[cfg(feature = "ssl")]'.
@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 0d27257e-c528-4068-8dd9-69f0648b0beb

📥 Commits

Reviewing files that changed from the base of the PR and between 1205fd2 and d43ff7d.

📒 Files selected for processing (1)
  • crates/stdlib/src/socket.rs

📝 Walkthrough

Walkthrough

crates/stdlib/src/socket.rs now conditionally compiles the internal sock_wait helper only when the ssl feature is enabled, without changing its signature or runtime logic.

Changes

Socket feature gating

Layer / File(s) Summary
Gate socket wait helper
crates/stdlib/src/socket.rs
Adds #[cfg(feature = "ssl")] to the sock_wait definition.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: shaharnaveh, youknowone

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: gating sock_wait() to remove an unused warning.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@moreal moreal added the z-ca-2026 Tag to track Contribution Academy 2026 label Jul 17, 2026

@youknowone youknowone left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@moreal moreal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

I could see the warning by running cargo build in crates/stdlib directory.

@youknowone
youknowone merged commit 0784694 into RustPython:main Jul 19, 2026
25 of 26 checks passed
@lsahn-gh
lsahn-gh deleted the lsahn-socket branch July 19, 2026 05:30
youknowone pushed a commit that referenced this pull request Sep 16, 2026
The function is used in 'feature = ssl'. However, the current codebase
defines it without a conditional compilation expression and always be
compiled.

This commit removes the unused warning by adding a conditional
compilation expression, '#[cfg(feature = "ssl")]'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

z-ca-2026 Tag to track Contribution Academy 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants