File tree Expand file tree Collapse file tree 4 files changed +22
-17
lines changed Expand file tree Collapse file tree 4 files changed +22
-17
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 9455eaf77bef8f225e146e61107d26010f137b51
8
+ refs/heads/try2: dd310d6c3b635628f584f3266b3ab31888fd0e95
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
+ #[ link ( name = "issue2378a" ) ] ;
12
+ #[ crate_type = "lib" ] ;
13
+
11
14
enum maybe < T > { just( T ) , nothing }
12
15
13
- impl copy > for maybe < T > for methods< T {
14
- fn ~ [ ] ( idx: uint) -> T {
16
+ impl < T : Copy > Index < uint , T > for maybe < T > {
17
+ fn index ( & self , idx : & uint ) -> T {
15
18
match self {
16
- just( t) { t }
17
- nothing { fail!( ) ; }
19
+ & just( ref t) => copy * t ,
20
+ & nothing => { fail ! ( ) ; }
18
21
}
19
22
}
20
23
}
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- use issue2378a;
11
+ #[ link ( name = "issue2378b" ) ] ;
12
+ #[ crate_type = "lib" ] ;
13
+
14
+ extern mod issue2378a;
12
15
13
16
use issue2378a:: maybe;
14
- use issue2378a:: methods;
15
17
16
- type two_maybes < T > = { a : maybe < T > , b : maybe < T > } ;
18
+ struct two_maybes < T > { a : maybe < T > , b : maybe < T > }
17
19
18
- impl copy > for two_maybes < T > for methods< T {
19
- fn ~ [ ] ( idx: uint) -> ( T , T ) {
20
- ( self . a [ idx] , self . b [ idx] )
20
+ impl < T : Copy > Index < uint , ( T , T ) > for two_maybes < T > {
21
+ fn index ( & self , idx : & uint ) -> ( T , T ) {
22
+ ( self . a [ * idx] , self . b [ * idx] )
21
23
}
22
24
}
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- // xfail-test -- #2378 unfixed
12
11
// aux-build:issue2378a.rs
13
12
// aux-build:issue2378b.rs
13
+ // xfail-fast - check-fast doesn't understand aux-build
14
14
15
- use issue2378a;
16
- use issue2378b;
15
+ extern mod issue2378a;
16
+ extern mod issue2378b;
17
17
18
- use issue2378a:: { just, methods } ;
19
- use issue2378b:: { methods } ;
18
+ use issue2378a:: { just} ;
19
+ use issue2378b:: { two_maybes } ;
20
20
21
21
pub fn main ( ) {
22
- let x = { a: just ( 3 ) , b: just ( 5 ) } ;
22
+ let x = two_maybes { a : just ( 3 ) , b : just ( 5 ) } ;
23
23
assert ! ( x[ 0 u] == ( 3 , 5 ) ) ;
24
24
}
You can’t perform that action at this time.
0 commit comments