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
'assertion failed: current_depth > ty::DebruijnIndex::INNERMOST' when using generators #51353
Comments
This is probably the same bug as #48969 which I couldn't find before because I was only looking for DebruijnIndex. Anyway this repro case is simpler (doesn't depend on the futures crate). |
The example can be reduced to: #![feature(generators)]
struct Foo<T: Fn()>(T, T::Output);
fn ice<'a>() -> impl Send + 'a {
Foo(|| {}, ())
}
fn main() {
|| {
let _f = ice();
yield;
};
} The |
In our case (for rust-lang/gll#47), we were down to one source of this ICE, and the fix was: - .map(|children| children.iter().map(|&i| P::from_usize(i))),
+ .map(|children| children.iter().cloned().map(|i| P::from_usize(i))), That is, the problematic closure was changed from taking a |
I am playing around with future streams with tokio-async-await shim and I'm seeing a similar error. Maybe this example is useful as well?
results in
if I comment out the inner async work code:
then I don't get the ICE. should I be cloning something to workaround this bug? |
Stumbled upon this also: #![feature(await_macro, async_await, futures_api, pin,)]
#[macro_use]
extern crate tokio;
use hyper::Uri;
use hyper::Client;
use hyper::client::HttpConnector;
use hyper::rt::Stream as HStream;
use futures::sync::mpsc::*;
use futures::Future;
use tokio::prelude::{Sink, Stream};
use std::borrow::ToOwned;
async fn read_url<'a>(
url: Uri,
sender: UnboundedSender<Vec<u8>>,
client: &'a Client<HttpConnector, hyper::Body>,
) {
await!(
client
.get(url)
.and_then(|content| content.into_body().for_each(|item| {
sender.start_send(vec![]);
Ok(())
}))
);
}
fn main() {
let (sender, recv) = unbounded::<Vec<u8>>();
let url_sender = sender.clone();
let client = Client::new();
tokio::run_async(read_url(
"http://ikariam.org".parse().unwrap(),
url_sender,
&client,
));
} |
The original code (playground) doesn't ICE anymore. Neither does eddy's minimized repro (playground). The last snippet involves |
Nice! Closing-- if anyone repros, I can reopen. cc @withoutboats @nikomatsakis |
I've got an ICE when I tried to use
async/await
support fromfutures-0.2
together with impl traits. I've tried to minimized the code, now there are no external dependencies:Running
RUST_BACKTRACE=1 rustc ice.rs
on the latestrustc 1.28.0-nightly (29f48ccf3 2018-06-03)
gives the following output:The text was updated successfully, but these errors were encountered: