File tree Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Expand file tree Collapse file tree 4 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 44c100c28df866041633a8338b7935d061afd9bb
2
+ refs/heads/master: 81caf926b4ecf9a6c48f2f7ade2102e8876e6677
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
5
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf
Original file line number Diff line number Diff line change
1
+ enum maybe < T > { just( T ) , nothing }
2
+
3
+ impl methods < T : copy > for maybe < T > {
4
+ fn [ ] ( idx: uint) -> T {
5
+ alt self {
6
+ just ( t ) { t }
7
+ nothing { fail; }
8
+ }
9
+ }
10
+ }
Original file line number Diff line number Diff line change
1
+ use issue2378a;
2
+
3
+ import issue2378a:: maybe;
4
+ import issue2378a:: methods;
5
+
6
+ type two_maybes < T > = { a : maybe < T > , b : maybe < T > } ;
7
+
8
+ impl methods < T : copy > for two_maybes < T > {
9
+ fn [ ] ( idx: uint ) -> ( T , T ) {
10
+ ( self . a [ idx] , self . b [ idx] )
11
+ }
12
+ }
Original file line number Diff line number Diff line change
1
+ // xfail-test -- #2378 unfixed
2
+ // aux-build:issue2378a.rs
3
+ // aux-build:issue2378b.rs
4
+
5
+ use issue2378a;
6
+ use issue2378b;
7
+
8
+ import issue2378a:: { just, methods} ;
9
+ import issue2378b:: { methods} ;
10
+
11
+ fn main ( ) {
12
+ let x = { a: just ( 3 ) , b: just ( 5 ) } ;
13
+ assert x[ 0 u] == ( 3 , 5 ) ;
14
+ }
You can’t perform that action at this time.
0 commit comments