Fix an ICE for struct patterns that don't refer to a variant or a struct

Fixes #17405.
auto merge of #17414 : jakub-/rust/issue-17405, r=alexcrichton

Fixes #17405.