Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]
- Loading branch information
5de8ed5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at pcwalton@5de8ed5
5de8ed5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging pcwalton/rust/resolve-regions-in-trait-matching = 5de8ed5 into auto
5de8ed5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pcwalton/rust/resolve-regions-in-trait-matching = 5de8ed5 merged ok, testing candidate = ee21b00
5de8ed5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/530
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/530
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/529
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/530
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/530
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/531
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/530
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/536
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/531
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/530
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/533
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/531
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/531
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/532
5de8ed5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = ee21b00