-
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
ICE: Cannot convert erased region to a region VID #131050
Comments
This issue seems interesting! I would love to contribute or discuss further. 👍 |
A lot of types your code uses are not defined or imported. Please add their definitions so we can reproduce your issue, at least for |
Hey, I just ran into this again, here's the code and the crash at the time it happened. |
Reduced: struct Exact<P>(P);
impl Filter for Exact<&'static ()> {}
fn path() -> Exact<&'static ()> {
loop {}
}
fn query_as<D>() {}
async fn create_user() {
query_as();
}
async fn post_user_filter() -> impl Filter {
path().and_then(|| async { create_user().await })
}
async fn get_app() -> impl Filter {
Or(post_user_filter().await)
}
trait Filter {
fn and_then<F>(self, _fun: F) -> AndThen<Self, F> {
loop {}
}
}
struct Or<U>(U);
impl<U> Filter for Or<U> where U: Send {}
struct AndThen<T, F>(T, F);
impl<T, F, R> Filter for AndThen<T, F>
where
F: Fn() -> R + Send,
F::Output: Send,
{
} Has quite a few similarities to #119095. @rustbot label: -E-needs-mcve +S-has-mcve |
More reduction: fn query_as<D>() {}
async fn create_user() {
query_as();
}
async fn post_user_filter() -> impl Filter {
AndThen(&(), || async { create_user().await })
}
async fn get_app() -> impl Send {
post_user_filter().await
}
trait Filter {}
struct AndThen<T, F>(T, F);
impl<T, F, R> Filter for AndThen<T, F>
where
F: Fn() -> R,
R: Send,
{
} |
Ideally this issue is minimized further, since this is really impossible to debug given its current tests: @rustbot label: -S-bug-has-test -S-has-mcve |
Here is my next attempt at reducing it further and naming things more usefully: use std::future::Future;
fn invalid_future() -> impl Future {}
fn create_complex_future() -> impl Future<Output = impl ReturnsSend> {
async { &|| async { invalid_future().await } }
}
fn coerce_impl_trait() -> impl Future<Output = impl Send> {
create_complex_future()
}
trait ReturnsSend {}
impl<F, R> ReturnsSend for F
where
F: Fn() -> R,
R: Send,
{
} |
@rustbot label: +S-has-mcve |
add and update some crashtests Adds tests for rust-lang#126268 and rust-lang#132126, updates it for rust-lang#131050.
add and update some crashtests Adds tests for rust-lang#126268 and rust-lang#132126, updates it for rust-lang#131050.
add and update some crashtests Adds tests for rust-lang#126268 and rust-lang#132126, updates it for rust-lang#131050.
Rollup merge of rust-lang#132543 - cyrgani:master, r=compiler-errors add and update some crashtests Adds tests for rust-lang#126268 and rust-lang#132126, updates it for rust-lang#131050.
@rustbot label: +S-bug-has-test |
Code
mcve:
original
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: