Skip to content

Commit b5cc02f

Browse files
committed
---
yaml --- r: 140286 b: refs/heads/try2 c: 178305f h: refs/heads/master v: v3
1 parent 1abf17a commit b5cc02f

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
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: d6bb587c12da816b2872db1c1f9154a58fc91006
8+
refs/heads/try2: 178305ffecf4e183a425028ba53b39a4f4dd1121
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/test/run-pass/issue-2185.rs

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

11-
// xfail-test FIXME #2263
11+
// does the second one subsume the first?
12+
// xfail-test
1213
// xfail-fast
14+
15+
// notes on this test case:
16+
// On Thu, Apr 18, 2013 at 6:30 PM, John Clements <[email protected]> wrote:
17+
// the "issue-2185.rs" test was xfailed with a ref to #2263. Issue #2263 is now fixed, so I tried it again, and after adding some &self parameters, I got this error:
18+
//
19+
// Running /usr/local/bin/rustc:
20+
// issue-2185.rs:24:0: 26:1 error: conflicting implementations for a trait
21+
// issue-2185.rs:24 impl iterable<uint> for @fn(&fn(uint)) {
22+
// issue-2185.rs:25 fn iter(&self, blk: &fn(v: uint)) { self( |i| blk(i) ) }
23+
// issue-2185.rs:26 }
24+
// issue-2185.rs:20:0: 22:1 note: note conflicting implementation here
25+
// issue-2185.rs:20 impl<A> iterable<A> for @fn(&fn(A)) {
26+
// issue-2185.rs:21 fn iter(&self, blk: &fn(A)) { self(blk); }
27+
// issue-2185.rs:22 }
28+
//
29+
// … so it looks like it's just not possible to implement both the generic iterable<uint> and iterable<A> for the type iterable<uint>. Is it okay if I just remove this test?
30+
//
31+
// but Niko responded:
32+
// think it's fine to remove this test, just because it's old and cruft and not hard to reproduce. *However* it should eventually be possible to implement the same interface for the same type multiple times with different type parameters, it's just that our current trait implementation has accidental limitations.
33+
34+
// so I'm leaving it in.
35+
1336
// This test had to do with an outdated version of the iterable trait.
1437
// However, the condition it was testing seemed complex enough to
1538
// warrant still having a test, so I inlined the old definitions.
1639

1740
trait iterable<A> {
18-
fn iter(blk: &fn(A));
41+
fn iter(&self, blk: &fn(A));
1942
}
2043

2144
impl<A> iterable<A> for @fn(&fn(A)) {
22-
fn iter(blk: &fn(A)) { self(blk); }
45+
fn iter(&self, blk: &fn(A)) { self(blk); }
2346
}
2447

2548
impl iterable<uint> for @fn(&fn(uint)) {
26-
fn iter(blk: &fn(&&v: uint)) { self( |i| blk(i) ) }
49+
fn iter(&self, blk: &fn(v: uint)) { self( |i| blk(i) ) }
2750
}
2851

2952
fn filter<A,IA:iterable<A>>(self: IA, prd: @fn(A) -> bool, blk: &fn(A)) {

0 commit comments

Comments
 (0)