FnDef lifetime arguments are ignored by outlives constraints. They are not ignored by member constraints. This is inconsistent.
fn cool<'a: 'a>() {}
fn closure_outlives<'a>() -> impl Sized + use<'a> + 'static {
|| ()
}
fn fn_def_outlives<'a>() -> impl Sized + use<'a> + 'static {
cool::<'a>
}
fn closure_member_constraints<'a>() -> impl Sized + use<> {
|| ()
}
fn fn_def_member_constraints<'a>() -> impl Sized + use<> {
cool::<'a> //~ ERROR hidden type for `impl Sized` captures lifetime that does not appear in bounds
}
We shouldn't try to make this consistent before resolving #153140 (comment)
FnDeflifetime arguments are ignored by outlives constraints. They are not ignored by member constraints. This is inconsistent.We shouldn't try to make this consistent before resolving #153140 (comment)