Skip to content

Commit 9bff6c1

Browse files
committed
---
yaml --- r: 140280 b: refs/heads/try2 c: dd310d6 h: refs/heads/master v: v3
1 parent e4f8397 commit 9bff6c1

File tree

4 files changed

+22
-17
lines changed

4 files changed

+22
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 9455eaf77bef8f225e146e61107d26010f137b51
8+
refs/heads/try2: dd310d6c3b635628f584f3266b3ab31888fd0e95
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/test/auxiliary/issue2378a.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[link (name = "issue2378a")];
12+
#[crate_type = "lib"];
13+
1114
enum maybe<T> { just(T), nothing }
1215

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 {
1518
match self {
16-
just(t) { t }
17-
nothing { fail!(); }
19+
&just(ref t) => copy *t,
20+
&nothing => { fail!(); }
1821
}
1922
}
2023
}

branches/try2/src/test/auxiliary/issue2378b.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use issue2378a;
11+
#[link (name = "issue2378b")];
12+
#[crate_type = "lib"];
13+
14+
extern mod issue2378a;
1215

1316
use issue2378a::maybe;
14-
use issue2378a::methods;
1517

16-
type two_maybes<T> = {a: maybe<T>, b: maybe<T>};
18+
struct two_maybes<T> {a: maybe<T>, b: maybe<T>}
1719

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])
2123
}
2224
}

branches/try2/src/test/run-pass/issue2378c.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test -- #2378 unfixed
1211
// aux-build:issue2378a.rs
1312
// aux-build:issue2378b.rs
13+
// xfail-fast - check-fast doesn't understand aux-build
1414

15-
use issue2378a;
16-
use issue2378b;
15+
extern mod issue2378a;
16+
extern mod issue2378b;
1717

18-
use issue2378a::{just, methods};
19-
use issue2378b::{methods};
18+
use issue2378a::{just};
19+
use issue2378b::{two_maybes};
2020

2121
pub fn main() {
22-
let x = {a: just(3), b: just(5)};
22+
let x = two_maybes{a: just(3), b: just(5)};
2323
assert!(x[0u] == (3, 5));
2424
}

0 commit comments

Comments
 (0)