diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-06-24 12:50:04 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-06-25 12:16:49 +1000 |
| commit | 8016940ef41b1245aecf9eb19c02b85f45dcd133 (patch) | |
| tree | 06d94b89a7b4216579e31cdab135fb1cf7a71d58 | |
| parent | 6b0f4b5ec3aa707ecaa78230722117324a4ce23c (diff) | |
| download | rust-8016940ef41b1245aecf9eb19c02b85f45dcd133.tar.gz rust-8016940ef41b1245aecf9eb19c02b85f45dcd133.zip | |
Tweak a confusing comment in `create_match_candidates`
| -rw-r--r-- | compiler/rustc_mir_build/src/build/matches/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_mir_build/src/build/matches/mod.rs b/compiler/rustc_mir_build/src/build/matches/mod.rs index 68244136d1a..350b00db7fd 100644 --- a/compiler/rustc_mir_build/src/build/matches/mod.rs +++ b/compiler/rustc_mir_build/src/build/matches/mod.rs @@ -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| { |
