We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 463f79b commit cd80753Copy full SHA for cd80753
3 files changed
rust/ql/test/library-tests/dataflow/models/main.rs
@@ -249,6 +249,33 @@ fn test_enum_method_source() {
249
}
250
251
252
+mod source_into_function {
253
+ use super::sink;
254
+
255
+ // has a source model
256
+ fn pass_source<A>(_i: i64, f: impl FnOnce(i64) -> A) -> A {
257
+ f(42)
258
+ }
259
260
+ fn test_source_into_function() {
261
+ let a = |a| sink(a); // $ MISSING: hasValueFlow=1
262
+ pass_source(1, a);
263
264
+ pass_source(2, |a| {
265
+ sink(a); // $ MISSING: hasValueFlow=2
266
+ });
267
268
+ fn f(a: i64) {
269
+ sink(a) // $ MISSING: hasValueFlow=3
270
271
+ pass_source(3, f);
272
273
+ pass_source(4, async move |a| {
274
+ sink(a); // $ MISSING: hasValueFlow=4
275
276
277
+}
278
279
// has a sink model
280
fn enum_sink(e: MyFieldEnum) {}
281
0 commit comments