Skip to content

Conversation

@burakemir
Copy link
Contributor

@burakemir burakemir commented Dec 9, 2025

This updates lower/testdata to use _ instead of proper names, in order to avoid the "unused binding" warnings from #2022 which are being implemented. These changes do not depend on the implementation which should make everything easier to review.

See #6460 with part 1 of the implementation. It was split upon request in order to make reviewing easier, the original state of the PR was updating hundreds of test cases.
The PR has thus been split, part 2 including test cases changes can be viewed at https://github.com/burakemir/carbon-lang/tree/unused_pattern_bindings_p2022_impl_part2 ... many tests need to be updated, so it seems best to get those tests out of the way that are not interesting.

These are not all tests in lower/testdata - a few of them are interesting in the sense that they cannot use '_' because it leads to failed redeclaration check. This is exactly the scenario described in #3763 which requires the 'unused' marker. Those are left untouched here but are updated in https://github.com/burakemir/carbon-lang/tree/unused_pattern_bindings_p2022_impl_part2

@burakemir burakemir requested a review from a team as a code owner December 9, 2025 10:57
@burakemir burakemir requested review from zygoloid and removed request for a team December 9, 2025 10:57
Copy link
Contributor

@danakj danakj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good, just a few suggestions to keep the srtucture of tests/reduce additional names

@burakemir burakemir requested a review from danakj December 9, 2025 15:06
@burakemir burakemir requested a review from danakj December 9, 2025 17:31
Copy link
Contributor

@danakj danakj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM

fn M() -> i32 {
var n: i32 = 0;
var m: i32;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restoring this newline should reduce the amount of changes in the semir

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@burakemir burakemir force-pushed the unused_pattern_update_lower branch from 48c0b17 to 3744cb3 Compare December 17, 2025 15:15
@burakemir
Copy link
Contributor Author

As discussed, pulled changes from trunk (with --rebase).
Please merge.

@danakj danakj enabled auto-merge December 17, 2025 15:32
@danakj danakj added this pull request to the merge queue Dec 17, 2025
Merged via the queue into carbon-language:trunk with commit 992d435 Dec 17, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants