File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
branches/snap-stage3/src/test/run-pass Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 0de7aa55062485835bc45b962f306dddf42f372d
4
+ refs/heads/snap-stage3: ea937dca8995311c6ee8d73e0c45dab3d4c1a4f4
5
5
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -34,6 +34,12 @@ impl Point : ops::Neg<Point> {
34
34
}
35
35
}
36
36
37
+ impl Point : ops:: Not < Point > {
38
+ pure fn not ( & self ) -> Point {
39
+ Point { x : !self . x , y : !self . y }
40
+ }
41
+ }
42
+
37
43
impl Point : ops:: Index < bool , int > {
38
44
pure fn index ( & self , +x : bool ) -> int {
39
45
if x { self . x } else { self . y }
@@ -55,6 +61,11 @@ fn main() {
55
61
assert -p == Point { x : -11 , y : -22 } ;
56
62
assert p[ true ] == 11 ;
57
63
assert p[ false ] == 22 ;
64
+
65
+ let q = !p;
66
+ assert q. x == !( p. x ) ;
67
+ assert q. y == !( p. y ) ;
68
+
58
69
// Issue #1733
59
70
fn ~( _x: int) { } ( p[ true ] ) ;
60
71
}
You can’t perform that action at this time.
0 commit comments