Skip to content

Commit 8691448

Browse files
committed
---
yaml --- r: 39797 b: refs/heads/incoming c: ea937dc h: refs/heads/master i: 39795: 2c5cc63 v: v3
1 parent c0d8626 commit 8691448

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: 0de7aa55062485835bc45b962f306dddf42f372d
9+
refs/heads/incoming: ea937dca8995311c6ee8d73e0c45dab3d4c1a4f4
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ impl Point : ops::Neg<Point> {
3434
}
3535
}
3636

37+
impl Point : ops::Not<Point> {
38+
pure fn not(&self) -> Point {
39+
Point {x: !self.x, y: !self.y }
40+
}
41+
}
42+
3743
impl Point : ops::Index<bool,int> {
3844
pure fn index(&self, +x: bool) -> int {
3945
if x { self.x } else { self.y }
@@ -55,6 +61,11 @@ fn main() {
5561
assert -p == Point {x: -11, y: -22};
5662
assert p[true] == 11;
5763
assert p[false] == 22;
64+
65+
let q = !p;
66+
assert q.x == !(p.x);
67+
assert q.y == !(p.y);
68+
5869
// Issue #1733
5970
fn~(_x: int){}(p[true]);
6071
}

0 commit comments

Comments
 (0)