diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-11-06 18:32:51 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-11-06 18:32:51 +0100 |
| commit | 0282c27781b2f7501f4385ef22da82acc179c00e (patch) | |
| tree | f55208a7cfe650d195d2beb5581f288ffee16b3b /src/doc | |
| parent | e8b190ac4ad79e58d21ee1d573529ff74d8eedaa (diff) | |
| download | rust-0282c27781b2f7501f4385ef22da82acc179c00e.tar.gz rust-0282c27781b2f7501f4385ef22da82acc179c00e.zip | |
rename cfg(rustdoc) into cfg(doc)
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/rustdoc/src/unstable-features.md | 8 | ||||
| -rw-r--r-- | src/doc/unstable-book/src/language-features/doc-cfg.md | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/doc/rustdoc/src/unstable-features.md b/src/doc/rustdoc/src/unstable-features.md index 3c3e72aa379..f8be04a1087 100644 --- a/src/doc/rustdoc/src/unstable-features.md +++ b/src/doc/rustdoc/src/unstable-features.md @@ -106,11 +106,11 @@ item, it will be accompanied by a banner explaining that the item is only availa platforms. For Rustdoc to document an item, it needs to see it, regardless of what platform it's currently -running on. To aid this, Rustdoc sets the flag `#[cfg(rustdoc)]` when running on your crate. +running on. To aid this, Rustdoc sets the flag `#[cfg(doc)]` when running on your crate. Combining this with the target platform of a given item allows it to appear when building your crate normally on that platform, as well as when building documentation anywhere. -For example, `#[cfg(any(windows, rustdoc))]` will preserve the item either on Windows or during the +For example, `#[cfg(any(windows, doc))]` will preserve the item either on Windows or during the documentation process. Then, adding a new attribute `#[doc(cfg(windows))]` will tell Rustdoc that the item is supposed to be used on Windows. For example: @@ -118,12 +118,12 @@ the item is supposed to be used on Windows. For example: #![feature(doc_cfg)] /// Token struct that can only be used on Windows. -#[cfg(any(windows, rustdoc))] +#[cfg(any(windows, doc))] #[doc(cfg(windows))] pub struct WindowsToken; /// Token struct that can only be used on Unix. -#[cfg(any(unix, rustdoc))] +#[cfg(any(unix, doc))] #[doc(cfg(unix))] pub struct UnixToken; ``` diff --git a/src/doc/unstable-book/src/language-features/doc-cfg.md b/src/doc/unstable-book/src/language-features/doc-cfg.md index 96c66a1515e..e75f1aea992 100644 --- a/src/doc/unstable-book/src/language-features/doc-cfg.md +++ b/src/doc/unstable-book/src/language-features/doc-cfg.md @@ -13,7 +13,7 @@ This attribute has two effects: 2. The item's doc-tests will only run on the specific platform. In addition to allowing the use of the `#[doc(cfg)]` attribute, this feature enables the use of a -special conditional compilation flag, `#[cfg(rustdoc)]`, set whenever building documentation on your +special conditional compilation flag, `#[cfg(doc)]`, set whenever building documentation on your crate. This feature was introduced as part of PR [#43348] to allow the platform-specific parts of the @@ -22,7 +22,7 @@ standard library be documented. ```rust #![feature(doc_cfg)] -#[cfg(any(windows, rustdoc))] +#[cfg(any(windows, doc))] #[doc(cfg(windows))] /// The application's icon in the notification area (a.k.a. system tray). /// |
