Local struct - def::DefTy, struct from some other crate - def::DefStruct
Local struct constructor - def::DefStruct, struct constructor from some other crate - def::DefFn
Is there any rationale for these discrepancies?
I made some quick experiment and fixed the first discrepancy by using DefStruct in both cases. It resulted in better error diagnostics and one discovered bug. Seems like a win.
I'd also like to split DefTy(DefId, bool /* is_enum */) into DefEnum(DefId) and DefTypeAlias(DefId). I have and impression that type aliases may be not always treated correctly, or at least consciously.
cc @arielb1 @eddyb