Skip to content

Commit 847a953

Browse files
Merge pull request #45 from kingwingfly/examples/enable_some_feature_gates
chore: make the document of the example able to be previewed
2 parents 754d1d8 + 56418bc commit 847a953

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

documentation/debugging.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@
66
- Alternatively you could install and use [cargo expand](https://github.com/dtolnay/cargo-expand) which adds syntax highlighting to the terminal output.
77
- Additionally get pager by piping to `less` ( on Unix systems ): `cargo expand --color always | less -R`
88
- Print output during macro compilation using `eprintln!("hi");`
9+
10+
## Preview Doc
11+
12+
```sh
13+
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --example all_tuples --no-deps --open
14+
```

examples/demonstrations/all_tuples.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//! An example of using `all_tuples!`
22
3+
#![cfg_attr(any(docsrs), feature(rustdoc_internals))]
4+
35
use variadics_please::all_tuples;
46

57
fn main() {}

src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ impl Parse for AllTuples {
150150
///
151151
/// ```
152152
/// // `rustdoc_internals` is needed for `#[doc(fake_variadics)]`
153-
/// #![allow(internal_features)]
154153
/// #![cfg_attr(any(docsrs, docsrs_dep), feature(rustdoc_internals))]
155154
/// ```
156155
///
@@ -377,7 +376,6 @@ pub fn all_tuples_enumerated(input: TokenStream) -> TokenStream {
377376
///
378377
/// ```
379378
/// // `rustdoc_internals` is needed for `#[doc(fake_variadics)]`
380-
/// #![allow(internal_features)]
381379
/// #![cfg_attr(any(docsrs, docsrs_dep), feature(rustdoc_internals))]
382380
/// ```
383381
///

0 commit comments

Comments
 (0)