-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Open
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitC-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityS-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
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<'_>,)>`
Expurple
Metadata
Metadata
Assignees
Labels
A-async-awaitArea: Async & AwaitArea: Async & AwaitC-bugCategory: This is a bug.Category: This is a bug.P-highHigh priorityHigh priorityS-has-bisectionStatus: A bisection has been found for this issueStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.