|
9 | 9 | // except according to those terms. |
10 | 10 |
|
11 | 11 | //! Some code that abstracts away much of the boilerplate of writing |
12 | | -//! `deriving` instances for traits. Among other things it manages getting |
| 12 | +//! `derive` instances for traits. Among other things it manages getting |
13 | 13 | //! access to the fields of the 4 different sorts of structs and enum |
14 | 14 | //! variants, as well as creating the method and impl ast instances. |
15 | 15 | //! |
|
26 | 26 | //! moment. (`TraitDef.additional_bounds`) |
27 | 27 | //! |
28 | 28 | //! Unsupported: FIXME #6257: calling methods on reference fields, |
29 | | -//! e.g. deriving Eq/Ord/Clone don't work on `struct A(&int)`, |
| 29 | +//! e.g. derive Eq/Ord/Clone don't work on `struct A(&int)`, |
30 | 30 | //! because of how the auto-dereferencing happens. |
31 | 31 | //! |
32 | 32 | //! The most important thing for implementers is the `Substructure` and |
@@ -209,7 +209,7 @@ use self::ty::{LifetimeBounds, Path, Ptr, PtrTy, Self, Ty}; |
209 | 209 | pub mod ty; |
210 | 210 |
|
211 | 211 | pub struct TraitDef<'a> { |
212 | | - /// The span for the current #[deriving(Foo)] header. |
| 212 | + /// The span for the current #[derive(Foo)] header. |
213 | 213 | pub span: Span, |
214 | 214 |
|
215 | 215 | pub attributes: Vec<ast::Attribute>, |
@@ -354,7 +354,7 @@ impl<'a> TraitDef<'a> { |
354 | 354 | generics) |
355 | 355 | } |
356 | 356 | _ => { |
357 | | - cx.span_err(mitem.span, "`deriving` may only be applied to structs and enums"); |
| 357 | + cx.span_err(mitem.span, "`derive` may only be applied to structs and enums"); |
358 | 358 | return; |
359 | 359 | } |
360 | 360 | }; |
@@ -718,7 +718,7 @@ impl<'a> MethodDef<'a> { |
718 | 718 | } |
719 | 719 |
|
720 | 720 | /// ``` |
721 | | - /// #[deriving(PartialEq)] |
| 721 | + /// #[derive(PartialEq)] |
722 | 722 | /// struct A { x: int, y: int } |
723 | 723 | /// |
724 | 724 | /// // equivalent to: |
@@ -782,7 +782,7 @@ impl<'a> MethodDef<'a> { |
782 | 782 | } else { |
783 | 783 | cx.span_bug(trait_.span, |
784 | 784 | "no self arguments to non-static method in generic \ |
785 | | - `deriving`") |
| 785 | + `derive`") |
786 | 786 | }; |
787 | 787 |
|
788 | 788 | // body of the inner most destructuring match |
@@ -822,7 +822,7 @@ impl<'a> MethodDef<'a> { |
822 | 822 | } |
823 | 823 |
|
824 | 824 | /// ``` |
825 | | - /// #[deriving(PartialEq)] |
| 825 | + /// #[derive(PartialEq)] |
826 | 826 | /// enum A { |
827 | 827 | /// A1, |
828 | 828 | /// A2(int) |
@@ -1185,7 +1185,7 @@ impl<'a> TraitDef<'a> { |
1185 | 1185 | cx: &mut ExtCtxt, |
1186 | 1186 | mut to_set: Span) -> Span { |
1187 | 1187 | let trait_name = match self.path.path.last() { |
1188 | | - None => cx.span_bug(self.span, "trait with empty path in generic `deriving`"), |
| 1188 | + None => cx.span_bug(self.span, "trait with empty path in generic `derive`"), |
1189 | 1189 | Some(name) => *name |
1190 | 1190 | }; |
1191 | 1191 | to_set.expn_id = cx.codemap().record_expansion(codemap::ExpnInfo { |
@@ -1215,7 +1215,7 @@ impl<'a> TraitDef<'a> { |
1215 | 1215 | match (just_spans.is_empty(), named_idents.is_empty()) { |
1216 | 1216 | (false, false) => cx.span_bug(self.span, |
1217 | 1217 | "a struct with named and unnamed \ |
1218 | | - fields in generic `deriving`"), |
| 1218 | + fields in generic `derive`"), |
1219 | 1219 | // named fields |
1220 | 1220 | (_, false) => Named(named_idents), |
1221 | 1221 | // tuple structs (includes empty structs) |
@@ -1263,7 +1263,7 @@ impl<'a> TraitDef<'a> { |
1263 | 1263 | None |
1264 | 1264 | } |
1265 | 1265 | _ => { |
1266 | | - cx.span_bug(sp, "a struct with named and unnamed fields in `deriving`"); |
| 1266 | + cx.span_bug(sp, "a struct with named and unnamed fields in `derive`"); |
1267 | 1267 | } |
1268 | 1268 | }; |
1269 | 1269 | let ident = cx.ident_of(format!("{}_{}", prefix, i)[]); |
@@ -1371,7 +1371,7 @@ pub fn cs_fold<F>(use_foldl: bool, |
1371 | 1371 | enum_nonmatch_f(cx, trait_span, (all_args[], tuple), |
1372 | 1372 | substructure.nonself_args), |
1373 | 1373 | StaticEnum(..) | StaticStruct(..) => { |
1374 | | - cx.span_bug(trait_span, "static function in `deriving`") |
| 1374 | + cx.span_bug(trait_span, "static function in `derive`") |
1375 | 1375 | } |
1376 | 1376 | } |
1377 | 1377 | } |
@@ -1411,7 +1411,7 @@ pub fn cs_same_method<F>(f: F, |
1411 | 1411 | enum_nonmatch_f(cx, trait_span, (all_self_args[], tuple), |
1412 | 1412 | substructure.nonself_args), |
1413 | 1413 | StaticEnum(..) | StaticStruct(..) => { |
1414 | | - cx.span_bug(trait_span, "static function in `deriving`") |
| 1414 | + cx.span_bug(trait_span, "static function in `derive`") |
1415 | 1415 | } |
1416 | 1416 | } |
1417 | 1417 | } |
|
0 commit comments