Patrick Walton
|
5de8ed541a
|
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]
|
2014-07-25 15:58:01 -07:00 |
|