File tree 1 file changed +4
-0
lines changed
compiler/rustc_mir_build/src/build/matches
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> {
949
949
has_guard : bool ,
950
950
951
951
/// All of these must be satisfied...
952
+ // Invariant: all the `MatchPair`s are recursively simplified.
952
953
match_pairs : Vec < MatchPair < ' pat , ' tcx > > ,
953
954
954
955
/// ...these bindings established...
956
+ // Invariant: not mutated during match tree construction.
955
957
bindings : Vec < Binding < ' tcx > > ,
956
958
957
959
/// ...and these types asserted...
960
+ // Invariant: not mutated during match tree construction.
958
961
ascriptions : Vec < Ascription < ' tcx > > ,
959
962
960
963
/// ...and if this is non-empty, one of these subcandidates also has to match...
@@ -1056,6 +1059,7 @@ pub(crate) struct MatchPair<'pat, 'tcx> {
1056
1059
place : PlaceBuilder < ' tcx > ,
1057
1060
1058
1061
// ... must match this pattern.
1062
+ // Invariant: this pattern must be simplified, i.e. requires a test.
1059
1063
pattern : & ' pat Pat < ' tcx > ,
1060
1064
1061
1065
/// Precomputed sub-match pairs.
You can’t perform that action at this time.
0 commit comments