|
51 | 51 | //! that are not available on all OSs.
|
52 | 52 |
|
53 | 53 | #![deny(missing_docs, missing_debug_implementations, rust_2018_idioms)]
|
54 |
| -// Show required OS/features on docs.rs. |
55 |
| -#![cfg_attr(docsrs, feature(doc_cfg))] |
| 54 | +// Automatically generate required OS/features for docs.rs. |
| 55 | +#![cfg_attr(docsrs, feature(doc_auto_cfg))] |
56 | 56 | // Disallow warnings when running tests.
|
57 | 57 | #![cfg_attr(test, deny(warnings))]
|
58 | 58 | // Disallow warnings in examples.
|
@@ -266,20 +266,14 @@ impl Type {
|
266 | 266 | ///
|
267 | 267 | /// Used for the DCCP protocol.
|
268 | 268 | #[cfg(all(feature = "all", target_os = "linux"))]
|
269 |
| - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", target_os = "linux"))))] |
270 | 269 | pub const DCCP: Type = Type(sys::SOCK_DCCP);
|
271 | 270 |
|
272 | 271 | /// Type corresponding to `SOCK_SEQPACKET`.
|
273 | 272 | #[cfg(all(feature = "all", not(target_os = "espidf")))]
|
274 |
| - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", not(target_os = "espidf")))))] |
275 | 273 | pub const SEQPACKET: Type = Type(sys::SOCK_SEQPACKET);
|
276 | 274 |
|
277 | 275 | /// Type corresponding to `SOCK_RAW`.
|
278 | 276 | #[cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))]
|
279 |
| - #[cfg_attr( |
280 |
| - docsrs, |
281 |
| - doc(cfg(all(feature = "all", not(any(target_os = "redox", target_os = "espidf"))))) |
282 |
| - )] |
283 | 277 | pub const RAW: Type = Type(sys::SOCK_RAW);
|
284 | 278 | }
|
285 | 279 |
|
@@ -324,7 +318,6 @@ impl Protocol {
|
324 | 318 |
|
325 | 319 | /// Protocol corresponding to `DCCP`.
|
326 | 320 | #[cfg(all(feature = "all", target_os = "linux"))]
|
327 |
| - #[cfg_attr(docsrs, doc(cfg(all(feature = "all", target_os = "linux"))))] |
328 | 321 | pub const DCCP: Protocol = Protocol(sys::IPPROTO_DCCP);
|
329 | 322 |
|
330 | 323 | /// Protocol corresponding to `SCTP`.
|
@@ -364,7 +357,6 @@ impl From<Protocol> for c_int {
|
364 | 357 | ///
|
365 | 358 | /// Flags provide additional information about incoming messages.
|
366 | 359 | #[cfg(not(target_os = "redox"))]
|
367 |
| -#[cfg_attr(docsrs, doc(cfg(not(target_os = "redox"))))] |
368 | 360 | #[derive(Copy, Clone, Eq, PartialEq)]
|
369 | 361 | pub struct RecvFlags(c_int);
|
370 | 362 |
|
@@ -523,24 +515,6 @@ impl TcpKeepalive {
|
523 | 515 | target_os = "watchos",
|
524 | 516 | target_os = "windows",
|
525 | 517 | ))]
|
526 |
| - #[cfg_attr( |
527 |
| - docsrs, |
528 |
| - doc(cfg(any( |
529 |
| - target_os = "android", |
530 |
| - target_os = "dragonfly", |
531 |
| - target_os = "freebsd", |
532 |
| - target_os = "fuchsia", |
533 |
| - target_os = "illumos", |
534 |
| - target_os = "ios", |
535 |
| - target_os = "visionos", |
536 |
| - target_os = "linux", |
537 |
| - target_os = "macos", |
538 |
| - target_os = "netbsd", |
539 |
| - target_os = "tvos", |
540 |
| - target_os = "watchos", |
541 |
| - target_os = "windows", |
542 |
| - ))) |
543 |
| - )] |
544 | 518 | pub const fn with_interval(self, interval: Duration) -> Self {
|
545 | 519 | Self {
|
546 | 520 | interval: Some(interval),
|
@@ -569,26 +543,6 @@ impl TcpKeepalive {
|
569 | 543 | target_os = "watchos",
|
570 | 544 | )
|
571 | 545 | ))]
|
572 |
| - #[cfg_attr( |
573 |
| - docsrs, |
574 |
| - doc(cfg(all( |
575 |
| - feature = "all", |
576 |
| - any( |
577 |
| - target_os = "android", |
578 |
| - target_os = "dragonfly", |
579 |
| - target_os = "freebsd", |
580 |
| - target_os = "fuchsia", |
581 |
| - target_os = "illumos", |
582 |
| - target_os = "ios", |
583 |
| - target_os = "visionos", |
584 |
| - target_os = "linux", |
585 |
| - target_os = "macos", |
586 |
| - target_os = "netbsd", |
587 |
| - target_os = "tvos", |
588 |
| - target_os = "watchos", |
589 |
| - ) |
590 |
| - ))) |
591 |
| - )] |
592 | 546 | pub const fn with_retries(self, retries: u32) -> Self {
|
593 | 547 | Self {
|
594 | 548 | retries: Some(retries),
|
|
0 commit comments