Skip to content

refactor(sys): move implementations from the crate top#274

Open
bavshin-f5 wants to merge 1 commit intonginx:mainfrom
bavshin-f5:sunos-compat
Open

refactor(sys): move implementations from the crate top#274
bavshin-f5 wants to merge 1 commit intonginx:mainfrom
bavshin-f5:sunos-compat

Conversation

@bavshin-f5
Copy link
Copy Markdown
Member

All src/core/ngx_*.h extensions are now defined under nginx_sys::core, which is cleaner logically and also avoids warnings on Solaris due to name conflicts.

This does not affect the external API, everything is still reexported from the top of the crate.

The warning in question:

warning: private item shadows public glob re-export
  --> nginx-sys/src/lib.rs:11:1
   |
11 | mod queue;
   | ^^^^^^^^^^
   |
note: the name `queue` in the type namespace is supposed to be publicly re-exported here
  --> nginx-sys/src/lib.rs:34:9
   |
34 | pub use bindings::*;
   |         ^^^^^^^^^^^
note: but the private item here shadows it
  --> nginx-sys/src/lib.rs:11:1
   |
11 | mod queue;
   | ^^^^^^^^^^
   = note: `#[warn(hidden_glob_reexports)]` on by default

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors nginx-sys by moving the Rust-side extensions for NGINX “core” headers (e.g., queue/rbtree/string helpers and related impls) out of the crate root into a dedicated internal module, addressing Solaris warnings from private modules shadowing glob re-exports.

Changes:

  • Introduces a new core module and relocates several helper impls/functions into nginx-sys/src/core.rs and nginx-sys/src/core/*.
  • Updates crate-root re-exports to continue exposing the same public surface while avoiding the previous shadowing warning.
  • Reorganizes bindgen lint allowances in the bindings module.

Reviewed changes

Copilot reviewed 2 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
nginx-sys/src/lib.rs Adds the new internal core module and adjusts re-exports / bindings lint allows.
nginx-sys/src/core.rs New module collecting core-related helper impls and functions previously at crate root.
nginx-sys/src/core/string.rs New ngx_str_t extension methods plus tests.
nginx-sys/src/core/queue.rs New queue helpers/macros plus tests.
nginx-sys/src/core/rbtree.rs New rbtree helpers/macros.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread nginx-sys/src/lib.rs
Comment thread nginx-sys/src/core.rs
Comment thread nginx-sys/src/core.rs
Comment thread nginx-sys/src/core.rs Outdated
Comment thread nginx-sys/src/core.rs Outdated
Comment thread nginx-sys/src/core.rs Outdated
All src/core/ngx_*.h extensions are now defined under nginx_sys::core,
which is cleaner logically and also avoids warnings on Solaris due to
name conflicts.

This does not affect the external API, everything is still reexported
from the top of the crate.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants