diff options
| author | Steve Klabnik <steve@steveklabnik.com> | 2015-04-16 13:05:42 -0400 |
|---|---|---|
| committer | Steve Klabnik <steve@steveklabnik.com> | 2015-04-16 22:23:37 -0400 |
| commit | 00a8d65ef3389164f1c71ec95f686530fdfc9d9d (patch) | |
| tree | de602da02dfbf959b33550a6ce0217e771e4cdb2 /src | |
| parent | 3908bae77b402623794370c976d6c2c2a3b699d4 (diff) | |
| download | rust-00a8d65ef3389164f1c71ec95f686530fdfc9d9d.tar.gz rust-00a8d65ef3389164f1c71ec95f686530fdfc9d9d.zip | |
document missing attributes in the reference
Fixes #24406
Diffstat (limited to 'src')
| -rw-r--r-- | src/doc/reference.md | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index 3b3c4ea6412..57110df0f9e 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2177,6 +2177,14 @@ The following configurations must be defined by the implementation: * `unix`. See `target_family`. * `windows`. See `target_family`. +You can also set another attribute based on a `cfg` variable with `cfg_attr`: + +```rust,ignore +#[cfg_attr(a, b)] +``` + +Will be the same as `#[b]` if `a` is set by `cfg`, and nothing otherwise. + ### Lint check attributes A lint check names a potentially undesirable coding pattern, such as @@ -2444,7 +2452,9 @@ The currently implemented features of the reference compiler are: * `simd_ffi` - Allows use of SIMD vectors in signatures for foreign functions. The SIMD interface is subject to change. -* `staged_api` - Allows usage of stability markers and `#![staged_api]` in a crate +* `staged_api` - Allows usage of stability markers and `#![staged_api]` in a + crate. Stability markers are also attributes: `#[stable]`, + `#[unstable]`, and `#[deprecated]` are the three levels. * `static_assert` - The `#[static_assert]` functionality is experimental and unstable. The attribute can be attached to a `static` of |
