Skip to content

Commit

Permalink
Update glossary for feature.
Browse files Browse the repository at this point in the history
Added the newly documented `target_feature` to help people disambiguate
the various usages.
  • Loading branch information
ehuss committed Apr 1, 2019
1 parent 025b01e commit e65516e
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/doc/src/appendix/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,22 @@ manifest, and individual targets can specify which edition they use. See the

### Feature

A [*feature*][feature] is a named flag which allows for conditional
compilation. A feature can refer to an optional dependency, or an arbitrary
name defined in a `Cargo.toml` manifest that can be checked within source
code.
The meaning of *feature* depends on the context:

Cargo has [*unstable feature flags*][cargo-unstable] which can be used to
enable experimental behavior of Cargo itself. The Rust compiler and Rustdoc
also have their own unstable feature flags (see [The Unstable
Book][unstable-book] and [The Rustdoc Book][rustdoc-unstable]).
- A [*feature*][feature] is a named flag which allows for conditional
compilation. A feature can refer to an optional dependency, or an arbitrary
name defined in a `Cargo.toml` manifest that can be checked within source
code.

- Cargo has [*unstable feature flags*][cargo-unstable] which can be used to
enable experimental behavior of Cargo itself.

- The Rust compiler and Rustdoc have their own unstable feature flags (see
[The Unstable Book][unstable-book] and [The Rustdoc
Book][rustdoc-unstable]).

- CPU targets have [*target features*][target-feature] which specify
capabilities of a CPU.

### Index

Expand Down Expand Up @@ -172,7 +179,7 @@ manifest is located.
[cargo-unstable]: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html
[config option]: reference/config.html
[directory layout]: reference/manifest.html#the-project-layout
[edition guide]: https://doc.rust-lang.org/edition-guide/
[edition guide]: ../edition-guide/
[edition-field]: reference/manifest.html#the-edition-field-optional
[environment variable]: reference/environment-variables.html
[feature]: reference/manifest.html#the-features-section
Expand All @@ -184,6 +191,7 @@ manifest is located.
[path overrides]: reference/specifying-dependencies.html#overriding-with-local-dependencies
[pkgid-spec]: reference/pkgid-spec.html
[rustdoc-unstable]: https://doc.rust-lang.org/nightly/rustdoc/unstable-features.html
[target-feature]: ../reference/attributes/codegen.html#the-target_feature-attribute
[targets]: reference/manifest.html#configuring-a-target
[unstable-book]: https://doc.rust-lang.org/nightly/unstable-book/index.html
[virtual]: reference/manifest.html#virtual-manifest
Expand Down

0 comments on commit e65516e

Please sign in to comment.