Closed
Description
While working on #41327, I encountered this bug. The following program is accepted but should not be:
trait Foo {
fn foo<'a, T: Iterator>(&self) where T: 'a;
}
impl Foo for () {
fn foo<'a, T: Iterator>(&self) where T::Item: 'a {
}
}
fn main() { }
The fix is fairly straightforward: compare_method
needs to use the impl-method id for the "body_id" field, not the id of the impl method's body. This is because it calls regionck_item
which assumes it will do so. I'll have a PR up shortly.