libsyntax: (maybe) fix deriving(TotalOrd) on windows
This commit is contained in:
parent
bff3748731
commit
ea9bdaaed9
1 changed files with 6 additions and 6 deletions
|
@ -45,10 +45,10 @@ pub fn ordering_const(cx: @ext_ctxt, span: span, cnst: Ordering) -> @expr {
|
||||||
Equal => ~"Equal",
|
Equal => ~"Equal",
|
||||||
Greater => ~"Greater"
|
Greater => ~"Greater"
|
||||||
};
|
};
|
||||||
build::mk_path(cx, span,
|
build::mk_path_global(cx, span,
|
||||||
~[cx.ident_of(~"core"),
|
~[cx.ident_of(~"core"),
|
||||||
cx.ident_of(~"cmp"),
|
cx.ident_of(~"cmp"),
|
||||||
cx.ident_of(cnst)])
|
cx.ident_of(cnst)])
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn cs_cmp(cx: @ext_ctxt, span: span,
|
pub fn cs_cmp(cx: @ext_ctxt, span: span,
|
||||||
|
@ -61,7 +61,7 @@ pub fn cs_cmp(cx: @ext_ctxt, span: span,
|
||||||
// foldr (possibly) nests the matches in lexical_ordering better
|
// foldr (possibly) nests the matches in lexical_ordering better
|
||||||
false,
|
false,
|
||||||
|cx, span, old, new| {
|
|cx, span, old, new| {
|
||||||
build::mk_call(cx, span, lexical_ord, ~[old, new])
|
build::mk_call_global(cx, span, lexical_ord, ~[old, new])
|
||||||
},
|
},
|
||||||
ordering_const(cx, span, Equal),
|
ordering_const(cx, span, Equal),
|
||||||
|cx, span, list| {
|
|cx, span, list| {
|
||||||
|
@ -70,7 +70,7 @@ pub fn cs_cmp(cx: @ext_ctxt, span: span,
|
||||||
// later one
|
// later one
|
||||||
[(self_var, _, _),
|
[(self_var, _, _),
|
||||||
(other_var, _, _)] => ordering_const(cx, span,
|
(other_var, _, _)] => ordering_const(cx, span,
|
||||||
self_var.cmp(&other_var)),
|
self_var.cmp(&other_var)),
|
||||||
_ => cx.span_bug(span, "Not exactly 2 arguments in `deriving(TotalOrd)`")
|
_ => cx.span_bug(span, "Not exactly 2 arguments in `deriving(TotalOrd)`")
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue