Skip to content

Commit b45892d

Browse files
committed
move rustdoc feature handling to doc_auto_cfg with docsrs cfg
1 parent 7ea9c20 commit b45892d

File tree

10 files changed

+2
-18
lines changed

10 files changed

+2
-18
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ jobs:
8686
- name: Rustdoc [nightly]
8787
env:
8888
# this should need nightly
89-
RUSTDOCFLAGS: "--cfg doc_cfg"
89+
RUSTDOCFLAGS: "--cfg docsrs"
9090
run: cargo doc --all-features
9191
# deploy docs from nightly for doc_cfg feature
9292
# (for stable we'd create a new job and use the cache)

Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,3 @@ version-sync = "0.9.1"
3434
[package.metadata.docs.rs]
3535
all-features = true
3636
targets = []
37-
38-
[lints.rust]
39-
# allow #[cfg_attr(doc_cfg, doc(cfg(...)))]
40-
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(doc_cfg)'] }

src/cidr/any.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ impl From<IpAddr> for AnyIpCidr {
295295
}
296296

297297
#[cfg(feature = "bitstring")]
298-
#[cfg_attr(doc_cfg, doc(cfg(feature = "bitstring")))]
299298
impl bitstring::BitString for AnyIpCidr {
300299
fn get(&self, ndx: usize) -> bool {
301300
assert!(!self.is_any());

src/cidr/direct.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#[cfg(feature = "bitstring")]
2-
#[cfg_attr(doc_cfg, doc(cfg(feature = "bitstring")))]
32
use bitstring::FixedBitString;
43

54
use core::{
@@ -32,7 +31,6 @@ use crate::{
3231
macro_rules! impl_cidr_for {
3332
($n:ident : inet $inet:ident : addr $addr:ident : pair $pair:ident : family $family:expr) => {
3433
#[cfg(feature = "bitstring")]
35-
#[cfg_attr(doc_cfg, doc(cfg(feature = "bitstring")))]
3634
impl bitstring::BitString for $n {
3735
fn get(&self, ndx: usize) -> bool {
3836
self.address.get(ndx)

src/cidr/serde/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![cfg(feature = "serde")]
2-
#![cfg_attr(doc_cfg, doc(cfg(feature = "serde")))]
32

43
use crate::{
54
cidr::{

src/errors.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use core::{
55
num::ParseIntError,
66
};
77
#[cfg(feature = "std")]
8-
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
98
use std::error::Error;
109
use std::net::AddrParseError;
1110

@@ -39,7 +38,6 @@ impl fmt::Display for NetworkLengthTooLongError {
3938
}
4039

4140
#[cfg(feature = "std")]
42-
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
4341
impl Error for NetworkLengthTooLongError {
4442
fn description(&self) -> &str {
4543
"network length too long"
@@ -86,7 +84,6 @@ impl fmt::Display for NetworkParseError {
8684
}
8785

8886
#[cfg(feature = "std")]
89-
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
9087
impl Error for NetworkParseError {
9188
fn description(&self) -> &str {
9289
"network parse error"
@@ -149,7 +146,6 @@ impl fmt::Display for InetTupleError {
149146
}
150147

151148
#[cfg(feature = "std")]
152-
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
153149
impl Error for InetTupleError {
154150
fn description(&self) -> &str {
155151
"inet tuple error"

src/inet/direct.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#[cfg(feature = "bitstring")]
2-
#[cfg_attr(doc_cfg, doc(cfg(feature = "bitstring")))]
32
use bitstring::FixedBitString;
43

54
use core::{
@@ -29,7 +28,6 @@ use crate::{
2928
macro_rules! impl_inet_for {
3029
($n:ident : cidr $cidr:ident : addr $addr:ident : pair $pair:ident : family $family:expr) => {
3130
#[cfg(feature = "bitstring")]
32-
#[cfg_attr(doc_cfg, doc(cfg(feature = "bitstring")))]
3331
impl bitstring::BitString for $n {
3432
fn get(&self, ndx: usize) -> bool {
3533
self.address.get(ndx)

src/inet/serde/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![cfg(feature = "serde")]
2-
#![cfg_attr(doc_cfg, doc(cfg(feature = "serde")))]
32

43
use crate::{
54
inet::{

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(doc_cfg, feature(doc_cfg))]
1+
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
22
#![cfg_attr(not(feature = "std"), no_std)]
33
#![cfg_attr(feature = "no_unsafe", forbid(unsafe_code))]
44
#![warn(missing_docs)]

src/serde_common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![cfg(feature = "serde")]
2-
#![cfg_attr(doc_cfg, doc(cfg(feature = "serde")))]
32

43
use core::fmt;
54
use serde::{

0 commit comments

Comments
 (0)