Skip to content

Commit 5d9460d

Browse files
committed
---
yaml --- r: 57291 b: refs/heads/try c: e2c09fa h: refs/heads/master i: 57289: 80afea8 57287: 10149e6 v: v3
1 parent 6a326df commit 5d9460d

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 79a2b2eafc3c766cecec8a5f76317693bae9ed17
5-
refs/heads/try: 32840a44295ebcfdd21b73ef4704f6e06b4f6437
5+
refs/heads/try: e2c09fa3b997e09176d7cca228be2727ba525aa5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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/try/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/try/src/test/run-pass/issue2378c.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@
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
1413

15-
use issue2378a;
16-
use issue2378b;
14+
extern mod issue2378a;
15+
extern mod issue2378b;
1716

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

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

0 commit comments

Comments
 (0)