Merge branch 'deriving2derive' of https://github.com/bstrie/rfcs into bstrie-deriving2derive

This commit is contained in:
Nick Cameron 2014-12-31 16:14:08 +13:00
commit f2b44bff13
2 changed files with 32 additions and 0 deletions

View File

@ -64,6 +64,7 @@ the direction the language is evolving in.
* [0520-new-array-repeat-syntax.md](text/0520-new-array-repeat-syntax.md)
* [0522-self-impl.md](text/0522-self-impl.md)
* [0532-self-in-use.md](text/0532-self-in-use.md)
* [0534-deriving2derive.md](text/0534-deriving2derive.md)
## Table of Contents
[Table of Contents]: #table-of-contents

View File

@ -0,0 +1,31 @@
- Start Date: 2014-19-19
- RFC PR: [534](https://github.com/rust-lang/rfcs/pull/534)
- Rust Issue: [20362](https://github.com/rust-lang/rust/issues/20362)
# Summary
Rename the `#[deriving(Foo)]` syntax extension to `#[derive(Foo)]`.
# Motivation
Unlike our other verb-based attribute names, "deriving" stands alone as a
present participle. By convention our attributes prefer "warn" rather than
"warning", "inline" rather than "inlining", "test" rather than "testing", and so
on. We also have a trend against present participles in general, such as with
`Encoding` being changed to `Encode`.
It's also shorter to type, which is very important in a world without implicit
Copy implementations.
Finally, if I may be subjective, `derive(Thing1, Thing2)` simply reads better
than `deriving(Thing1, Thing2)`.
# Detailed design
Rename the `deriving` attribute to `derive`. This should be a very simple find-
and-replace.
# Drawbacks
Participles the world over will lament the loss of their only foothold in this
promising young language.