-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I get a pretty strange error when trying to compile this: (playground link)
enum Stuff<T> {
Value(T),
Nested(Box<Stuff<Stuff<T>>>),
}
fn main() {
let a = Stuff::Value(1);
}
output:
error[E0320]: overflow while adding drop-check rules for Stuff<i32>
--> src/main.rs:7:9
|
7 | let a = Stuff::Value(1);
| ^
|
= note: overflowed on Stuff<Stuff<Stuff<Stuff<Stuff<Stuff< ...
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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-hardCall for participation: Hard difficulty. Experience needed to fix: A lot.Call for participation: Hard difficulty. Experience needed to fix: A lot.P-lowLow priorityLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.