Commit a9a6989
committed
fix(docs): remove nightly doc_cfg feature so docs.rs builds on stable
`#[doc(cfg(...))]` and `#![feature(doc_cfg)]` are nightly-only, so
docs.rs (stable Rust) was crashing on the docs build and rendering an
empty page. The `rustdoc-args = ["--cfg", "docsrs", ...]` line in
Cargo.toml made things worse by injecting `--cfg docsrs`, which
activated the nightly feature gate.
Drop the nightly feature gate, the explicit `--cfg docsrs` injection
(docs.rs sets it itself), and the `#[cfg_attr(docsrs, doc(cfg(...)))]`
annotations. Feature-gated modules and methods retain their
`#[cfg(feature = "...")]` compilation gates; only the per-item
"Available on feature X" badge is lost, which docs.rs surfaces via
its sidebar Feature flags panel anyway.
Verified with `RUSTDOCFLAGS="--cfg docsrs -D warnings" cargo doc
--all-features` (clean) plus the full build/test/clippy/publish-dry-run
gate.1 parent 333d84d commit a9a6989
3 files changed
Lines changed: 1 addition & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
87 | | - | |
88 | 86 | | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
92 | 90 | | |
93 | 91 | | |
94 | 92 | | |
95 | | - | |
96 | 93 | | |
97 | 94 | | |
98 | 95 | | |
99 | 96 | | |
100 | 97 | | |
101 | 98 | | |
102 | 99 | | |
103 | | - | |
104 | 100 | | |
105 | 101 | | |
106 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
43 | 41 | | |
44 | 42 | | |
45 | | - | |
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
50 | 47 | | |
51 | 48 | | |
52 | 49 | | |
53 | | - | |
54 | 50 | | |
55 | 51 | | |
56 | 52 | | |
57 | | - | |
58 | 53 | | |
59 | 54 | | |
60 | 55 | | |
61 | | - | |
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
| |||
0 commit comments