Rust: Model `async` return types as `dyn Future` · github/codeql@a9b58b8 · GitHub
Skip to content

Commit a9b58b8

Browse files
committed
Rust: Model async return types as dyn Future
1 parent 982950f commit a9b58b8

3 files changed

Lines changed: 31 additions & 19 deletions

File tree

‎rust/ql/lib/codeql/rust/internal/TypeInference.qll‎

Lines changed: 11 additions & 5 deletions

‎rust/ql/test/library-tests/type-inference/type-inference.expected‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4908,12 +4908,12 @@ inferType
49084908
| main.rs:2227:25:2229:5 | { ... } | | main.rs:2221:5:2221:14 | S1 |
49094909
| main.rs:2228:9:2228:10 | S1 | | main.rs:2221:5:2221:14 | S1 |
49104910
| main.rs:2231:41:2233:5 | { ... } | | main.rs:2231:16:2231:39 | impl ... |
4911-
| main.rs:2232:9:2232:20 | { ... } | | {EXTERNAL LOCATION} | trait Future |
4912-
| main.rs:2232:9:2232:20 | { ... } | Output | main.rs:2221:5:2221:14 | S1 |
4911+
| main.rs:2232:9:2232:20 | { ... } | | {EXTERNAL LOCATION} | dyn Future |
4912+
| main.rs:2232:9:2232:20 | { ... } | dyn(Output) | main.rs:2221:5:2221:14 | S1 |
49134913
| main.rs:2232:17:2232:18 | S1 | | main.rs:2221:5:2221:14 | S1 |
49144914
| main.rs:2235:41:2237:5 | { ... } | | main.rs:2235:16:2235:39 | impl ... |
4915-
| main.rs:2236:9:2236:16 | { ... } | | {EXTERNAL LOCATION} | trait Future |
4916-
| main.rs:2236:9:2236:16 | { ... } | Output | {EXTERNAL LOCATION} | () |
4915+
| main.rs:2236:9:2236:16 | { ... } | | {EXTERNAL LOCATION} | dyn Future |
4916+
| main.rs:2236:9:2236:16 | { ... } | dyn(Output) | {EXTERNAL LOCATION} | () |
49174917
| main.rs:2245:13:2245:42 | SelfParam | | {EXTERNAL LOCATION} | Pin |
49184918
| main.rs:2245:13:2245:42 | SelfParam | Ptr | {EXTERNAL LOCATION} | & |
49194919
| main.rs:2245:13:2245:42 | SelfParam | Ptr.TRef | main.rs:2239:5:2239:14 | S2 |
@@ -4928,8 +4928,8 @@ inferType
49284928
| main.rs:2253:9:2253:10 | S2 | | main.rs:2239:5:2239:14 | S2 |
49294929
| main.rs:2253:9:2253:10 | S2 | | main.rs:2252:16:2252:39 | impl ... |
49304930
| main.rs:2256:22:2264:5 | { ... } | | {EXTERNAL LOCATION} | () |
4931-
| main.rs:2257:9:2257:12 | f1(...) | | {EXTERNAL LOCATION} | trait Future |
4932-
| main.rs:2257:9:2257:12 | f1(...) | Output | main.rs:2221:5:2221:14 | S1 |
4931+
| main.rs:2257:9:2257:12 | f1(...) | | {EXTERNAL LOCATION} | dyn Future |
4932+
| main.rs:2257:9:2257:12 | f1(...) | dyn(Output) | main.rs:2221:5:2221:14 | S1 |
49334933
| main.rs:2257:9:2257:18 | await ... | | main.rs:2221:5:2221:14 | S1 |
49344934
| main.rs:2257:9:2257:22 | ... .f() | | {EXTERNAL LOCATION} | () |
49354935
| main.rs:2258:9:2258:12 | f2(...) | | main.rs:2231:16:2231:39 | impl ... |
@@ -4943,13 +4943,13 @@ inferType
49434943
| main.rs:2261:9:2261:10 | S2 | | main.rs:2239:5:2239:14 | S2 |
49444944
| main.rs:2261:9:2261:16 | await S2 | | main.rs:2221:5:2221:14 | S1 |
49454945
| main.rs:2261:9:2261:20 | ... .f() | | {EXTERNAL LOCATION} | () |
4946-
| main.rs:2262:13:2262:13 | b | | {EXTERNAL LOCATION} | trait Future |
4947-
| main.rs:2262:13:2262:13 | b | Output | main.rs:2221:5:2221:14 | S1 |
4948-
| main.rs:2262:17:2262:28 | { ... } | | {EXTERNAL LOCATION} | trait Future |
4949-
| main.rs:2262:17:2262:28 | { ... } | Output | main.rs:2221:5:2221:14 | S1 |
4946+
| main.rs:2262:13:2262:13 | b | | {EXTERNAL LOCATION} | dyn Future |
4947+
| main.rs:2262:13:2262:13 | b | dyn(Output) | main.rs:2221:5:2221:14 | S1 |
4948+
| main.rs:2262:17:2262:28 | { ... } | | {EXTERNAL LOCATION} | dyn Future |
4949+
| main.rs:2262:17:2262:28 | { ... } | dyn(Output) | main.rs:2221:5:2221:14 | S1 |
49504950
| main.rs:2262:25:2262:26 | S1 | | main.rs:2221:5:2221:14 | S1 |
4951-
| main.rs:2263:9:2263:9 | b | | {EXTERNAL LOCATION} | trait Future |
4952-
| main.rs:2263:9:2263:9 | b | Output | main.rs:2221:5:2221:14 | S1 |
4951+
| main.rs:2263:9:2263:9 | b | | {EXTERNAL LOCATION} | dyn Future |
4952+
| main.rs:2263:9:2263:9 | b | dyn(Output) | main.rs:2221:5:2221:14 | S1 |
49534953
| main.rs:2263:9:2263:15 | await b | | main.rs:2221:5:2221:14 | S1 |
49544954
| main.rs:2263:9:2263:19 | ... .f() | | {EXTERNAL LOCATION} | () |
49554955
| main.rs:2274:15:2274:19 | SelfParam | | {EXTERNAL LOCATION} | & |
@@ -6550,8 +6550,8 @@ inferType
65506550
| main.rs:3061:5:3061:24 | ...::f(...) | | {EXTERNAL LOCATION} | () |
65516551
| main.rs:3062:5:3062:17 | ...::f(...) | | {EXTERNAL LOCATION} | () |
65526552
| main.rs:3063:5:3063:18 | ...::f(...) | | {EXTERNAL LOCATION} | () |
6553-
| main.rs:3064:5:3064:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future |
6554-
| main.rs:3064:5:3064:15 | ...::f(...) | Output | {EXTERNAL LOCATION} | () |
6553+
| main.rs:3064:5:3064:15 | ...::f(...) | | {EXTERNAL LOCATION} | dyn Future |
6554+
| main.rs:3064:5:3064:15 | ...::f(...) | dyn(Output) | {EXTERNAL LOCATION} | () |
65556555
| main.rs:3065:5:3065:19 | ...::f(...) | | {EXTERNAL LOCATION} | () |
65566556
| main.rs:3066:5:3066:17 | ...::f(...) | | {EXTERNAL LOCATION} | () |
65576557
| main.rs:3067:5:3067:14 | ...::f(...) | | {EXTERNAL LOCATION} | () |

‎rust/tools/builtins/mentions.rs‎

Lines changed: 6 additions & 0 deletions

0 commit comments

Comments
 (0)