about summary refs log tree commit diff
path: root/src/doc/reference.md
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-09-26 00:14:39 +0000
committerbors <bors@rust-lang.org>2015-09-26 00:14:39 +0000
commit78ce46ffddfed7dee58569b5f30242b00d299dfe (patch)
treeae80a901ab56af79be5338bdb61cf2bdffc6a66b /src/doc/reference.md
parent69f27c856b3e18e54b9a48412a918c91fe8b08e7 (diff)
parentabfedb7d16fc536e85e271f945195335ca0ba9e0 (diff)
downloadrust-78ce46ffddfed7dee58569b5f30242b00d299dfe.tar.gz
rust-78ce46ffddfed7dee58569b5f30242b00d299dfe.zip
Auto merge of #28612 - gandro:targetvendor, r=alexcrichton
This adds a new target property, `target_vendor`. It is to be be used as a matcher for conditional compilation. The vendor is part of the [autoconf target triple](http://llvm.org/docs/doxygen/html/classllvm_1_1Triple.html#details): `<arch><sub>-<vendor>-<os>-<env>`. `arch`, `target_os` and `target_env` are already supported by Rust.

This change was suggested in PR #28593. It enables conditional compilation based on the vendor. This is needed for the rumprun target, which needs to match against both, target_os and target_vendor.

The default value for `target_vendor` is "unknown", "apple" and "pc" are other common values.

Matching against the `target_vendor` is introduced behind the feature gate `#![feature(cfg_target_vendor)]`.

This is the first time I messed around with rustc internals. I just added the my code where I found the existing `target_*` variables, hopefully I haven't missed anything. Please review with care. :)

r? @alexcrichton 
Diffstat (limited to 'src/doc/reference.md')
-rw-r--r--src/doc/reference.md7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md
index cd24e33a232..eeae2de827a 100644
--- a/src/doc/reference.md
+++ b/src/doc/reference.md
@@ -2093,6 +2093,8 @@ The following configurations must be defined by the implementation:
 * `target_pointer_width = "..."` - Target pointer width in bits. This is set
   to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
   64-bit pointers.
+* `target_vendor = "..."` - Vendor of the target, for example `apple`, `pc`, or
+  simply `"unknown"`.
 * `test` - Enabled when compiling the test harness (using the `--test` flag).
 * `unix` - See `target_family`.
 * `windows` - See `target_family`.
@@ -2269,7 +2271,7 @@ The currently implemented features of the reference compiler are:
 * `advanced_slice_patterns` - See the [match expressions](#match-expressions)
                               section for discussion; the exact semantics of
                               slice patterns are subject to change, so some types
-			      are still unstable.
+                              are still unstable.
 
 * `slice_patterns` - OK, actually, slice patterns are just scary and
                      completely unstable.
@@ -2290,6 +2292,9 @@ The currently implemented features of the reference compiler are:
 * `box_syntax` - Allows use of `box` expressions, the exact semantics of which
                  is subject to change.
 
+* `cfg_target_vendor` - Allows conditional compilation using the `target_vendor`
+                        matcher which is subject to change.
+
 * `concat_idents` - Allows use of the `concat_idents` macro, which is in many
                     ways insufficient for concatenating identifiers, and may be
                     removed entirely for something more wholesome.