Skip to content

Commit 06415d0

Browse files
committed
---
yaml --- r: 7869 b: refs/heads/snap-stage3 c: b80f0a3 h: refs/heads/master i: 7867: 3924c8e v: v3
1 parent 8bb8af8 commit 06415d0

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
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 2898dcc5d97da9427ac367542382b6239d9c0bbf
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7b67e2d27406d1bd2173c269b22a6166830357a0
4+
refs/heads/snap-stage3: b80f0a3c9fe6a0e6d88a95b0697cb64411152530
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/snap-stage3/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/snap-stage3/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/snap-stage3/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)