Skip to content
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

Infinite loop #9

Open
Goncalerta opened this issue Mar 26, 2019 · 1 comment
Open

Infinite loop #9

Goncalerta opened this issue Mar 26, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@Goncalerta
Copy link
Owner

Bringing @eddyb's comment on #4 to a new issue so as not to lose track of it.

There is a problem here, AFAICT something like this will repeat ad infinitum without warning (and end up allocating GBs of RAM until stopped by the OOM killer):

let x = quote!(_);
quote(#(#x)*);

If iter::repeat is involved, then its implementation of size_hint suggests this could be detected at runtime by asserting that combined_iterator.size_hint().0 < usize::MAX (but I'm not familiar enough with the implementation to be sure).

@Goncalerta Goncalerta added the bug Something isn't working label Mar 26, 2019
@dtolnay
Copy link

dtolnay commented Aug 15, 2019

Take a look at what quote does for this, I think we have a way to catch this at compile time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants