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) {
139139 // `match` expressions must be exhaustive, so last arm cannot fail
140140 pat = any ( MatchExpr me ) .getLastArm ( ) .getPat ( )
141141 or
142+ // macro invocations are exhaustive if their expansion is
143+ pat = any ( MacroPat mp | isExhaustiveMatch ( mp .getMacroCall ( ) .getExpanded ( ) ) )
144+ or
142145 // parameter patterns must be exhaustive
143146 pat = any ( Param p ) .getPat ( )
144147 ) and
@@ -149,6 +152,8 @@ private predicate isExhaustiveMatch(Pat pat) {
149152 or
150153 pat = parent .( IdentPat ) .getPat ( )
151154 or
155+ pat = parent .( MacroPat ) .getMacroCall ( ) .getExpanded ( )
156+ or
152157 pat = parent .( ParenPat ) .getPat ( )
153158 or
154159 pat = parent .( RecordPat ) .getRecordPatFieldList ( ) .getField ( _) .getPat ( )
You can’t perform that action at this time.
0 commit comments