1
Fork 0

Update comments

This commit is contained in:
Nadrieril 2024-02-19 21:34:55 +01:00
parent 0ca1d220d2
commit 328c77683e

View file

@ -95,9 +95,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
debug!(simplified = ?match_pairs, "simplify_match_pairs"); debug!(simplified = ?match_pairs, "simplify_match_pairs");
} }
/// Given `candidate` that has a single or-pattern for its match-pairs, /// Create a new candidate for each pattern in `pats`, and recursively simplify tje
/// creates a fresh candidate for each of its input subpatterns passed via /// single-or-pattern case.
/// `pats`.
pub(super) fn create_or_subcandidates<'pat>( pub(super) fn create_or_subcandidates<'pat>(
&mut self, &mut self,
place: &PlaceBuilder<'tcx>, place: &PlaceBuilder<'tcx>,
@ -119,11 +118,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
.collect() .collect()
} }
/// Tries to simplify `match_pair`, returning `Ok(())` if /// Tries to simplify `match_pair`, returning `Ok(())` if successful. If successful, new match
/// successful. If successful, new match pairs and bindings will /// pairs and bindings will have been pushed into the respective `Vec`s. If no simplification is
/// have been pushed into the candidate. If no simplification is /// possible, `Err` is returned.
/// possible, `Err` is returned and no changes are made to
/// candidate.
fn simplify_match_pair<'pat>( fn simplify_match_pair<'pat>(
&mut self, &mut self,
mut match_pair: MatchPair<'pat, 'tcx>, mut match_pair: MatchPair<'pat, 'tcx>,