|
| 1 | +- Start Date: 2014-12-02 |
| 2 | +- RFC PR: [450](https://github.com/rust-lang/rfcs/pull/450) |
| 3 | +- Rust Issue: [19469](https://github.com/rust-lang/rust/issues/19469) |
| 4 | + |
| 5 | +# Summary |
| 6 | + |
| 7 | +Remove the `tuple_indexing`, `if_let`, and `while_let` feature gates and add |
| 8 | +them to the language. |
| 9 | + |
| 10 | +# Motivation |
| 11 | + |
| 12 | +## Tuple Indexing |
| 13 | + |
| 14 | +This feature has proven to be quite useful for tuples and struct variants, and |
| 15 | +it allows for the removal of some unnecessary tuple accessing traits in the |
| 16 | +standard library (TupleN). |
| 17 | + |
| 18 | +The implementation has also proven to be quite solid with very few reported |
| 19 | +internal compiler errors related to this feature. |
| 20 | + |
| 21 | +## `if let` and `while let` |
| 22 | + |
| 23 | +This feature has also proven to be quite useful over time. Many projects are now |
| 24 | +leveraging these feature gates which is a testament to their usefulness. |
| 25 | + |
| 26 | +Additionally, the implementation has also proven to be quite solid with very |
| 27 | +few reported internal compiler errors related to this feature. |
| 28 | + |
| 29 | +# Detailed design |
| 30 | + |
| 31 | +* Remove the `if_let`, `while_let`, and `tuple_indexing` feature gates. |
| 32 | +* Add these features to the language (do not require a feature gate to use them). |
| 33 | +* Deprecate the `TupleN` traits in `std::tuple`. |
| 34 | + |
| 35 | +# Drawbacks |
| 36 | + |
| 37 | +Adding features to the language this late in the game is always somewhat of a |
| 38 | +risky business. These features, while having baked for a few weeks, haven't had |
| 39 | +much time to bake in the grand scheme of the language. These are both backwards |
| 40 | +compatible to accept, and it could be argued that this could be done later |
| 41 | +rather than sooner. |
| 42 | + |
| 43 | +In general, the major drawbacks of this RFC are the scheduling risks and |
| 44 | +"feature bloat" worries. This RFC, however, is quite easy to implement (reducing |
| 45 | +schedule risk) and concerns two fairly minor features which are unambiguously |
| 46 | +nice to have. |
| 47 | + |
| 48 | +# Alternatives |
| 49 | + |
| 50 | +* Instead of un-feature-gating before 1.0, these features could be released |
| 51 | + after 1.0 (if at all). The `TupleN` traits would then be required to be |
| 52 | + deprecated for the entire 1.0 release cycle. |
| 53 | + |
| 54 | +# Unresolved questions |
| 55 | + |
| 56 | +None at the moment. |
0 commit comments