Fix ICE when a struct variant enum is imported from an external crate

Fixes the first case of #19340.
Fix ICE when a struct variant enum contains multiple fields

Fixes the second case of #19340.