Fix the unused struct field lint for struct variants

Fixes #14837.
Does this test pass? The test harness expects an executable file. Additionally, could you `deny(warnings)`?