]> git.lizzy.rs Git - rust.git/commit
auto merge of #16866 : P1start/rust/tuple-indexing, r=brson
authorbors <bors@rust-lang.org>
Thu, 11 Sep 2014 00:05:41 +0000 (00:05 +0000)
committerbors <bors@rust-lang.org>
Thu, 11 Sep 2014 00:05:41 +0000 (00:05 +0000)
commit09abbbdafc08654b78c8529c1a0c03d628bb2d91
treeaec288636a7bf0223e6965de20933b31fd661219
parent9f6d27c39f48895577eff1b9b42ab0e1d8e2a4a8
parentbf274bc18bcbfea1377c5c64ae0cc099b03d9beb
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.
src/libsyntax/parse/parser.rs