rustc_metadata: Add struct and variant constructors to module children at encoding time instead of decoding time. Continuation of https://github.com/rust-lang/rust/pull/95899. The last time it caused some ICEs from generator use, but not everything seems ok.