Will there be a lint about unused capture names in match?

⚓ Rust    📅 2026-01-18    👤 surdeus    👁️ 1      

surdeus

From this topic (that gradually got wild) it seems useful to introduce a lint about unused capture names. (Code in playground)

Upon seeing an unused capture name, search for similar enum variants, and give a "maybe you meant to match against enum variant SomeVariant instead of capturing?" + "If the name is not needed, consider replacing it with the wildcard _ or prefixing it with _"

I'm just asking, I don't know anything about the compiler source code, so I don't think I'll be the one implementing this. So I'm actually hoping someone else will do this.

1 post - 1 participant

Read full topic

🏷️ Rust_feed