Fix type checking of struct fields in patterns of type ty_err

Fixes #16338.
Fixed #16401.
auto merge of #16554 : jakub-/rust/struct-pat-fields-ty-err, r=pcwalton

Fixes #16338.
Fixed #16401.