-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
async/await assertion failed: unbounded recursion #53249
Comments
(edit: updated to nightly from 2018-08-14, as the error message changed) Another simpler reproducer: #![feature(async_await, await_macro, futures_api)]
use futures::prelude::*;
async fn __receive<WantFn, Fut>(want: WantFn) -> ()
where
Fut: Future<Output = ()>,
WantFn: Fn(&Box<Send + 'static>) -> Fut,
{
await!(futures::future::lazy(|_| ()));
}
pub fn basic_spawn_receive() {
async { await!(__receive(|_| async { () })) };
} Cargo.toml: cargo-features = ["edition"]
[package]
name = "erlust"
edition = "2018"
version = "0.1.0"
[dependencies.futures-preview]
git = "https://github.com/rust-lang-nursery/futures-rs"
rev = "c02ec75a155485ff4b50f21205b6a462851b08e1" Backtrace: error[E0275]: overflow evaluating the requirement `[closure@erlust/src/lib.rs:10:34: 10:40]: std::marker::Freeze`
|
= help: consider adding a `#![recursion_limit="128"]` attribute to your crate
= note: required because of the requirements on the impl of `std::marker::Freeze` for `[closure@erlust/src/lib.rs:10:34: 10:40]`
[…]
= note: required because of the requirements on the impl of `std::marker::Freeze` for `[closure@erlust/src/lib.rs:10:34: 10:40]`
= note: required because it appears within the type `std::option::Option<[closure@erlust/src/lib.rs:10:34: 10:40]>`
= note: required because it appears within the type `futures_util::future::lazy::Lazy<[closure@erlust/src/lib.rs:10:34: 10:40]>`
= note: required because it appears within the type `{futures_util::future::lazy::Lazy<[closure@erlust/src/lib.rs:10:34: 10:40]>, ()}`
= note: required because it appears within the type `[static generator@erlust/src/lib.rs:9:1: 11:2 {futures_util::future::lazy::Lazy<[closure@erlust/src/lib.rs:10:34: 10:40]>, ()}]`
= note: required because it appears within the type `std::future::GenFuture<[static generator@erlust/src/lib.rs:9:1: 11:2 {futures_util::future::lazy::Lazy<[closure@erlust/src/lib.rs:10:34: 10:40]>, ()}]>`
= note: required because it appears within the type `impl core::future::future::Future`
= note: required because it appears within the type `impl core::future::future::Future`
= note: required because it appears within the type `for<'r> {impl core::future::future::Future, ()}`
= note: required because it appears within the type `[static generator@erlust/src/lib.rs:14:11: 14:50 for<'r> {impl core::future::future::Future, ()}]`
= note: required because it appears within the type `std::future::GenFuture<[static generator@erlust/src/lib.rs:14:11: 14:50 for<'r> {impl core::future::future::Future, ()}]>`
= note: required because it appears within the type `impl core::future::future::Future`
error: aborting due to previous error The backtrace looks quite different though, so I guess a fix for this one should also be checked to fix the first example. |
Latest nightly appears to have fixed the ICE, however it's still making unbounded recursion :) |
Async-await traige: Marking as blocking pending investigation to understand what is happening. |
Alright, so here's what I've worked out so far: I was able to reproduce the ICE from the original code snippet using the compiler version and library versions from when the issue was reported ( After that, I upgraded to |
Sounds good to me, thanks! |
Add regression test for rust-lang#53249. Fixes rust-lang#53249. r? @cramertj
Rollup of 6 pull requests Successful merges: - #59560 (MIR generation cleanup) - #59697 (tweak unresolved label suggestion) - #60038 (Add codegen test for PGO instrumentation.) - #60160 (Fix #58270, fix off-by-one error in error diagnostics.) - #60185 (Reexport IntErrorKind in std) - #60243 (Add regression test for #53249.) Failed merges: r? @ghost
(edit: much simpler reproducer at second post)
(see edit history for the initial issue text)
Potential duplicate of #49537 and #51624
cc #50547
The text was updated successfully, but these errors were encountered: