about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-01-11 00:04:10 +0000
committerbors <bors@rust-lang.org>2024-01-11 00:04:10 +0000
commit0a8923361ec2a37fa341292c029ef7c6d0405d4b (patch)
treeec79993365940be059ffcbd2cb7dc39b5773846b /compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp
parenta2d9d73e608f1b24eba840c4fd2d68dbe3b65e01 (diff)
parent4a1889e3fd7dd3035c4892856be78e39977bbcc4 (diff)
downloadrust-0a8923361ec2a37fa341292c029ef7c6d0405d4b.tar.gz
rust-0a8923361ec2a37fa341292c029ef7c6d0405d4b.zip
Auto merge of #119688 - Nadrieril:dont-alloc-custom-wildcards, r=compiler-errors
Exhaustiveness: use an `Option` instead of allocating fictitious patterns

In the process of exhaustiveness checking, `Matrix` stores a 2D array of patterns. Those are subpatterns of the patterns we were provided as input, _except_ sometimes we allocate some extra wildcard patterns to fill a hole during specialization.

Morally though, we could store `Option<&'p DeconstructedPat>` in the matrix, where `None` signifies a wildcard. That way we'd only have "real" patterns in the matrix and we wouldn't need the arena to allocate these wildcards. This is what this PR does.

This is part of me splitting up https://github.com/rust-lang/rust/pull/119581 for ease of review.

r? `@compiler-errors`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/ArchiveWrapper.cpp')
0 files changed, 0 insertions, 0 deletions