File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
rust/ql/lib/codeql/rust/controlflow/internal Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,9 @@ private predicate isExhaustiveMatch(Pat pat) {
139
139
// `match` expressions must be exhaustive, so last arm cannot fail
140
140
pat = any ( MatchExpr me ) .getLastArm ( ) .getPat ( )
141
141
or
142
+ // macro invocations are exhaustive if their expansion is
143
+ pat = any ( MacroPat mp | isExhaustiveMatch ( mp .getMacroCall ( ) .getExpanded ( ) ) )
144
+ or
142
145
// parameter patterns must be exhaustive
143
146
pat = any ( Param p ) .getPat ( )
144
147
) and
@@ -149,6 +152,8 @@ private predicate isExhaustiveMatch(Pat pat) {
149
152
or
150
153
pat = parent .( IdentPat ) .getPat ( )
151
154
or
155
+ pat = parent .( MacroPat ) .getMacroCall ( ) .getExpanded ( )
156
+ or
152
157
pat = parent .( ParenPat ) .getPat ( )
153
158
or
154
159
pat = parent .( RecordPat ) .getRecordPatFieldList ( ) .getField ( _) .getPat ( )
You can’t perform that action at this time.
0 commit comments