We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Option
1 parent 7644012 commit 608c152Copy full SHA for 608c152
rust/ql/test/library-tests/dataflow/modeled/main.rs
@@ -50,6 +50,30 @@ mod my_clone {
50
}
51
52
53
+mod flow_throug_option {
54
+ use super::{source, sink};
55
+ // Test the auto generated flow summaries for `Option`
56
+
57
+ fn zip_flow() {
58
+ let a = Some(2);
59
+ let b = Some(source(38));
60
+ let z = a.zip(b);
61
+ match z {
62
+ Some((n, m)) => {
63
+ sink(n);
64
+ sink(m); // $ MISSING: hasValueFlow=38
65
+ },
66
+ None => ()
67
+ }
68
69
70
+ fn higher_order_flow() {
71
+ let a = Some(0);
72
+ let b = a.map_or(3, |n| n + source(63));
73
+ sink(b); // $ MISSING: hasTaintFlow=63
74
75
+}
76
77
fn main() {
78
option_clone();
79
result_clone();
0 commit comments