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
Local
struct-def::DefTy,structfrom some other crate -def::DefStructLocal
structconstructor -def::DefStruct,structconstructor from some other crate -def::DefFnIs there any rationale for these discrepancies?
I made some quick experiment and fixed the first discrepancy by using
DefStructin 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 */)intoDefEnum(DefId)andDefTypeAlias(DefId). I have and impression that type aliases may be not always treated correctly, or at least consciously.cc @arielb1 @eddyb