-
Notifications
You must be signed in to change notification settings - Fork 13k
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
overflow during drop-check on a recursive type #44933
Comments
How is it misleading? |
I wouldn't call it misleading either, but "overflow while adding drop-check rules" certainly isn't as clear and to-the-point as " |
(I am debating about whether the I-hang label applies here. In my head, stack overflow errors are usually just the result of hangs being caught via very crude means...) |
Interestingly, the overflow here doesn't trigger an ICE? |
Diagnostics triage: P-low, as it's fairly clear what's going on, just not a great diagnostic message |
Triage: no change. |
Current error:
|
@Dylan-DPC surprised that we don't trim the type name in the |
I've run into a similar error with a type that looks to me to be completely reasonable & only fails to compile in some cases. Perhaps the triage for this issue can be revisited. enum Tree<T: Scopable> {
Group(Vec<Tree<T>>),
Subtree(Box<Tree<T::SubType>>),
Leaf(T),
}
trait Scopable: Sized {
type SubType: Scopable;
}
impl<T: Scopable> Tree<T> {
fn foo(self) -> Self { // error[E0320]: overflow while adding drop-check rules for Tree<T>
self
}
} playground + modifications that trigger an ICE I was hoping to implement a builder API on I did notice that using references in |
I get a pretty strange error when trying to compile this: (playground link)
output:
If the type isn't used, the program compiles fine. Don't know if the type is actually representable or not, the error is misleading.
The text was updated successfully, but these errors were encountered: