CS-FSSA-022
During pattern-matching a user can define a disjunction of multiple different values as a scrutinee for a
particular arm like the following example:
match v {
1 => …
1 | 3 => …
}
Such a case will not yield any warning however. The root cause is the initialisation of witness_report
at the beginning of usefulness.rs::is_useful_or(). It is initialised to an empty Witnesses
(which still counts as true) instead of NoWitness, as is the case for e.g., is_useful_constructed().
Therefore, is_useful_or() will essentially always return true.
CS-FSSA-022 During pattern-matching a user can define a disjunction of multiple different values as a scrutinee for a particular arm like the following example:
Such a case will not yield any warning however. The root cause is the initialisation of witness_report at the beginning of usefulness.rs::is_useful_or(). It is initialised to an empty Witnesses (which still counts as true) instead of NoWitness, as is the case for e.g., is_useful_constructed(). Therefore, is_useful_or() will essentially always return true.