This bisects to #143545 (nightly-2025-07-19 and stable 1.90.0). Previous versions compiled this successfully.
pub fn a() -> impl Future + Send {
async {
let queries = core::iter::empty().map(Thing::f);
b(queries).await;
}
}
async fn b(queries: impl IntoIterator) {
c(queries).await;
}
fn c<'a, I>(_queries: I) -> impl Future
where
I: IntoIterator,
I::IntoIter: 'a,
{
async {}
}
pub struct Thing<'a>(pub &'a ());
impl Thing<'_> {
fn f(_: &Self) {}
}
fn main() {}
error: implementation of `FnOnce` is not general enough
--> src/main.rs:2:5
|
2 | / async {
3 | | let queries = core::iter::empty().map(Thing::f);
4 | | b(queries).await;
5 | | }
| |_____^ implementation of `FnOnce` is not general enough
|
= note: `for<'a> fn(&'a Thing<'0>) {Thing::<'0>::f}` must implement `FnOnce<(&Thing<'1>,)>`, for any two lifetimes `'0` and `'1`...
= note: ...but it actually implements `FnOnce<(&Thing<'_>,)>`
This bisects to #143545 (nightly-2025-07-19 and stable 1.90.0). Previous versions compiled this successfully.