Skip to content

Commit fc558a1

Browse files
committed
Rust: Update expected files
1 parent 3fbb81e commit fc558a1

File tree

12 files changed

+199
-176
lines changed

12 files changed

+199
-176
lines changed

rust/ql/test/library-tests/dataflow/modeled/inline-flow.expected

Lines changed: 41 additions & 35 deletions
Large diffs are not rendered by default.

rust/ql/test/library-tests/dataflow/sources/database/InlineFlow.expected

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,37 @@ models
1313
| 12 | Summary: <_ as core::ops::arith::Add>::add; Argument[0]; ReturnValue; taint |
1414
| 13 | Summary: <_ as mysql::conn::queryable::Queryable>::query_fold; Argument[2].ReturnValue; ReturnValue.Field[core::result::Result::Ok(0)]; value |
1515
| 14 | Summary: <_ as mysql_async::queryable::Queryable>::query_fold; Argument[2].ReturnValue; ReturnValue.Future.Field[core::result::Result::Ok(0)]; value |
16-
| 15 | Summary: <core::i64 as core::ops::arith::Add>::add; Argument[0]; ReturnValue; taint |
17-
| 16 | Summary: <core::option::Option>::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value |
18-
| 17 | Summary: <core::result::Result>::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value |
16+
| 15 | Summary: <core::option::Option>::unwrap; Argument[self].Field[core::option::Option::Some(0)]; ReturnValue; value |
17+
| 16 | Summary: <core::result::Result>::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value |
1918
edges
2019
| test.rs:18:13:18:14 | v1 | test.rs:19:14:19:15 | v1 | provenance | |
21-
| test.rs:18:24:18:33 | row.get(...) [Some] | test.rs:18:24:18:42 | ... .unwrap() | provenance | MaD:16 |
20+
| test.rs:18:24:18:33 | row.get(...) [Some] | test.rs:18:24:18:42 | ... .unwrap() | provenance | MaD:15 |
2221
| test.rs:18:24:18:42 | ... .unwrap() | test.rs:18:13:18:14 | v1 | provenance | |
2322
| test.rs:18:28:18:30 | get | test.rs:18:24:18:33 | row.get(...) [Some] | provenance | Src:MaD:7 |
2423
| test.rs:21:13:21:14 | v2 | test.rs:22:14:22:15 | v2 | provenance | |
25-
| test.rs:21:24:21:37 | row.get_opt(...) [Some, Ok] | test.rs:21:24:21:46 | ... .unwrap() [Ok] | provenance | MaD:16 |
26-
| test.rs:21:24:21:46 | ... .unwrap() [Ok] | test.rs:21:24:21:55 | ... .unwrap() | provenance | MaD:17 |
24+
| test.rs:21:24:21:37 | row.get_opt(...) [Some, Ok] | test.rs:21:24:21:46 | ... .unwrap() [Ok] | provenance | MaD:15 |
25+
| test.rs:21:24:21:46 | ... .unwrap() [Ok] | test.rs:21:24:21:55 | ... .unwrap() | provenance | MaD:16 |
2726
| test.rs:21:24:21:55 | ... .unwrap() | test.rs:21:13:21:14 | v2 | provenance | |
2827
| test.rs:21:28:21:34 | get_opt | test.rs:21:24:21:37 | row.get_opt(...) [Some, Ok] | provenance | Src:MaD:8 |
2928
| test.rs:24:13:24:14 | v3 | test.rs:25:14:25:15 | v3 | provenance | |
30-
| test.rs:24:24:24:34 | row.take(...) [Some] | test.rs:24:24:24:43 | ... .unwrap() | provenance | MaD:16 |
29+
| test.rs:24:24:24:34 | row.take(...) [Some] | test.rs:24:24:24:43 | ... .unwrap() | provenance | MaD:15 |
3130
| test.rs:24:24:24:43 | ... .unwrap() | test.rs:24:13:24:14 | v3 | provenance | |
3231
| test.rs:24:28:24:31 | take | test.rs:24:24:24:34 | row.take(...) [Some] | provenance | Src:MaD:9 |
3332
| test.rs:27:13:27:14 | v4 | test.rs:28:14:28:15 | v4 | provenance | |
34-
| test.rs:27:24:27:38 | row.take_opt(...) [Some, Ok] | test.rs:27:24:27:47 | ... .unwrap() [Ok] | provenance | MaD:16 |
35-
| test.rs:27:24:27:47 | ... .unwrap() [Ok] | test.rs:27:24:27:56 | ... .unwrap() | provenance | MaD:17 |
33+
| test.rs:27:24:27:38 | row.take_opt(...) [Some, Ok] | test.rs:27:24:27:47 | ... .unwrap() [Ok] | provenance | MaD:15 |
34+
| test.rs:27:24:27:47 | ... .unwrap() [Ok] | test.rs:27:24:27:56 | ... .unwrap() | provenance | MaD:16 |
3635
| test.rs:27:24:27:56 | ... .unwrap() | test.rs:27:13:27:14 | v4 | provenance | |
3736
| test.rs:27:28:27:35 | take_opt | test.rs:27:24:27:38 | row.take_opt(...) [Some, Ok] | provenance | Src:MaD:10 |
3837
| test.rs:37:13:37:14 | v6 | test.rs:38:14:38:15 | v6 | provenance | |
3938
| test.rs:37:23:37:63 | conn.query_first(...) [Ok, Some] | test.rs:37:23:37:64 | TryExpr [Some] | provenance | |
40-
| test.rs:37:23:37:64 | TryExpr [Some] | test.rs:37:23:37:73 | ... .unwrap() | provenance | MaD:16 |
39+
| test.rs:37:23:37:64 | TryExpr [Some] | test.rs:37:23:37:73 | ... .unwrap() | provenance | MaD:15 |
4140
| test.rs:37:23:37:73 | ... .unwrap() | test.rs:37:13:37:14 | v6 | provenance | |
4241
| test.rs:37:28:37:38 | query_first | test.rs:37:23:37:63 | conn.query_first(...) [Ok, Some] | provenance | Src:MaD:1 |
4342
| test.rs:40:13:40:18 | mut t1 [element] | test.rs:42:20:42:21 | t1 [element] | provenance | |
4443
| test.rs:40:22:40:71 | conn.exec_iter(...) [Ok, element] | test.rs:40:22:40:72 | TryExpr [element] | provenance | |
4544
| test.rs:40:22:40:72 | TryExpr [element] | test.rs:40:13:40:18 | mut t1 [element] | provenance | |
4645
| test.rs:40:27:40:35 | exec_iter | test.rs:40:22:40:71 | conn.exec_iter(...) [Ok, element] | provenance | Src:MaD:6 |
47-
| test.rs:41:14:41:61 | ... .get(...) [Some] | test.rs:41:14:41:70 | ... .unwrap() | provenance | MaD:16 |
46+
| test.rs:41:14:41:61 | ... .get(...) [Some] | test.rs:41:14:41:70 | ... .unwrap() | provenance | MaD:15 |
4847
| test.rs:41:42:41:44 | get | test.rs:41:14:41:61 | ... .get(...) [Some] | provenance | Src:MaD:7 |
4948
| test.rs:42:13:42:15 | row | test.rs:44:22:44:22 | v | provenance | |
5049
| test.rs:42:20:42:21 | t1 [element] | test.rs:42:13:42:15 | row | provenance | |
@@ -64,7 +63,6 @@ edges
6463
| test.rs:66:13:66:21 | ... + ... | test.rs:64:86:67:9 | { ... } | provenance | |
6564
| test.rs:66:19:66:21 | row | test.rs:66:13:66:21 | ... + ... | provenance | MaD:11 |
6665
| test.rs:66:19:66:21 | row | test.rs:66:13:66:21 | ... + ... | provenance | MaD:12 |
67-
| test.rs:66:19:66:21 | row | test.rs:66:13:66:21 | ... + ... | provenance | MaD:15 |
6866
| test.rs:70:22:70:31 | query_fold | test.rs:70:83:70:105 | ...: ... | provenance | Src:MaD:2 |
6967
| test.rs:70:83:70:105 | ...: ... | test.rs:71:17:71:18 | id | provenance | |
7068
| test.rs:70:83:70:105 | ...: ... | test.rs:72:17:72:20 | name | provenance | |
@@ -73,21 +71,21 @@ edges
7371
| test.rs:72:17:72:20 | name | test.rs:75:18:75:21 | name | provenance | |
7472
| test.rs:73:17:73:19 | age | test.rs:76:18:76:20 | age | provenance | |
7573
| test.rs:105:13:105:14 | v1 | test.rs:106:14:106:15 | v1 | provenance | |
76-
| test.rs:105:24:105:33 | row.get(...) [Some] | test.rs:105:24:105:42 | ... .unwrap() | provenance | MaD:16 |
74+
| test.rs:105:24:105:33 | row.get(...) [Some] | test.rs:105:24:105:42 | ... .unwrap() | provenance | MaD:15 |
7775
| test.rs:105:24:105:42 | ... .unwrap() | test.rs:105:13:105:14 | v1 | provenance | |
7876
| test.rs:105:28:105:30 | get | test.rs:105:24:105:33 | row.get(...) [Some] | provenance | Src:MaD:7 |
7977
| test.rs:108:13:108:14 | v2 | test.rs:109:14:109:15 | v2 | provenance | |
80-
| test.rs:108:24:108:37 | row.get_opt(...) [Some, Ok] | test.rs:108:24:108:46 | ... .unwrap() [Ok] | provenance | MaD:16 |
81-
| test.rs:108:24:108:46 | ... .unwrap() [Ok] | test.rs:108:24:108:55 | ... .unwrap() | provenance | MaD:17 |
78+
| test.rs:108:24:108:37 | row.get_opt(...) [Some, Ok] | test.rs:108:24:108:46 | ... .unwrap() [Ok] | provenance | MaD:15 |
79+
| test.rs:108:24:108:46 | ... .unwrap() [Ok] | test.rs:108:24:108:55 | ... .unwrap() | provenance | MaD:16 |
8280
| test.rs:108:24:108:55 | ... .unwrap() | test.rs:108:13:108:14 | v2 | provenance | |
8381
| test.rs:108:28:108:34 | get_opt | test.rs:108:24:108:37 | row.get_opt(...) [Some, Ok] | provenance | Src:MaD:8 |
8482
| test.rs:111:13:111:14 | v3 | test.rs:112:14:112:15 | v3 | provenance | |
85-
| test.rs:111:24:111:34 | row.take(...) [Some] | test.rs:111:24:111:43 | ... .unwrap() | provenance | MaD:16 |
83+
| test.rs:111:24:111:34 | row.take(...) [Some] | test.rs:111:24:111:43 | ... .unwrap() | provenance | MaD:15 |
8684
| test.rs:111:24:111:43 | ... .unwrap() | test.rs:111:13:111:14 | v3 | provenance | |
8785
| test.rs:111:28:111:31 | take | test.rs:111:24:111:34 | row.take(...) [Some] | provenance | Src:MaD:9 |
8886
| test.rs:114:13:114:14 | v4 | test.rs:115:14:115:15 | v4 | provenance | |
89-
| test.rs:114:24:114:38 | row.take_opt(...) [Some, Ok] | test.rs:114:24:114:47 | ... .unwrap() [Ok] | provenance | MaD:16 |
90-
| test.rs:114:24:114:47 | ... .unwrap() [Ok] | test.rs:114:24:114:56 | ... .unwrap() | provenance | MaD:17 |
87+
| test.rs:114:24:114:38 | row.take_opt(...) [Some, Ok] | test.rs:114:24:114:47 | ... .unwrap() [Ok] | provenance | MaD:15 |
88+
| test.rs:114:24:114:47 | ... .unwrap() [Ok] | test.rs:114:24:114:56 | ... .unwrap() | provenance | MaD:16 |
9189
| test.rs:114:24:114:56 | ... .unwrap() | test.rs:114:13:114:14 | v4 | provenance | |
9290
| test.rs:114:28:114:35 | take_opt | test.rs:114:24:114:38 | row.take_opt(...) [Some, Ok] | provenance | Src:MaD:10 |
9391
| test.rs:135:22:135:30 | query_map | test.rs:137:14:137:24 | ...: i64 | provenance | Src:MaD:5 |
@@ -107,7 +105,6 @@ edges
107105
| test.rs:153:13:153:21 | ... + ... | test.rs:151:86:154:9 | { ... } | provenance | |
108106
| test.rs:153:19:153:21 | row | test.rs:153:13:153:21 | ... + ... | provenance | MaD:11 |
109107
| test.rs:153:19:153:21 | row | test.rs:153:13:153:21 | ... + ... | provenance | MaD:12 |
110-
| test.rs:153:19:153:21 | row | test.rs:153:13:153:21 | ... + ... | provenance | MaD:15 |
111108
| test.rs:157:22:157:31 | query_fold | test.rs:157:83:157:105 | ...: ... | provenance | Src:MaD:4 |
112109
| test.rs:157:83:157:105 | ...: ... | test.rs:158:17:158:18 | id | provenance | |
113110
| test.rs:157:83:157:105 | ...: ... | test.rs:159:17:159:20 | name | provenance | |

