File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
branches/incoming/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 @@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9
- refs/heads/incoming: 0de7aa55062485835bc45b962f306dddf42f372d
9
+ refs/heads/incoming: ea937dca8995311c6ee8d73e0c45dab3d4c1a4f4
10
10
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
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