-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-type-systemArea: Type systemArea: Type systemT-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.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.
Description
This enum is in theory finitely sized, though it's being detected as infinitely sized.
#![feature(never_type)]
enum Enum<T> {
A,
B(Enum<!>, T)
}
error[E0072]: recursive type `Enum` has infinite size
--> src/lib.rs:2:1
|
2 | enum Enum<T> {
| ^^^^^^^^^^^^ recursive type has infinite size
3 | A,
4 | B(Enum<!>, T)
| ------- recursive without indirection
|
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Enum` representable
Metadata
Metadata
Assignees
Labels
A-type-systemArea: Type systemArea: Type systemT-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.T-typesRelevant to the types team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.