-
Notifications
You must be signed in to change notification settings - Fork 13.4k
ICE: cannot convert RePlaceholder
to a region vid
#76168
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
A project maintainer might want to add the |
Reduced, no nightly features: trait Trait<Input> {
type Output;
}
async fn walk<F>(filter: F)
where
for<'a> F: Trait<&'a u32> + 'a,
for<'a> <F as Trait<&'a u32>>::Output: 'a,
{
} Output on stable:
ICEs on beta and nightly. |
Adding a
Backtrace
Which looks like #71546. It still gives the original ICE on beta and stable, and it looks like #71546's code now produces the original ICE of this issue on beta and stable. Does that make this a duplicate? |
Another repro case relying on tokio: #![feature(unboxed_closures)]
async fn wrapper<F>(f: F)
where for<'a> F: FnOnce<(&'a mut i32,)>,
for<'a> <F as FnOnce<(&'a mut i32,)>>::Output: Future<Output=()> + 'a
{
let mut i = 41;
f(&mut i).await;
}
async fn add_one(i: &mut i32) {
*i = *i + 1;
} |
@rustbot modify labels: -F-unboxed_closures -requires-nightly per #76168 (comment) |
This is now reproducing on stable. This feels like more of a "guts of the borrow checker" kind of issue than async/await-specific, so I'm tagging with |
Assigning |
Another repro from #81273: #![feature(unboxed_closures)]
use std::future::Future;
use futures::future::LocalBoxFuture;
pub trait GenericTask<C>: 'static {
fn execute<'a>(&'a self, ctx: &'a C) -> LocalBoxFuture<'a, ()>;
}
impl<C: 'static, T: 'static> GenericTask<C> for T
where
T: for<'a> Fn<(&'a C, )>,
for<'a> <T as FnOnce<(&'a C, )>>::Output: Future<Output = ()> + 'a,
{
fn execute<'a>(&'a self, ctx: &'a C) -> LocalBoxFuture<'a, ()> {
let future = (self)(ctx);
Box::pin(async move {
future.await;
})
}
} |
RePlaceholder
to a region vid
Hello,
I am getting an ICE while "playing" with
unboxed_closure
Code
MCVE can be found here: #76168 (comment)
Original
Meta
rustc --version --verbose
: (from Playground)Error output
Backtrace
The text was updated successfully, but these errors were encountered: