File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
compiler/rustc_mir_build/src/build/matches Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -949,12 +949,15 @@ struct Candidate<'pat, 'tcx> {
949949 has_guard : bool ,
950950
951951 /// All of these must be satisfied...
952+ // Invariant: all the `MatchPair`s are recursively simplified.
952953 match_pairs : Vec < MatchPair < ' pat , ' tcx > > ,
953954
954955 /// ...these bindings established...
956+ // Invariant: not mutated during match tree construction.
955957 bindings : Vec < Binding < ' tcx > > ,
956958
957959 /// ...and these types asserted...
960+ // Invariant: not mutated during match tree construction.
958961 ascriptions : Vec < Ascription < ' tcx > > ,
959962
960963 /// ...and if this is non-empty, one of these subcandidates also has to match...
@@ -1056,6 +1059,7 @@ pub(crate) struct MatchPair<'pat, 'tcx> {
10561059 place : PlaceBuilder < ' tcx > ,
10571060
10581061 // ... must match this pattern.
1062+ // Invariant: this pattern must be simplified, i.e. requires a test.
10591063 pattern : & ' pat Pat < ' tcx > ,
10601064
10611065 /// Precomputed sub-match pairs.
You can’t perform that action at this time.
0 commit comments