mirror of https://github.com/rust-lang/rust.git
Rollup merge of #126926 - Zalathar:candidate-per-arm, r=Nadrieril
Tweak a confusing comment in `create_match_candidates` This comment was accurate at the time it was written, but various later changes reshuffled things in ways that caused the existing comment to become confusing. I've therefore tried to clarify that *these* candidates are 1:1 with match arms, while also warning that that isn't the case in general.
This commit is contained in:
commit
6077c0ed9d
|
@ -358,8 +358,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
|
|||
where
|
||||
'a: 'pat,
|
||||
{
|
||||
// Assemble a list of candidates: there is one candidate per pattern,
|
||||
// which means there may be more than one candidate *per arm*.
|
||||
// Assemble the initial list of candidates. These top-level candidates
|
||||
// are 1:1 with the original match arms, but other parts of match
|
||||
// lowering also introduce subcandidates (for subpatterns), and will
|
||||
// also flatten candidates in some cases. So in general a list of
|
||||
// candidates does _not_ necessarily correspond to a list of arms.
|
||||
arms.iter()
|
||||
.copied()
|
||||
.map(|arm| {
|
||||
|
|
Loading…
Reference in New Issue