Conversation
There was a problem hiding this comment.
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 avoidunused_featuresoutside 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))] |
There was a problem hiding this comment.
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).
| #![cfg_attr(docsrs, feature(doc_cfg))] | |
| #![cfg_attr(doc, feature(doc_cfg))] |
No description provided.