Skip to content

Commit f103b0e

Browse files
committed
---
yaml --- r: 13855 b: refs/heads/try c: b80f0a3 h: refs/heads/master i: 13853: 28a8446 13851: 9a6f47c 13847: baeb6ee 13839: 79bc691 13823: 7e58533 v: v3
1 parent a14f70f commit f103b0e

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 7b67e2d27406d1bd2173c269b22a6166830357a0
5+
refs/heads/try: b80f0a3c9fe6a0e6d88a95b0697cb64411152530
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/comp/middle/typeck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1903,7 +1903,7 @@ fn check_expr_with_unifier(fcx: @fn_ctxt, expr: @ast::expr, unify: unifier,
19031903
oper_t = structurally_resolved_type(fcx, oper.span, oper_t);
19041904
if !(ty::type_is_integral(tcx, oper_t) ||
19051905
ty::type_is_fp(tcx, oper_t)) {
1906-
oper_t = check_user_unop(fcx, "-", "neg", expr, oper_t);
1906+
oper_t = check_user_unop(fcx, "-", "unary-", expr, oper_t);
19071907
}
19081908
}
19091909
}

branches/try/src/comp/syntax/parse/parser.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1829,7 +1829,11 @@ fn parse_method_name(p: parser) -> ast::ident {
18291829
token::BINOP(op) { p.bump(); token::binop_to_str(op) }
18301830
token::NOT { p.bump(); "!" }
18311831
token::LBRACKET { p.bump(); expect(p, token::RBRACKET); "[]" }
1832-
_ { parse_value_ident(p) }
1832+
_ {
1833+
let id = parse_value_ident(p);
1834+
if id == "unary" && eat(p, token::BINOP(token::MINUS)) { "unary-" }
1835+
else { id }
1836+
}
18331837
}
18341838
}
18351839

branches/try/src/test/run-pass/operator-overloading.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ impl point_ops for point {
77
fn -(other: point) -> point {
88
{x: self.x - other.x, y: self.y - other.y}
99
}
10-
fn neg() -> point {
10+
fn unary-() -> point {
1111
{x: -self.x, y: -self.y}
1212
}
1313
fn [](x: bool) -> int {

0 commit comments

Comments
 (0)