Skip to content

Commit 5e265b1

Browse files
committed
Rust: Trait call dispatch in dataflow
1 parent a4ed5da commit 5e265b1

File tree

9 files changed

+101
-11
lines changed

9 files changed

+101
-11
lines changed

rust/ql/.generated.list

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/.gitattributes

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,10 @@ module RustDataFlow implements InputSig<Location> {
404404

405405
/** Gets a viable implementation of the target of the given `Call`. */
406406
DataFlowCallable viableCallable(DataFlowCall call) {
407-
exists(Callable target | target = call.asCallCfgNode().getCall().getStaticTarget() |
408-
target = result.asCfgScope()
407+
exists(Call c | c = call.asCallCfgNode().getCall() |
408+
result.asCfgScope() = c.getARuntimeTarget()
409409
or
410-
target = result.asSummarizedCallable()
410+
result.asSummarizedCallable() = c.getStaticTarget()
411411
)
412412
}
413413

rust/ql/lib/codeql/rust/elements/internal/AssocItemImpl.qll

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// generated by codegen, remove this comment if you wish to edit this file
21
/**
32
* This module provides a hand-modifiable wrapper around the generated class `AssocItem`.
43
*
@@ -12,6 +11,10 @@ private import codeql.rust.elements.internal.generated.AssocItem
1211
* be referenced directly.
1312
*/
1413
module Impl {
14+
private import rust
15+
private import codeql.rust.internal.PathResolution
16+
17+
// the following QLdoc is generated: if you need to edit it, do it in the schema file
1518
/**
1619
* An associated item in a `Trait` or `Impl`.
1720
*
@@ -21,5 +24,15 @@ module Impl {
2124
* // ^^^^^^^^^^^^^
2225
* ```
2326
*/
24-
class AssocItem extends Generated::AssocItem { }
27+
class AssocItem extends Generated::AssocItem {
28+
/** Holds if this item implements trait item `other`. */
29+
pragma[nomagic]
30+
predicate implements(AssocItem other) {
31+
exists(TraitItemNode t, ImplItemNode i, string name |
32+
other = t.getAssocItem(pragma[only_bind_into](name)) and
33+
t = i.resolveTraitTy() and
34+
this = i.getAssocItem(pragma[only_bind_into](name))
35+
)
36+
}
37+
}
2538
}

rust/ql/lib/codeql/rust/elements/internal/CallImpl.qll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,17 @@ module Impl {
6565
not exists(TypeInference::resolveMethodCallTarget(this)) and
6666
result = this.(CallExpr).getStaticTarget()
6767
}
68+
69+
/** Gets a runtime target of this call, if any. */
70+
pragma[nomagic]
71+
Function getARuntimeTarget() {
72+
result.hasImplementation() and
73+
(
74+
result = this.getStaticTarget()
75+
or
76+
result.implements(this.getStaticTarget())
77+
)
78+
}
6879
}
6980

7081
/** Holds if the call expression dispatches to a trait method. */

rust/ql/lib/codeql/rust/internal/PathResolution.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,13 @@ abstract class ImplOrTraitItemNode extends ItemNode {
540540
/** Gets an associated item belonging to this trait or `impl` block. */
541541
abstract AssocItemNode getAnAssocItem();
542542

543+
/** Gets the associated item named `name` belonging to this trait or `impl` block. */
544+
pragma[nomagic]
545+
AssocItemNode getAssocItem(string name) {
546+
result = this.getAnAssocItem() and
547+
result.getName() = name
548+
}
549+
543550
/** Holds if this trait or `impl` block declares an associated item named `name`. */
544551
pragma[nomagic]
545552
predicate hasAssocItem(string name) { name = this.getAnAssocItem().getName() }

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

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,31 @@ edges
5353
| main.rs:109:35:109:43 | source(...) | main.rs:108:30:110:5 | { ... } | provenance | |
5454
| main.rs:112:27:112:32 | ...: i64 | main.rs:112:42:114:5 | { ... } | provenance | |
5555
| main.rs:118:28:118:33 | ...: i64 | main.rs:119:14:119:14 | n | provenance | |
56+
| main.rs:122:36:124:5 | { ... } | main.rs:132:13:132:30 | x.get_data_trait() | provenance | |
5657
| main.rs:122:36:124:5 | { ... } | main.rs:142:13:142:31 | mn.get_data_trait() | provenance | |
5758
| main.rs:123:35:123:44 | source(...) | main.rs:122:36:124:5 | { ... } | provenance | |
5859
| main.rs:126:33:126:38 | ...: i64 | main.rs:126:48:128:5 | { ... } | provenance | |
60+
| main.rs:132:9:132:9 | a | main.rs:133:10:133:10 | a | provenance | |
61+
| main.rs:132:13:132:30 | x.get_data_trait() | main.rs:132:9:132:9 | a | provenance | |
5962
| main.rs:138:9:138:9 | a | main.rs:139:10:139:10 | a | provenance | |
6063
| main.rs:138:13:138:25 | mn.get_data() | main.rs:138:9:138:9 | a | provenance | |
6164
| main.rs:142:9:142:9 | a | main.rs:143:10:143:10 | a | provenance | |
6265
| main.rs:142:13:142:31 | mn.get_data_trait() | main.rs:142:9:142:9 | a | provenance | |
66+
| main.rs:149:9:149:9 | a | main.rs:150:21:150:21 | a | provenance | |
67+
| main.rs:149:13:149:22 | source(...) | main.rs:149:9:149:9 | a | provenance | |
68+
| main.rs:150:21:150:21 | a | main.rs:118:28:118:33 | ...: i64 | provenance | |
6369
| main.rs:155:9:155:9 | a | main.rs:156:16:156:16 | a | provenance | |
6470
| main.rs:155:13:155:21 | source(...) | main.rs:155:9:155:9 | a | provenance | |
6571
| main.rs:156:16:156:16 | a | main.rs:104:22:104:27 | ...: i64 | provenance | |
6672
| main.rs:159:9:159:9 | a | main.rs:160:22:160:22 | a | provenance | |
6773
| main.rs:159:13:159:22 | source(...) | main.rs:159:9:159:9 | a | provenance | |
6874
| main.rs:160:22:160:22 | a | main.rs:118:28:118:33 | ...: i64 | provenance | |
75+
| main.rs:166:9:166:9 | a | main.rs:167:34:167:34 | a | provenance | |
76+
| main.rs:166:13:166:22 | source(...) | main.rs:166:9:166:9 | a | provenance | |
77+
| main.rs:167:9:167:9 | b | main.rs:168:10:168:10 | b | provenance | |
78+
| main.rs:167:13:167:35 | x.data_through_trait(...) | main.rs:167:9:167:9 | b | provenance | |
79+
| main.rs:167:34:167:34 | a | main.rs:126:33:126:38 | ...: i64 | provenance | |
80+
| main.rs:167:34:167:34 | a | main.rs:167:13:167:35 | x.data_through_trait(...) | provenance | |
6981
| main.rs:173:9:173:9 | a | main.rs:174:29:174:29 | a | provenance | |
7082
| main.rs:173:13:173:21 | source(...) | main.rs:173:9:173:9 | a | provenance | |
7183
| main.rs:174:9:174:9 | b | main.rs:175:10:175:10 | b | provenance | |
@@ -100,6 +112,11 @@ edges
100112
| main.rs:222:9:222:35 | MyInt {...} [MyInt] | main.rs:220:42:223:5 | { ... } [MyInt] | provenance | |
101113
| main.rs:222:24:222:27 | self [MyInt] | main.rs:222:24:222:33 | self.value | provenance | |
102114
| main.rs:222:24:222:33 | self.value | main.rs:222:9:222:35 | MyInt {...} [MyInt] | provenance | |
115+
| main.rs:227:30:227:39 | ...: MyInt [MyInt] | main.rs:228:25:228:27 | rhs [MyInt] | provenance | |
116+
| main.rs:228:10:228:14 | [post] * ... [MyInt] | main.rs:228:11:228:14 | [post] self [&ref, MyInt] | provenance | |
117+
| main.rs:228:11:228:14 | [post] self [&ref, MyInt] | main.rs:227:19:227:27 | SelfParam [Return] [&ref, MyInt] | provenance | |
118+
| main.rs:228:25:228:27 | rhs [MyInt] | main.rs:228:25:228:33 | rhs.value | provenance | |
119+
| main.rs:228:25:228:33 | rhs.value | main.rs:228:10:228:14 | [post] * ... [MyInt] | provenance | |
103120
| main.rs:242:9:242:9 | a [MyInt] | main.rs:244:13:244:13 | a [MyInt] | provenance | |
104121
| main.rs:242:13:242:38 | MyInt {...} [MyInt] | main.rs:242:9:242:9 | a [MyInt] | provenance | |
105122
| main.rs:242:28:242:36 | source(...) | main.rs:242:13:242:38 | MyInt {...} [MyInt] | provenance | |
@@ -115,6 +132,14 @@ edges
115132
| main.rs:254:9:254:9 | d [MyInt] | main.rs:255:10:255:10 | d [MyInt] | provenance | |
116133
| main.rs:254:13:254:20 | a.add(...) [MyInt] | main.rs:254:9:254:9 | d [MyInt] | provenance | |
117134
| main.rs:255:10:255:10 | d [MyInt] | main.rs:255:10:255:16 | d.value | provenance | |
135+
| main.rs:259:9:259:9 | b [MyInt] | main.rs:261:35:261:35 | b [MyInt] | provenance | |
136+
| main.rs:259:13:259:39 | MyInt {...} [MyInt] | main.rs:259:9:259:9 | b [MyInt] | provenance | |
137+
| main.rs:259:28:259:37 | source(...) | main.rs:259:13:259:39 | MyInt {...} [MyInt] | provenance | |
138+
| main.rs:261:27:261:32 | [post] &mut a [&ref, MyInt] | main.rs:261:32:261:32 | [post] a [MyInt] | provenance | |
139+
| main.rs:261:32:261:32 | [post] a [MyInt] | main.rs:262:10:262:10 | a [MyInt] | provenance | |
140+
| main.rs:261:35:261:35 | b [MyInt] | main.rs:227:30:227:39 | ...: MyInt [MyInt] | provenance | |
141+
| main.rs:261:35:261:35 | b [MyInt] | main.rs:261:27:261:32 | [post] &mut a [&ref, MyInt] | provenance | |
142+
| main.rs:262:10:262:10 | a [MyInt] | main.rs:262:10:262:16 | a.value | provenance | |
118143
| main.rs:289:18:289:21 | SelfParam [MyInt] | main.rs:289:48:291:5 | { ... } [MyInt] | provenance | |
119144
| main.rs:293:26:293:37 | ...: MyInt [MyInt] | main.rs:293:49:295:5 | { ... } [MyInt] | provenance | |
120145
| main.rs:299:9:299:9 | a [MyInt] | main.rs:301:50:301:50 | a [MyInt] | provenance | |
@@ -206,18 +231,30 @@ nodes
206231
| main.rs:123:35:123:44 | source(...) | semmle.label | source(...) |
207232
| main.rs:126:33:126:38 | ...: i64 | semmle.label | ...: i64 |
208233
| main.rs:126:48:128:5 | { ... } | semmle.label | { ... } |
234+
| main.rs:132:9:132:9 | a | semmle.label | a |
235+
| main.rs:132:13:132:30 | x.get_data_trait() | semmle.label | x.get_data_trait() |
236+
| main.rs:133:10:133:10 | a | semmle.label | a |
209237
| main.rs:138:9:138:9 | a | semmle.label | a |
210238
| main.rs:138:13:138:25 | mn.get_data() | semmle.label | mn.get_data() |
211239
| main.rs:139:10:139:10 | a | semmle.label | a |
212240
| main.rs:142:9:142:9 | a | semmle.label | a |
213241
| main.rs:142:13:142:31 | mn.get_data_trait() | semmle.label | mn.get_data_trait() |
214242
| main.rs:143:10:143:10 | a | semmle.label | a |
243+
| main.rs:149:9:149:9 | a | semmle.label | a |
244+
| main.rs:149:13:149:22 | source(...) | semmle.label | source(...) |
245+
| main.rs:150:21:150:21 | a | semmle.label | a |
215246
| main.rs:155:9:155:9 | a | semmle.label | a |
216247
| main.rs:155:13:155:21 | source(...) | semmle.label | source(...) |
217248
| main.rs:156:16:156:16 | a | semmle.label | a |
218249
| main.rs:159:9:159:9 | a | semmle.label | a |
219250
| main.rs:159:13:159:22 | source(...) | semmle.label | source(...) |
220251
| main.rs:160:22:160:22 | a | semmle.label | a |
252+
| main.rs:166:9:166:9 | a | semmle.label | a |
253+
| main.rs:166:13:166:22 | source(...) | semmle.label | source(...) |
254+
| main.rs:167:9:167:9 | b | semmle.label | b |
255+
| main.rs:167:13:167:35 | x.data_through_trait(...) | semmle.label | x.data_through_trait(...) |
256+
| main.rs:167:34:167:34 | a | semmle.label | a |
257+
| main.rs:168:10:168:10 | b | semmle.label | b |
221258
| main.rs:173:9:173:9 | a | semmle.label | a |
222259
| main.rs:173:13:173:21 | source(...) | semmle.label | source(...) |
223260
| main.rs:174:9:174:9 | b | semmle.label | b |
@@ -254,6 +291,12 @@ nodes
254291
| main.rs:222:9:222:35 | MyInt {...} [MyInt] | semmle.label | MyInt {...} [MyInt] |
255292
| main.rs:222:24:222:27 | self [MyInt] | semmle.label | self [MyInt] |
256293
| main.rs:222:24:222:33 | self.value | semmle.label | self.value |
294+
| main.rs:227:19:227:27 | SelfParam [Return] [&ref, MyInt] | semmle.label | SelfParam [Return] [&ref, MyInt] |
295+
| main.rs:227:30:227:39 | ...: MyInt [MyInt] | semmle.label | ...: MyInt [MyInt] |
296+
| main.rs:228:10:228:14 | [post] * ... [MyInt] | semmle.label | [post] * ... [MyInt] |
297+
| main.rs:228:11:228:14 | [post] self [&ref, MyInt] | semmle.label | [post] self [&ref, MyInt] |
298+
| main.rs:228:25:228:27 | rhs [MyInt] | semmle.label | rhs [MyInt] |
299+
| main.rs:228:25:228:33 | rhs.value | semmle.label | rhs.value |
257300
| main.rs:242:9:242:9 | a [MyInt] | semmle.label | a [MyInt] |
258301
| main.rs:242:13:242:38 | MyInt {...} [MyInt] | semmle.label | MyInt {...} [MyInt] |
259302
| main.rs:242:28:242:36 | source(...) | semmle.label | source(...) |
@@ -269,6 +312,14 @@ nodes
269312
| main.rs:254:13:254:20 | a.add(...) [MyInt] | semmle.label | a.add(...) [MyInt] |
270313
| main.rs:255:10:255:10 | d [MyInt] | semmle.label | d [MyInt] |
271314
| main.rs:255:10:255:16 | d.value | semmle.label | d.value |
315+
| main.rs:259:9:259:9 | b [MyInt] | semmle.label | b [MyInt] |
316+
| main.rs:259:13:259:39 | MyInt {...} [MyInt] | semmle.label | MyInt {...} [MyInt] |
317+
| main.rs:259:28:259:37 | source(...) | semmle.label | source(...) |
318+
| main.rs:261:27:261:32 | [post] &mut a [&ref, MyInt] | semmle.label | [post] &mut a [&ref, MyInt] |
319+
| main.rs:261:32:261:32 | [post] a [MyInt] | semmle.label | [post] a [MyInt] |
320+
| main.rs:261:35:261:35 | b [MyInt] | semmle.label | b [MyInt] |
321+
| main.rs:262:10:262:10 | a [MyInt] | semmle.label | a [MyInt] |
322+
| main.rs:262:10:262:16 | a.value | semmle.label | a.value |
272323
| main.rs:289:18:289:21 | SelfParam [MyInt] | semmle.label | SelfParam [MyInt] |
273324
| main.rs:289:48:291:5 | { ... } [MyInt] | semmle.label | { ... } [MyInt] |
274325
| main.rs:293:26:293:37 | ...: MyInt [MyInt] | semmle.label | ...: MyInt [MyInt] |
@@ -308,12 +359,14 @@ subpaths
308359
| main.rs:67:26:67:26 | a | main.rs:61:17:61:22 | ...: i64 | main.rs:61:32:63:1 | { ... } | main.rs:67:13:67:27 | pass_through(...) |
309360
| main.rs:72:26:75:5 | { ... } | main.rs:61:17:61:22 | ...: i64 | main.rs:61:32:63:1 | { ... } | main.rs:72:13:75:6 | pass_through(...) |
310361
| main.rs:86:26:86:26 | a | main.rs:82:21:82:26 | ...: i64 | main.rs:82:36:84:5 | { ... } | main.rs:86:13:86:27 | pass_through(...) |
362+
| main.rs:167:34:167:34 | a | main.rs:126:33:126:38 | ...: i64 | main.rs:126:48:128:5 | { ... } | main.rs:167:13:167:35 | x.data_through_trait(...) |
311363
| main.rs:174:29:174:29 | a | main.rs:112:27:112:32 | ...: i64 | main.rs:112:42:114:5 | { ... } | main.rs:174:13:174:30 | mn.data_through(...) |
312364
| main.rs:179:35:179:35 | a | main.rs:126:33:126:38 | ...: i64 | main.rs:126:48:128:5 | { ... } | main.rs:179:13:179:36 | mn.data_through_trait(...) |
313365
| main.rs:194:38:194:38 | a | main.rs:112:27:112:32 | ...: i64 | main.rs:112:42:114:5 | { ... } | main.rs:194:13:194:39 | ...::data_through(...) |
314366
| main.rs:212:24:212:33 | source(...) | main.rs:206:12:206:17 | ...: i64 | main.rs:206:28:208:5 | { ... } [MyInt] | main.rs:212:13:212:34 | ...::new(...) [MyInt] |
315367
| main.rs:244:13:244:13 | a [MyInt] | main.rs:220:12:220:15 | SelfParam [MyInt] | main.rs:220:42:223:5 | { ... } [MyInt] | main.rs:244:13:244:17 | ... + ... [MyInt] |
316368
| main.rs:252:9:252:9 | a [MyInt] | main.rs:220:12:220:15 | SelfParam [MyInt] | main.rs:220:42:223:5 | { ... } [MyInt] | main.rs:254:13:254:20 | a.add(...) [MyInt] |
369+
| main.rs:261:35:261:35 | b [MyInt] | main.rs:227:30:227:39 | ...: MyInt [MyInt] | main.rs:227:19:227:27 | SelfParam [Return] [&ref, MyInt] | main.rs:261:27:261:32 | [post] &mut a [&ref, MyInt] |
317370
| main.rs:301:50:301:50 | a [MyInt] | main.rs:289:18:289:21 | SelfParam [MyInt] | main.rs:289:48:291:5 | { ... } [MyInt] | main.rs:301:30:301:54 | ...::take_self(...) [MyInt] |
318371
| main.rs:306:55:306:55 | b [MyInt] | main.rs:293:26:293:37 | ...: MyInt [MyInt] | main.rs:293:49:295:5 | { ... } [MyInt] | main.rs:306:30:306:56 | ...::take_second(...) [MyInt] |
319372
testFailures
@@ -327,15 +380,19 @@ testFailures
327380
| main.rs:87:10:87:10 | b | main.rs:80:13:80:22 | source(...) | main.rs:87:10:87:10 | b | $@ | main.rs:80:13:80:22 | source(...) | source(...) |
328381
| main.rs:105:14:105:14 | n | main.rs:155:13:155:21 | source(...) | main.rs:105:14:105:14 | n | $@ | main.rs:155:13:155:21 | source(...) | source(...) |
329382
| main.rs:105:14:105:14 | n | main.rs:187:13:187:21 | source(...) | main.rs:105:14:105:14 | n | $@ | main.rs:187:13:187:21 | source(...) | source(...) |
383+
| main.rs:119:14:119:14 | n | main.rs:149:13:149:22 | source(...) | main.rs:119:14:119:14 | n | $@ | main.rs:149:13:149:22 | source(...) | source(...) |
330384
| main.rs:119:14:119:14 | n | main.rs:159:13:159:22 | source(...) | main.rs:119:14:119:14 | n | $@ | main.rs:159:13:159:22 | source(...) | source(...) |
385+
| main.rs:133:10:133:10 | a | main.rs:123:35:123:44 | source(...) | main.rs:133:10:133:10 | a | $@ | main.rs:123:35:123:44 | source(...) | source(...) |
331386
| main.rs:139:10:139:10 | a | main.rs:109:35:109:43 | source(...) | main.rs:139:10:139:10 | a | $@ | main.rs:109:35:109:43 | source(...) | source(...) |
332387
| main.rs:143:10:143:10 | a | main.rs:123:35:123:44 | source(...) | main.rs:143:10:143:10 | a | $@ | main.rs:123:35:123:44 | source(...) | source(...) |
388+
| main.rs:168:10:168:10 | b | main.rs:166:13:166:22 | source(...) | main.rs:168:10:168:10 | b | $@ | main.rs:166:13:166:22 | source(...) | source(...) |
333389
| main.rs:175:10:175:10 | b | main.rs:173:13:173:21 | source(...) | main.rs:175:10:175:10 | b | $@ | main.rs:173:13:173:21 | source(...) | source(...) |
334390
| main.rs:180:10:180:10 | b | main.rs:178:13:178:22 | source(...) | main.rs:180:10:180:10 | b | $@ | main.rs:178:13:178:22 | source(...) | source(...) |
335391
| main.rs:195:10:195:10 | b | main.rs:193:13:193:22 | source(...) | main.rs:195:10:195:10 | b | $@ | main.rs:193:13:193:22 | source(...) | source(...) |
336392
| main.rs:214:10:214:10 | m | main.rs:212:24:212:33 | source(...) | main.rs:214:10:214:10 | m | $@ | main.rs:212:24:212:33 | source(...) | source(...) |
337393
| main.rs:245:10:245:16 | c.value | main.rs:242:28:242:36 | source(...) | main.rs:245:10:245:16 | c.value | $@ | main.rs:242:28:242:36 | source(...) | source(...) |
338394
| main.rs:255:10:255:16 | d.value | main.rs:252:28:252:36 | source(...) | main.rs:255:10:255:16 | d.value | $@ | main.rs:252:28:252:36 | source(...) | source(...) |
395+
| main.rs:262:10:262:16 | a.value | main.rs:259:28:259:37 | source(...) | main.rs:262:10:262:16 | a.value | $@ | main.rs:259:28:259:37 | source(...) | source(...) |
339396
| main.rs:302:10:302:10 | c | main.rs:299:28:299:36 | source(...) | main.rs:302:10:302:10 | c | $@ | main.rs:299:28:299:36 | source(...) | source(...) |
340397
| main.rs:307:10:307:10 | c | main.rs:305:28:305:37 | source(...) | main.rs:307:10:307:10 | c | $@ | main.rs:305:28:305:37 | source(...) | source(...) |
341398
| main.rs:317:10:317:10 | a | main.rs:316:13:316:21 | source(...) | main.rs:317:10:317:10 | a | $@ | main.rs:316:13:316:21 | source(...) | source(...) |

rust/ql/test/library-tests/dataflow/global/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl MyFlag {
116116

117117
impl MyTrait for MyFlag {
118118
fn data_in_trait(self, n: i64) {
119-
sink(n); // $ hasValueFlow=22 $ MISSING: hasValueFlow=31
119+
sink(n); // $ hasValueFlow=22 $ hasValueFlow=31
120120
}
121121

122122
fn get_data_trait(self) -> i64 {
@@ -130,7 +130,7 @@ impl MyTrait for MyFlag {
130130

131131
fn data_out_of_method_trait_dispatch<T: MyTrait>(x: T) {
132132
let a = x.get_data_trait();
133-
sink(a); // $ MISSING: hasValueFlow=21
133+
sink(a); // $ hasValueFlow=21
134134
}
135135

136136
fn data_out_of_method() {
@@ -165,7 +165,7 @@ fn data_in_to_method_call() {
165165
fn data_through_method_trait_dispatch<T: MyTrait>(x: T) {
166166
let a = source(34);
167167
let b = x.data_through_trait(a);
168-
sink(b); // $ MISSING: hasValueFlow=34
168+
sink(b); // $ hasValueFlow=34
169169
}
170170

171171
fn data_through_method() {
@@ -259,7 +259,7 @@ fn test_operator_overloading() {
259259
let b = MyInt { value: source(34) };
260260
// The line below is what `*=` desugars to.
261261
MulAssign::mul_assign(&mut a, b);
262-
sink(a.value); // $ MISSING: hasValueFlow=34
262+
sink(a.value); // $ hasValueFlow=34
263263

264264
let mut a = MyInt { value: 0 };
265265
let b = MyInt { value: source(35) };

0 commit comments

Comments
 (0)