Update Partial/Total Eq/Ord terminology
This commit is contained in:
parent
3c442b92ae
commit
54068eea42
3 changed files with 7 additions and 7 deletions
|
@ -30,7 +30,7 @@ pub fn expand_deriving_eq(cx: &mut ExtCtxt,
|
||||||
|cx, span, subexpr, self_f, other_fs| {
|
|cx, span, subexpr, self_f, other_fs| {
|
||||||
let other_f = match other_fs {
|
let other_f = match other_fs {
|
||||||
[ref o_f] => o_f,
|
[ref o_f] => o_f,
|
||||||
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(Eq)`")
|
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(PartialEq)`")
|
||||||
};
|
};
|
||||||
|
|
||||||
let eq = cx.expr_binary(span, ast::BiEq, self_f, other_f.clone());
|
let eq = cx.expr_binary(span, ast::BiEq, self_f, other_f.clone());
|
||||||
|
@ -47,7 +47,7 @@ pub fn expand_deriving_eq(cx: &mut ExtCtxt,
|
||||||
|cx, span, subexpr, self_f, other_fs| {
|
|cx, span, subexpr, self_f, other_fs| {
|
||||||
let other_f = match other_fs {
|
let other_f = match other_fs {
|
||||||
[ref o_f] => o_f,
|
[ref o_f] => o_f,
|
||||||
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(Eq)`")
|
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(PartialEq)`")
|
||||||
};
|
};
|
||||||
|
|
||||||
let eq = cx.expr_binary(span, ast::BiNe, self_f, other_f.clone());
|
let eq = cx.expr_binary(span, ast::BiNe, self_f, other_f.clone());
|
||||||
|
|
|
@ -146,7 +146,7 @@ pub fn cs_partial_cmp(cx: &mut ExtCtxt, span: Span,
|
||||||
let new = {
|
let new = {
|
||||||
let other_f = match other_fs {
|
let other_f = match other_fs {
|
||||||
[ref o_f] => o_f,
|
[ref o_f] => o_f,
|
||||||
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(Ord)`"),
|
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(PartialOrd)`"),
|
||||||
};
|
};
|
||||||
|
|
||||||
let args = vec![
|
let args = vec![
|
||||||
|
@ -170,7 +170,7 @@ pub fn cs_partial_cmp(cx: &mut ExtCtxt, span: Span,
|
||||||
equals_expr.clone(),
|
equals_expr.clone(),
|
||||||
|cx, span, (self_args, tag_tuple), _non_self_args| {
|
|cx, span, (self_args, tag_tuple), _non_self_args| {
|
||||||
if self_args.len() != 2 {
|
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 `deriving(PartialOrd)`")
|
||||||
} else {
|
} else {
|
||||||
some_ordering_collapsed(cx, span, PartialCmpOp, tag_tuple)
|
some_ordering_collapsed(cx, span, PartialCmpOp, tag_tuple)
|
||||||
}
|
}
|
||||||
|
@ -204,7 +204,7 @@ fn cs_op(less: bool, equal: bool, cx: &mut ExtCtxt,
|
||||||
*/
|
*/
|
||||||
let other_f = match other_fs {
|
let other_f = match other_fs {
|
||||||
[ref o_f] => o_f,
|
[ref o_f] => o_f,
|
||||||
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(Ord)`")
|
_ => cx.span_bug(span, "not exactly 2 arguments in `deriving(PartialOrd)`")
|
||||||
};
|
};
|
||||||
|
|
||||||
let cmp = cx.expr_binary(span, op, self_f.clone(), other_f.clone());
|
let cmp = cx.expr_binary(span, op, self_f.clone(), other_f.clone());
|
||||||
|
@ -218,7 +218,7 @@ fn cs_op(less: bool, equal: bool, cx: &mut ExtCtxt,
|
||||||
cx.expr_bool(span, equal),
|
cx.expr_bool(span, equal),
|
||||||
|cx, span, (self_args, tag_tuple), _non_self_args| {
|
|cx, span, (self_args, tag_tuple), _non_self_args| {
|
||||||
if self_args.len() != 2 {
|
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 `deriving(PartialOrd)`")
|
||||||
} else {
|
} else {
|
||||||
let op = match (less, equal) {
|
let op = match (less, equal) {
|
||||||
(true, true) => LeOp, (true, false) => LtOp,
|
(true, true) => LeOp, (true, false) => LtOp,
|
||||||
|
|
|
@ -108,7 +108,7 @@ pub fn cs_cmp(cx: &mut ExtCtxt, span: Span,
|
||||||
cx.expr_path(equals_path.clone()),
|
cx.expr_path(equals_path.clone()),
|
||||||
|cx, span, (self_args, tag_tuple), _non_self_args| {
|
|cx, span, (self_args, tag_tuple), _non_self_args| {
|
||||||
if self_args.len() != 2 {
|
if self_args.len() != 2 {
|
||||||
cx.span_bug(span, "not exactly 2 arguments in `deriving(TotalOrd)`")
|
cx.span_bug(span, "not exactly 2 arguments in `deriving(Ord)`")
|
||||||
} else {
|
} else {
|
||||||
ordering_collapsed(cx, span, tag_tuple)
|
ordering_collapsed(cx, span, tag_tuple)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue