Skip to content

fix: clippy warning unused_features#14

Merged
AsakuraMizu merged 1 commit intomainfrom
pr/clippy-unused-features
Mar 26, 2026
Merged

fix: clippy warning unused_features#14
AsakuraMizu merged 1 commit intomainfrom
pr/clippy-unused-features

Conversation

@AsakuraMizu
Copy link
Copy Markdown
Contributor

No description provided.

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

This PR adjusts a crate-level feature gate in src/lib.rs to avoid triggering the unused_features clippy warning by only enabling doc_cfg in a documentation-specific configuration.

Changes:

  • Replaced the unconditional #![feature(doc_cfg)] with #![cfg_attr(docsrs, feature(doc_cfg))] to avoid unused_features outside docs builds.

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

#![doc = include_str!("../README.md")]
#![cfg_attr(not(doc), no_std)]
#![feature(doc_cfg)]
#![cfg_attr(docsrs, feature(doc_cfg))]
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

cfg_attr(docsrs, ...) relies on the docsrs cfg being set. A repo-wide search shows no place that sets/passes --cfg docsrs (e.g., in RUSTDOCFLAGS/RUSTFLAGS or package.metadata.docs.rs), so this feature gate will never be enabled in CI docs builds and may also trigger unexpected_cfgs warnings under -D warnings if check-cfg is active. Consider either switching to cfg_attr(doc, feature(doc_cfg)) (if you want it on any rustdoc build) or explicitly enabling/declaring docsrs (e.g., via Cargo.toml docs.rs metadata and/or the docs workflow flags / rustc check-cfg declarations).

Suggested change
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(doc, feature(doc_cfg))]

Copilot uses AI. Check for mistakes.
@AsakuraMizu AsakuraMizu merged commit 9164fe7 into main Mar 26, 2026
16 checks passed
@AsakuraMizu AsakuraMizu deleted the pr/clippy-unused-features branch March 26, 2026 05:44
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.

3 participants