about summary refs log tree commit diff
path: root/src/doc
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-09-11 00:05:41 +0000
committerbors <bors@rust-lang.org>2014-09-11 00:05:41 +0000
commit09abbbdafc08654b78c8529c1a0c03d628bb2d91 (patch)
treeaec288636a7bf0223e6965de20933b31fd661219 /src/doc
parent9f6d27c39f48895577eff1b9b42ab0e1d8e2a4a8 (diff)
parentbf274bc18bcbfea1377c5c64ae0cc099b03d9beb (diff)
auto merge of #16866 : P1start/rust/tuple-indexing, r=brson
This allows code to access the fields of tuples and tuple structs behind the feature gate `tuple_indexing`:

```rust
#![feature(tuple_indexing)]

let x = (1i, 2i);
assert_eq!(x.1, 2);

struct Point(int, int);
let origin = Point(0, 0);
assert_eq!(origin.0, 0);
assert_eq!(origin.1, 0);
```

Implements [RFC 53](https://github.com/rust-lang/rfcs/blob/master/active/0053-tuple-accessors.md). Closes #16950.
Diffstat (limited to 'src/doc')
-rw-r--r--src/doc/rust.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/doc/rust.md b/src/doc/rust.md
index eb97a75e766..fb2407e5163 100644
--- a/src/doc/rust.md
+++ b/src/doc/rust.md
@@ -2555,6 +2555,8 @@ The currently implemented features of the reference compiler are:
                         which is considered wildly unsafe and will be
                         obsoleted by language improvements.
 
+* `tuple_indexing` - Allows use of tuple indexing (expressions like `expr.0`)
+
 If a feature is promoted to a language feature, then all existing programs will
 start to receive compilation warnings about #[feature] directives which enabled
 the new feature (because the directive is no longer necessary). However, if