File tree Expand file tree Collapse file tree 3 files changed +192
-164
lines changed
rust/ql/test/library-tests/dataflow/models Expand file tree Collapse file tree 3 files changed +192
-164
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,33 @@ fn test_enum_method_source() {
249
249
}
250
250
}
251
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
+
252
279
// has a sink model
253
280
fn enum_sink ( e : MyFieldEnum ) { }
254
281
You can’t perform that action at this time.
0 commit comments