Fix an ICE with unsized structs and optimised enums

close #18353 

r?
Yeah, I deliberately left it as a follow up, because I know we make the same assumption all over the place, so fixing isn't super-urgent.