-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Infinite memory use on invalid program #18418
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
I think this reduced example displays the problem more clearly: the compiler is trying to instantiate struct Pair<A> {
a: A,
}
trait Printable {
fn print(&self) {}
}
impl<A: Printable> Printable for Pair<A> {}
// inlining/removing these stops the error
fn pair<A>(a: A) -> Pair<A> {
Pair{ a : a }
}
fn print<A: Printable>(t: Pair<A>) {}
fn main() {
print(pair(1));
}
This happens even with a suffix on the |
This looks like it may be a dupe of #18400. |
This code properly gives an error on 0.12. |
So, I don't see infinite memory use. I do see errors about overflow, which seems appropriate -- there is only one impl, and the compiler is trying to give the benefit of the doubt here. |
I agree this is a dup of #18400 |
…sable feat: Split `macro-error` diagnostic so users can ignore only parts of it
The text was updated successfully, but these errors were encountered: