rust-lang/rust — pull request #15991 by pcwalton (2014-07-25 22:58:23+00:00)
Title: librustc: Resolve regions and report errors in trait/impl method

matching.

This breaks code like:

struct Foo<'a,'b> {
x: &'a int,
y: &'b int,
}

trait Tr {
fn foo(x: Self) {}
}

impl<'a,'b> Tr for Foo<'a,'b> {
fn foo(x: Foo<'b,'a>) {} // <-- bad
}

Change this code to not contain a lifetime mismatch error. For example:

struct Foo<'a,'b> {
x: &'a int,
y: &'b int,
}

trait Tr {
fn foo(x: Self) {}
}

impl<'a,'b> Tr for Foo<'a,'b> {
fn foo(x: Foo<'a,'b>) {} // OK
}

Closes #15517.

[breaking-change]

r? @alexcrichton