Fix the unused struct field lint for struct variants

Fixes #14837.