Closed Diggsey closed 4 years ago
It also happens when renaming the function to main
, so visiblity is not the issue. Instead, mentioning the invalid type in any place where it needs to be code-gen'd will cause the error. I believe monomorphization errors due to conditionally-infinite types are expected though.
Yeah, private unused functions (except for main
of a bin crate) are not codegen'd, so you won't get any monomorphization-time errors.
Closing as expected behavior.
I don't know if this is necessarily a bug, but it's certainly surprising:
Playground link
Uncommenting the
pub
keyword will cause it to fail to compile with the error: