diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2024-02-19 21:34:55 +0100 |
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2024-02-19 21:34:55 +0100 |
| commit | 328c77683eda8356352dc619734dc5c49b2e2b84 (patch) | |
| tree | 76af41c2f2b419c89b43326600713f57ceac1f47 /compiler | |
| parent | 0ca1d220d279fd04aaf829ade6f9f111878dd9f4 (diff) | |
| download | rust-328c77683eda8356352dc619734dc5c49b2e2b84.tar.gz rust-328c77683eda8356352dc619734dc5c49b2e2b84.zip | |
Update comments
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_mir_build/src/build/matches/simplify.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/compiler/rustc_mir_build/src/build/matches/simplify.rs b/compiler/rustc_mir_build/src/build/matches/simplify.rs index 7322e578f25..83922dce327 100644 --- a/compiler/rustc_mir_build/src/build/matches/simplify.rs +++ b/compiler/rustc_mir_build/src/build/matches/simplify.rs @@ -95,9 +95,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { debug!(simplified = ?match_pairs, "simplify_match_pairs"); } - /// Given `candidate` that has a single or-pattern for its match-pairs, - /// creates a fresh candidate for each of its input subpatterns passed via - /// `pats`. + /// Create a new candidate for each pattern in `pats`, and recursively simplify tje + /// single-or-pattern case. pub(super) fn create_or_subcandidates<'pat>( &mut self, place: &PlaceBuilder<'tcx>, @@ -119,11 +118,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { .collect() } - /// Tries to simplify `match_pair`, returning `Ok(())` if - /// successful. If successful, new match pairs and bindings will - /// have been pushed into the candidate. If no simplification is - /// possible, `Err` is returned and no changes are made to - /// candidate. + /// Tries to simplify `match_pair`, returning `Ok(())` if successful. If successful, new match + /// pairs and bindings will have been pushed into the respective `Vec`s. If no simplification is + /// possible, `Err` is returned. fn simplify_match_pair<'pat>( &mut self, mut match_pair: MatchPair<'pat, 'tcx>, |
