diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2014-01-28 00:20:50 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2014-01-28 11:07:45 +1100 |
| commit | cb02a370428afaae76db59080befe88b8c97e14d (patch) | |
| tree | c967e91a172af8042410e066d1128357206105a8 /src/libsyntax/ext/deriving/cmp | |
| parent | b0280ac5385433bd663e825e24f6990a816a5f40 (diff) | |
| download | rust-cb02a370428afaae76db59080befe88b8c97e14d.tar.gz rust-cb02a370428afaae76db59080befe88b8c97e14d.zip | |
syntax: make deriving have slightly less cryptic error messages.
This unfortunately changes an error like
error: mismatched types: expected `&&NotClone` but found `&NotClone`
into
error: type `NotClone` does not implement any method in scope named `clone`
Diffstat (limited to 'src/libsyntax/ext/deriving/cmp')
| -rw-r--r-- | src/libsyntax/ext/deriving/cmp/ord.rs | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libsyntax/ext/deriving/cmp/ord.rs b/src/libsyntax/ext/deriving/cmp/ord.rs index 8a2b11b798c..5a02d8eead8 100644 --- a/src/libsyntax/ext/deriving/cmp/ord.rs +++ b/src/libsyntax/ext/deriving/cmp/ord.rs @@ -78,14 +78,10 @@ fn cs_op(less: bool, equal: bool, cx: &ExtCtxt, span: Span, substr: &Substructur _ => cx.span_bug(span, "Not exactly 2 arguments in `deriving(Ord)`") }; - let cmp = cx.expr_binary(span, op, - cx.expr_deref(span, self_f), - cx.expr_deref(span, other_f)); + let cmp = cx.expr_binary(span, op, self_f, other_f); let not_cmp = cx.expr_unary(span, ast::UnNot, - cx.expr_binary(span, op, - cx.expr_deref(span, other_f), - cx.expr_deref(span, self_f))); + cx.expr_binary(span, op, other_f, self_f)); let and = cx.expr_binary(span, ast::BiAnd, not_cmp, subexpr); cx.expr_binary(span, ast::BiOr, cmp, and) |
