Skip to content

decide if we should do backtracking in impl resolution #4148

Closed
@brson

Description

@brson

This is the next thing blocking removal of iter-trait:

trait MyIter<A> {
    fn myeach(&self, blk: fn(v: &A) -> bool);
}
trait ExtendedIter<A> {
    fn myeachi(&self, blk: fn(uint, v: &A) -> bool);
}

impl <A, IA: MyIter<A>> IA: ExtendedIter<A> {
    fn myeachi(&self, blk: fn(uint, v: &A) -> bool) { }
}

impl<A> &[A]: MyIter<A> {
    fn myeach(&self, blk: fn(v: &A) -> bool) { }
}

fn main() {
    let v = ~[0];
    for v.myeachi |_i, _j| { }
}
/home/brian/dev/rust/src/test/run-pass/test.rs:18:8: 18:17 error: failed to find an implementation of trait @MyIter<<V3>> for <V4>
/home/brian/dev/rust/src/test/run-pass/test.rs:18     for v.myeachi |_i, _j| { }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions