Implement "unused pattern bindings" p2022 - parsing (#6460)

This implements proposal #2022, with changes from #3763 and leads
answers on #6448

Detection of unusedness is happening in
~~`toolchain/check/dataflow_analysis.cpp`~~ next PR. See
[here](https://github.com/burakemir/carbon-lang/tree/unused_pattern_bindings_p2022_impl_part2)
for preview.

~~All test cases with unused bindings were updated in order to avoid
polluting test output.~~

---------

Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
Burak Emir
2025-12-17 15:40:20 +00:00
committed by GitHub
co-authored by Dana Jansens
parent ad7ea755b0
commit fec6ce2f9f
16 changed files with 851 additions and 66 deletions
@@ -456,4 +456,8 @@ auto HandleParseNode(Context& context, Parse::TemplateBindingNameId node_id)
return true;
}
auto HandleParseNode(Context& context, Parse::UnusedPatternId node_id) -> bool {
return context.TODO(node_id, "unused");
}
} // namespace Carbon::Check