s/deriving/derives in Comments/Docs

There are a large number of places that incorrectly refer
to deriving in comments, instead of derives.

Fixes #20984
This commit is contained in:
Earl St Sauver 2015-01-12 02:02:38 -08:00
parent 89c4e3792d
commit 6ab95bdd62
18 changed files with 38 additions and 38 deletions

View file

@ -80,11 +80,11 @@ fn cs_clone(
EnumNonMatchingCollapsed (..) => {
cx.span_bug(trait_span,
&format!("non-matching enum variants in \
`deriving({})`", name)[])
`derive({})`", name)[])
}
StaticEnum(..) | StaticStruct(..) => {
cx.span_bug(trait_span,
&format!("static method in `deriving({})`", name)[])
&format!("static method in `derive({})`", name)[])
}
}
@ -101,7 +101,7 @@ fn cs_clone(
None => {
cx.span_bug(trait_span,
&format!("unnamed field in normal struct in \
`deriving({})`", name)[])
`derive({})`", name)[])
}
};
cx.field_imm(field.span, ident, subcall(field))

View file

@ -32,7 +32,7 @@ pub fn expand_deriving_eq<F>(cx: &mut ExtCtxt,
|cx, span, subexpr, self_f, other_fs| {
let other_f = match other_fs {
[ref o_f] => o_f,
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(PartialEq)`")
_ => cx.span_bug(span, "not exactly 2 arguments in `derive(PartialEq)`")
};
let eq = cx.expr_binary(span, ast::BiEq, self_f, other_f.clone());
@ -49,7 +49,7 @@ pub fn expand_deriving_eq<F>(cx: &mut ExtCtxt,
|cx, span, subexpr, self_f, other_fs| {
let other_f = match other_fs {
[ref o_f] => o_f,
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(PartialEq)`")
_ => cx.span_bug(span, "not exactly 2 arguments in `derive(PartialEq)`")
};
let eq = cx.expr_binary(span, ast::BiNe, self_f, other_f.clone());

View file

@ -152,7 +152,7 @@ pub fn cs_partial_cmp(cx: &mut ExtCtxt, span: Span,
let new = {
let other_f = match other_fs {
[ref o_f] => o_f,
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(PartialOrd)`"),
_ => cx.span_bug(span, "not exactly 2 arguments in `derive(PartialOrd)`"),
};
let args = vec![
@ -176,7 +176,7 @@ pub fn cs_partial_cmp(cx: &mut ExtCtxt, span: Span,
equals_expr.clone(),
box |cx, span, (self_args, tag_tuple), _non_self_args| {
if self_args.len() != 2 {
cx.span_bug(span, "not exactly 2 arguments in `deriving(PartialOrd)`")
cx.span_bug(span, "not exactly 2 arguments in `derive(PartialOrd)`")
} else {
some_ordering_collapsed(cx, span, PartialCmpOp, tag_tuple)
}
@ -210,7 +210,7 @@ fn cs_op(less: bool, equal: bool, cx: &mut ExtCtxt,
*/
let other_f = match other_fs {
[ref o_f] => o_f,
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(PartialOrd)`")
_ => cx.span_bug(span, "not exactly 2 arguments in `derive(PartialOrd)`")
};
let cmp = cx.expr_binary(span, op, self_f.clone(), other_f.clone());
@ -224,7 +224,7 @@ fn cs_op(less: bool, equal: bool, cx: &mut ExtCtxt,
cx.expr_bool(span, equal),
box |cx, span, (self_args, tag_tuple), _non_self_args| {
if self_args.len() != 2 {
cx.span_bug(span, "not exactly 2 arguments in `deriving(PartialOrd)`")
cx.span_bug(span, "not exactly 2 arguments in `derive(PartialOrd)`")
} else {
let op = match (less, equal) {
(true, true) => LeOp, (true, false) => LtOp,

View file

@ -32,7 +32,7 @@ pub fn expand_deriving_totaleq<F>(cx: &mut ExtCtxt,
let block = cx.block(span, stmts, None);
cx.expr_block(block)
},
box |cx, sp, _, _| cx.span_bug(sp, "non matching enums in deriving(Eq)?"),
box |cx, sp, _, _| cx.span_bug(sp, "non matching enums in derive(Eq)?"),
cx,
span,
substr)

View file

@ -108,7 +108,7 @@ pub fn cs_cmp(cx: &mut ExtCtxt, span: Span,
let new = {
let other_f = match other_fs {
[ref o_f] => o_f,
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(PartialOrd)`"),
_ => cx.span_bug(span, "not exactly 2 arguments in `derive(PartialOrd)`"),
};
let args = vec![
@ -132,7 +132,7 @@ pub fn cs_cmp(cx: &mut ExtCtxt, span: Span,
cx.expr_path(equals_path.clone()),
box |cx, span, (self_args, tag_tuple), _non_self_args| {
if self_args.len() != 2 {
cx.span_bug(span, "not exactly 2 arguments in `deriving(Ord)`")
cx.span_bug(span, "not exactly 2 arguments in `derives(Ord)`")
} else {
ordering_collapsed(cx, span, tag_tuple)
}

View file

@ -173,7 +173,7 @@ fn decodable_substructure(cx: &mut ExtCtxt, trait_span: Span,
cx.lambda_expr_1(trait_span, result, blkarg)
))
}
_ => cx.bug("expected StaticEnum or StaticStruct in deriving(Decodable)")
_ => cx.bug("expected StaticEnum or StaticStruct in derive(Decodable)")
};
}

View file

@ -81,6 +81,6 @@ fn default_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructur
// let compilation continue
cx.expr_uint(trait_span, 0)
}
_ => cx.span_bug(trait_span, "Non-static method in `deriving(Default)`")
_ => cx.span_bug(trait_span, "Non-static method in `derive(Default)`")
};
}

View file

@ -276,6 +276,6 @@ fn encodable_substructure(cx: &mut ExtCtxt, trait_span: Span,
cx.expr_block(cx.block(trait_span, vec!(me), Some(ret)))
}
_ => cx.bug("expected Struct or EnumMatching in deriving(Encodable)")
_ => cx.bug("expected Struct or EnumMatching in derive(Encodable)")
};
}

View file

@ -1191,7 +1191,7 @@ impl<'a> TraitDef<'a> {
to_set.expn_id = cx.codemap().record_expansion(codemap::ExpnInfo {
call_site: to_set,
callee: codemap::NameAndSpan {
name: format!("deriving({})", trait_name),
name: format!("derive({})", trait_name),
format: codemap::MacroAttribute,
span: Some(self.span)
}

View file

@ -182,8 +182,8 @@ impl<'a> Ty<'a> {
Literal(ref p) => {
p.to_path(cx, span, self_ty, self_generics)
}
Ptr(..) => { cx.span_bug(span, "pointer in a path in generic `deriving`") }
Tuple(..) => { cx.span_bug(span, "tuple in a path in generic `deriving`") }
Ptr(..) => { cx.span_bug(span, "pointer in a path in generic `derive`") }
Tuple(..) => { cx.span_bug(span, "tuple in a path in generic `derive`") }
}
}
}

View file

@ -74,7 +74,7 @@ pub fn expand_deriving_from_primitive<F>(cx: &mut ExtCtxt,
fn cs_from(name: &str, cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> P<Expr> {
let n = match substr.nonself_args {
[ref n] => n,
_ => cx.span_bug(trait_span, "incorrect number of arguments in `deriving(FromPrimitive)`")
_ => cx.span_bug(trait_span, "incorrect number of arguments in `derive(FromPrimitive)`")
};
match *substr.fields {
@ -144,6 +144,6 @@ fn cs_from(name: &str, cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure
cx.expr_match(trait_span, n.clone(), arms)
}
_ => cx.span_bug(trait_span, "expected StaticEnum in deriving(FromPrimitive)")
_ => cx.span_bug(trait_span, "expected StaticEnum in derive(FromPrimitive)")
}
}

View file

@ -57,7 +57,7 @@ pub fn expand_deriving_rand<F>(cx: &mut ExtCtxt,
fn rand_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure) -> P<Expr> {
let rng = match substr.nonself_args {
[ref rng] => rng,
_ => cx.bug("Incorrect number of arguments to `rand` in `deriving(Rand)`")
_ => cx.bug("Incorrect number of arguments to `rand` in `derive(Rand)`")
};
let rand_ident = vec!(
cx.ident_of("std"),
@ -131,7 +131,7 @@ fn rand_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructure)
let block = cx.block(trait_span, vec!( let_statement ), Some(match_expr));
cx.expr_block(block)
}
_ => cx.bug("Non-static method in `deriving(Rand)`")
_ => cx.bug("Non-static method in `derive(Rand)`")
};
fn rand_thing<F>(cx: &mut ExtCtxt,