rust/ql/test/library-tests/dataflow/sources/file/InlineFlow.expected

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ models
3737
| 36 | Summary: <_ as tokio::io::util::async_read_ext::AsyncReadExt>::read_u8; Argument[self].Reference; ReturnValue.Future.Field[core::result::Result::Ok(0)]; taint |
3838
| 37 | Summary: <core::result::Result>::unwrap; Argument[self].Field[core::result::Result::Ok(0)]; ReturnValue; value |
3939
| 38 | Summary: <std::ffi::os_str::OsString>::into_string; Argument[self].Field[std::ffi::os_str::OsString::inner].Field[std::sys::os_str::bytes::Buf::inner]; ReturnValue.Field[core::result::Result::Ok(0)].Field[alloc::string::String::vec]; value |
40-
| 39 | Summary: <std::path::PathBuf>::as_path; Argument[self].Reference; ReturnValue.Reference; value |
40+
| 39 | Summary: <std::path::PathBuf as core::ops::deref::Deref>::deref; Argument[self].Reference.Field[std::path::PathBuf::inner]; ReturnValue.Reference; value |
41+
| 40 | Summary: <std::path::PathBuf>::as_path; Argument[self].Reference; ReturnValue.Reference; value |
4142
edges
4243
| test.rs:12:13:12:18 | buffer | test.rs:13:14:13:19 | buffer | provenance | |
4344
| test.rs:12:31:12:43 | ...::read | test.rs:12:31:12:55 | ...::read(...) [Ok] | provenance | Src:MaD:11 |
@@ -53,14 +54,23 @@ edges
5354
| test.rs:22:22:22:52 | TryExpr | test.rs:22:13:22:18 | buffer | provenance | |
5455
| test.rs:29:13:29:16 | path | test.rs:30:14:30:17 | path | provenance | |
5556
| test.rs:29:13:29:16 | path | test.rs:31:14:31:17 | path | provenance | |
57+
| test.rs:29:13:29:16 | path | test.rs:34:14:34:17 | path | provenance | |
58+
| test.rs:29:13:29:16 | path | test.rs:35:14:35:17 | path | provenance | |
5659
| test.rs:29:13:29:16 | path | test.rs:40:14:40:17 | path | provenance | |
5760
| test.rs:29:13:29:16 | path | test.rs:41:14:41:17 | path | provenance | |
5861
| test.rs:29:20:29:27 | e.path() | test.rs:29:13:29:16 | path | provenance | |
5962
| test.rs:29:22:29:25 | path | test.rs:29:20:29:27 | e.path() | provenance | Src:MaD:4 MaD:4 |
6063
| test.rs:30:14:30:17 | path | test.rs:30:14:30:25 | path.clone() | provenance | MaD:18 |
6164
| test.rs:31:14:31:17 | path | test.rs:31:14:31:25 | path.clone() | provenance | MaD:18 |
62-
| test.rs:31:14:31:25 | path.clone() | test.rs:31:14:31:35 | ... .as_path() | provenance | MaD:39 |
65+
| test.rs:31:14:31:25 | path.clone() | test.rs:31:14:31:35 | ... .as_path() | provenance | MaD:40 |
66+
| test.rs:34:14:34:17 | path | test.rs:34:14:34:25 | path.clone() | provenance | MaD:18 |
67+
| test.rs:34:14:34:25 | path.clone() | test.rs:34:14:34:37 | ... .as_os_str() | provenance | MaD:19 |
68+
| test.rs:34:14:34:25 | path.clone() | test.rs:34:14:34:37 | ... .as_os_str() | provenance | MaD:39 |
69+
| test.rs:35:14:35:17 | path | test.rs:35:14:35:25 | path.clone() | provenance | MaD:18 |
70+
| test.rs:35:14:35:25 | path.clone() | test.rs:35:14:35:41 | ... .as_mut_os_str() | provenance | MaD:19 |
71+
| test.rs:35:14:35:25 | path.clone() | test.rs:35:14:35:41 | ... .as_mut_os_str() | provenance | MaD:39 |
6372
| test.rs:40:14:40:17 | path | test.rs:40:14:40:32 | path.canonicalize() [Ok] | provenance | MaD:19 |
73+
| test.rs:40:14:40:17 | path | test.rs:40:14:40:32 | path.canonicalize() [Ok] | provenance | MaD:39 |
6474
| test.rs:40:14:40:32 | path.canonicalize() [Ok] | test.rs:40:14:40:41 | ... .unwrap() | provenance | MaD:37 |
6575
| test.rs:43:13:43:21 | file_name | test.rs:44:14:44:22 | file_name | provenance | |
6676
| test.rs:43:13:43:21 | file_name | test.rs:45:14:45:22 | file_name | provenance | |
@@ -282,6 +292,12 @@ nodes
282292
| test.rs:31:14:31:17 | path | semmle.label | path |
283293
| test.rs:31:14:31:25 | path.clone() | semmle.label | path.clone() |
284294
| test.rs:31:14:31:35 | ... .as_path() | semmle.label | ... .as_path() |
295+
| test.rs:34:14:34:17 | path | semmle.label | path |
296+
| test.rs:34:14:34:25 | path.clone() | semmle.label | path.clone() |
297+
| test.rs:34:14:34:37 | ... .as_os_str() | semmle.label | ... .as_os_str() |
298+
| test.rs:35:14:35:17 | path | semmle.label | path |
299+
| test.rs:35:14:35:25 | path.clone() | semmle.label | path.clone() |
300+
| test.rs:35:14:35:41 | ... .as_mut_os_str() | semmle.label | ... .as_mut_os_str() |
285301
| test.rs:40:14:40:17 | path | semmle.label | path |
286302
| test.rs:40:14:40:32 | path.canonicalize() [Ok] | semmle.label | path.canonicalize() [Ok] |
287303
| test.rs:40:14:40:41 | ... .unwrap() | semmle.label | ... .unwrap() |
@@ -508,6 +524,8 @@ testFailures
508524
| test.rs:23:14:23:19 | buffer | test.rs:22:22:22:39 | ...::read_to_string | test.rs:23:14:23:19 | buffer | $@ | test.rs:22:22:22:39 | ...::read_to_string | ...::read_to_string |
509525
| test.rs:30:14:30:25 | path.clone() | test.rs:29:22:29:25 | path | test.rs:30:14:30:25 | path.clone() | $@ | test.rs:29:22:29:25 | path | path |
510526
| test.rs:31:14:31:35 | ... .as_path() | test.rs:29:22:29:25 | path | test.rs:31:14:31:35 | ... .as_path() | $@ | test.rs:29:22:29:25 | path | path |
527+
| test.rs:34:14:34:37 | ... .as_os_str() | test.rs:29:22:29:25 | path | test.rs:34:14:34:37 | ... .as_os_str() | $@ | test.rs:29:22:29:25 | path | path |
528+
| test.rs:35:14:35:41 | ... .as_mut_os_str() | test.rs:29:22:29:25 | path | test.rs:35:14:35:41 | ... .as_mut_os_str() | $@ | test.rs:29:22:29:25 | path | path |
511529
| test.rs:40:14:40:41 | ... .unwrap() | test.rs:29:22:29:25 | path | test.rs:40:14:40:41 | ... .unwrap() | $@ | test.rs:29:22:29:25 | path | path |
512530
| test.rs:41:14:41:17 | path | test.rs:29:22:29:25 | path | test.rs:41:14:41:17 | path | $@ | test.rs:29:22:29:25 | path | path |
513531
| test.rs:44:14:44:30 | file_name.clone() | test.rs:43:27:43:35 | file_name | test.rs:44:14:44:30 | file_name.clone() | $@ | test.rs:43:27:43:35 | file_name | file_name |

rust/ql/test/library-tests/dataflow/sources/file/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ fn test_fs() -> Result<(), Box<dyn std::error::Error>> {
3131
sink(path.clone().as_path()); // $ hasTaintFlow
3232
sink(path.clone().into_os_string()); // $ MISSING: hasTaintFlow
3333
sink(std::path::PathBuf::from(path.clone().into_boxed_path())); // $ MISSING: hasTaintFlow
34-
sink(path.clone().as_os_str()); // $ MISSING: hasTaintFlow
35-
sink(path.clone().as_mut_os_str()); // $ MISSING: hasTaintFlow
34+
sink(path.clone().as_os_str()); // $ hasTaintFlow
35+
sink(path.clone().as_mut_os_str()); // $ hasTaintFlow
3636
sink(path.to_str()); // $ MISSING: hasTaintFlow
3737
sink(path.to_path_buf()); // $ MISSING: hasTaintFlow
3838
sink(path.file_name().unwrap()); // $ MISSING: hasTaintFlow

0 commit comments

Comments
 (0)