-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bounds on <F as AsyncFnOnce>::CallOnceFuture
make the compiler assume CallOnceFuture = ()
(?)
#134015
Labels
C-bug
Category: This is a bug.
F-async_closure
`#![feature(async_closure)]`
requires-nightly
This issue requires a nightly compiler in some way.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
Comments
rustbot
added
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
F-async_closure
`#![feature(async_closure)]`
requires-nightly
This issue requires a nightly compiler in some way.
labels
Dec 7, 2024
ill look into it, but ofc it doesn't block stabilizing async closures |
This has something to do with fallback and the way that the |
GuillaumeGomez
added a commit
to GuillaumeGomez/rust
that referenced
this issue
Dec 9, 2024
…n, r=jieyouxu Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction We shouldn't be using `AsyncFnOnce::CallOnceFuture` projection bounds to deduce anything about the return type of an async closure, **only** `AsyncFnOnce::Output`. This was accidental b/c all we were looking at was the def id of the trait, rather than the projection. This PR fixes that. This doesn't affect stable code, since `CallOnceFuture` bounds cannot be written on stable. Fixes rust-lang#134015
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Dec 9, 2024
…n, r=jieyouxu Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction We shouldn't be using `AsyncFnOnce::CallOnceFuture` projection bounds to deduce anything about the return type of an async closure, **only** `AsyncFnOnce::Output`. This was accidental b/c all we were looking at was the def id of the trait, rather than the projection. This PR fixes that. This doesn't affect stable code, since `CallOnceFuture` bounds cannot be written on stable. Fixes rust-lang#134015
jieyouxu
added a commit
to jieyouxu/rust
that referenced
this issue
Dec 9, 2024
…n, r=jieyouxu Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction We shouldn't be using `AsyncFnOnce::CallOnceFuture` projection bounds to deduce anything about the return type of an async closure, **only** `AsyncFnOnce::Output`. This was accidental b/c all we were looking at was the def id of the trait, rather than the projection. This PR fixes that. This doesn't affect stable code, since `CallOnceFuture` bounds cannot be written on stable. Fixes rust-lang#134015
fmease
added a commit
to fmease/rust
that referenced
this issue
Dec 9, 2024
…n, r=jieyouxu Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction We shouldn't be using `AsyncFnOnce::CallOnceFuture` projection bounds to deduce anything about the return type of an async closure, **only** `AsyncFnOnce::Output`. This was accidental b/c all we were looking at was the def id of the trait, rather than the projection. This PR fixes that. This doesn't affect stable code, since `CallOnceFuture` bounds cannot be written on stable. Fixes rust-lang#134015
fmease
added a commit
to fmease/rust
that referenced
this issue
Dec 10, 2024
…n, r=jieyouxu Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction We shouldn't be using `AsyncFnOnce::CallOnceFuture` projection bounds to deduce anything about the return type of an async closure, **only** `AsyncFnOnce::Output`. This was accidental b/c all we were looking at was the def id of the trait, rather than the projection. This PR fixes that. This doesn't affect stable code, since `CallOnceFuture` bounds cannot be written on stable. Fixes rust-lang#134015
saethlin
added
T-types
Relevant to the types team, which will review and decide on the PR/issue.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Dec 10, 2024
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Dec 10, 2024
Rollup merge of rust-lang#134017 - compiler-errors:call-once-deduction, r=jieyouxu Don't use `AsyncFnOnce::CallOnceFuture` bounds for signature deduction We shouldn't be using `AsyncFnOnce::CallOnceFuture` projection bounds to deduce anything about the return type of an async closure, **only** `AsyncFnOnce::Output`. This was accidental b/c all we were looking at was the def id of the trait, rather than the projection. This PR fixes that. This doesn't affect stable code, since `CallOnceFuture` bounds cannot be written on stable. Fixes rust-lang#134015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
F-async_closure
`#![feature(async_closure)]`
requires-nightly
This issue requires a nightly compiler in some way.
T-types
Relevant to the types team, which will review and decide on the PR/issue.
I tried this code:
playground link
I expected to see this happen: This should compile successfully;
AsyncFnOnce::CallOnceFuture
is guaranteed to implementAnything
(since there is a blanket impl).Instead, this happened: The bound appears to cause the compiler to think that
F::CallOnceFuture = ()
, see error message:It compiles with no error if:
bar
is never called<F as AsyncFnOnce<()>>::CallOnceFuture:
instead of: Anything
It doesn't compile if we have any non-empty bound, e.g.
<F as AsyncFnOnce<()>>::CallOnceFuture: Future
. (The original issue was someone on discord trying to have a: 'static
bound, but I used: Anything
in the issue here since it should always be satisfied, and any bound appears to cause the issue).Meta
rustc --version --verbose
:(no ICE, so no backtrace)
@rustbot label +F-async_closure +requires-nightly
The text was updated successfully, but these errors were encountered: