5 // Regression test for #86753. The `type_implements_trait` query (since moved to a method)
6 // was encountering an ICE during incremental testing when hashing its arguments.
7 #![warn(rust_2021_compatibility)]
9 use std::future::Future;
11 use std::task::{Poll, Context};
14 struct RunUntil<'a, F> {
15 _local_set: &'a LocalSet,
18 impl<'a, F> RunUntil<'a, F> {
19 fn project<'pin>(self: Pin<&'pin mut Self>) -> Projection<'pin, 'a, F> {
24 struct Projection<'pin, 'a, F>
26 RunUntil<'a, F>: 'pin,
28 pub local_set: &'pin mut &'a LocalSet,
29 pub future: Pin<&'pin mut F>,
33 fn with<T>(&self, _f: impl FnOnce() -> T) -> T {
37 impl<T: Future> Future for RunUntil<'_, T> {
38 type Output = T::Output;
39 fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
40 let me = self.project();
41 me.local_set.with(|| {