-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Seemingly infinite loop in translation item collection #34416
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
Comments
Ok, managed to reduce it to this: pub trait Future: 'static {
type Item;
type Error;
fn boxed(self) -> Box<Future<Item=Self::Item, Error=Self::Error>>
where Self: Sized
{
Box::new(self)
}
fn map(self) -> Map<Self>
where Self: Sized,
{
loop {}
}
fn forget(self) where Self: Sized {
self.map().boxed();
}
}
// =============================================================================
pub struct Map<A> {
_future: A,
}
impl<A> Future for Map<A>
where A: Future,
{
type Item = ();
type Error = A::Error;
}
// =============================================================================
pub struct Promise;
impl Future for Promise {
type Item = ();
type Error = ();
}
// =============================================================================
fn foo() -> Promise {
loop {}
}
fn main() {
foo().boxed();
} If
This is in theory just a reduced down version of the original crate, so presumably it was just going to take a very long time to say that before? Haven't quite figured out how this program is causing the recursion limit to get hit... |
@eddyb managed to reduce further: pub trait Future: 'static {
fn forget(self) where Self: Sized {
Box::new(Map(self)) as Box<Future>;
}
}
pub struct Map<A>(A);
impl<A: Future> Future for Map<A> {}
pub struct Promise;
impl Future for Promise {}
fn main() {
Promise.forget();
} |
bors
added a commit
that referenced
this issue
Jun 27, 2016
Don't translate vtable methods with Self: Sized bounds. Fixes #34416.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When compiling this file with
cargo build --test eventual
in that repository (at that revision), the compiler seemingly hangs. The stack trace after awhile is:And the logs towards the end look like this: https://gist.github.com/alexcrichton/08e46aaef1c170e74752ce1d75287a02
cc @michaelwoerister, looks to be hanging during translation item collections
The text was updated successfully, but these errors were encountered: