Skip to content

Commit 84accd1

Browse files
committed
Rust: Implement overloaded index expression in type inference
1 parent 13bc0d2 commit 84accd1

File tree

5 files changed

+69
-111
lines changed

5 files changed

+69
-111
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,11 @@ private module Cached {
959959

960960
cached
961961
newtype TDataFlowCall =
962-
TCall(CallCfgNode c) { Stages::DataFlowStage::ref() } or
962+
TCall(CallCfgNode c) {
963+
Stages::DataFlowStage::ref() and
964+
// TODO: Handle index expressions as calls in data flow.
965+
not c.getCall() instanceof IndexExpr
966+
} or
963967
TSummaryCall(
964968
FlowSummaryImpl::Public::SummarizedCallable c, FlowSummaryImpl::Private::SummaryNode receiver
965969
) {

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,20 @@ module Impl {
160160
pos.asPosition() = 0 and result = super.getOperand(1)
161161
}
162162
}
163+
164+
private class IndexCall extends Call instanceof IndexExpr {
165+
override string getMethodName() { result = "index" }
166+
167+
override Trait getTrait() { result.getCanonicalPath() = "core::ops::index::Index" }
168+
169+
override predicate implicitBorrowAt(ArgumentPosition pos, boolean certain) {
170+
pos.isSelf() and certain = true
171+
}
172+
173+
override Expr getArgument(ArgumentPosition pos) {
174+
pos.isSelf() and result = super.getBase()
175+
or
176+
pos.asPosition() = 0 and result = super.getIndex()
177+
}
178+
}
163179
}

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

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -772,45 +772,48 @@ private Type inferCallExprBaseType(AstNode n, TypePath path) {
772772
n = a.getNodeAt(apos) and
773773
result = CallExprBaseMatching::inferAccessType(a, apos, path0)
774774
|
775-
(
775+
if
776776
apos.isBorrowed(true)
777777
or
778-
// The desugaring of the unary `*e` is `*Deref::deref(&e)`. To handle the
779-
// deref expression after the call we must strip a `&` from the type at
780-
// the return position.
781-
apos.isReturn() and a instanceof DerefExpr
782-
) and
783-
path0.isCons(TRefTypeParameter(), path)
784-
or
785-
apos.isBorrowed(false) and
786-
exists(Type argType | argType = inferType(n) |
787-
if argType = TRefType()
778+
// The desugaring of the unary `*e` is `*Deref::deref(&e)` and the
779+
// desugaring of `a[b]` is `*Index::index(&a, b)`. To handle the deref
780+
// expression after the call we must strip a `&` from the type at the
781+
// return position.
782+
apos.isReturn() and
783+
(a instanceof DerefExpr or a instanceof IndexExpr)
784+
then path0.isCons(TRefTypeParameter(), path)
785+
else
786+
if apos.isBorrowed(false)
788787
then
789-
path = path0 and
790-
path0.isCons(TRefTypeParameter(), _)
791-
or
792-
// adjust for implicit deref
793-
not path0.isCons(TRefTypeParameter(), _) and
794-
not (path0.isEmpty() and result = TRefType()) and
795-
path = TypePath::cons(TRefTypeParameter(), path0)
796-
else (
797-
not (
798-
argType.(StructType).asItemNode() instanceof StringStruct and
799-
result.(StructType).asItemNode() instanceof Builtins::Str
800-
) and
801-
(
802-
not path0.isCons(TRefTypeParameter(), _) and
803-
not (path0.isEmpty() and result = TRefType()) and
804-
path = path0
805-
or
806-
// adjust for implicit borrow
807-
path0.isCons(TRefTypeParameter(), path)
788+
exists(Type argType | argType = inferType(n) |
789+
if argType = TRefType()
790+
then
791+
path = path0 and
792+
path0.isCons(TRefTypeParameter(), _)
793+
or
794+
// adjust for implicit deref
795+
not path0.isCons(TRefTypeParameter(), _) and
796+
not (path0.isEmpty() and result = TRefType()) and
797+
path = TypePath::cons(TRefTypeParameter(), path0)
798+
else (
799+
not (
800+
argType.(StructType).asItemNode() instanceof StringStruct and
801+
result.(StructType).asItemNode() instanceof Builtins::Str
802+
) and
803+
(
804+
not path0.isCons(TRefTypeParameter(), _) and
805+
not (path0.isEmpty() and result = TRefType()) and
806+
path = path0
807+
or
808+
// adjust for implicit borrow
809+
path0.isCons(TRefTypeParameter(), path)
810+
)
811+
)
808812
)
813+
else (
814+
not apos.isBorrowed(_) and
815+
path = path0
809816
)
810-
)
811-
or
812-
not apos.isBorrowed(_) and
813-
path = path0
814817
)
815818
}
816819

@@ -1116,8 +1119,8 @@ private class Vec extends Struct {
11161119
*/
11171120
pragma[nomagic]
11181121
private Type inferIndexExprType(IndexExpr ie, TypePath path) {
1119-
// TODO: Should be implemented as method resolution, using the special
1120-
// `std::ops::Index` trait.
1122+
// TODO: Method resolution to the `std::ops::Index` trait can handle the
1123+
// `Index` instances for slices and arrays.
11211124
exists(TypePath exprPath, Builtins::BuiltinType t |
11221125
TStruct(t) = inferType(ie.getIndex()) and
11231126
(
@@ -1129,8 +1132,6 @@ private Type inferIndexExprType(IndexExpr ie, TypePath path) {
11291132
) and
11301133
result = inferType(ie.getBase(), exprPath)
11311134
|
1132-
exprPath.isCons(any(Vec v).getElementTypeParameter(), path)
1133-
or
11341135
exprPath.isCons(any(ArrayTypeParameter tp), path)
11351136
or
11361137
exists(TypePath path0 |

rust/ql/test/library-tests/type-inference/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1856,21 +1856,21 @@ mod indexers {
18561856

18571857
// MyVec::index
18581858
fn index(&self, index: usize) -> &Self::Output {
1859-
&self.data[index] // $ fieldof=MyVec
1859+
&self.data[index] // $ fieldof=MyVec method=index
18601860
}
18611861
}
18621862

18631863
fn analyze_slice(slice: &[S]) {
1864-
let x = slice[0].foo(); // $ method=foo type=x:S
1864+
let x = slice[0].foo(); // $ method=foo type=x:S method=index
18651865
}
18661866

18671867
pub fn f() {
18681868
let mut vec = MyVec::new(); // $ type=vec:T.S
18691869
vec.push(S); // $ method=push
1870-
vec[0].foo(); // $ MISSING: method=foo -- type inference does not support the `Index` trait yet
1870+
vec[0].foo(); // $ method=MyVec::index method=foo
18711871

18721872
let xs: [S; 1] = [S];
1873-
let x = xs[0].foo(); // $ method=foo type=x:S
1873+
let x = xs[0].foo(); // $ method=foo type=x:S method=index
18741874

18751875
analyze_slice(&xs);
18761876
}

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

Lines changed: 5 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,15 @@ inferType
3131
| dereference.rs:36:14:36:42 | MyIntPointer {...} | | dereference.rs:4:1:6:1 | MyIntPointer |
3232
| dereference.rs:36:36:36:40 | 34i64 | | {EXTERNAL LOCATION} | i64 |
3333
| dereference.rs:37:9:37:11 | _b2 | | {EXTERNAL LOCATION} | i64 |
34-
| dereference.rs:37:9:37:11 | _b2 | | file://:0:0:0:0 | & |
35-
| dereference.rs:37:9:37:11 | _b2 | &T | {EXTERNAL LOCATION} | i64 |
3634
| dereference.rs:37:15:37:17 | * ... | | {EXTERNAL LOCATION} | i64 |
37-
| dereference.rs:37:15:37:17 | * ... | | file://:0:0:0:0 | & |
38-
| dereference.rs:37:15:37:17 | * ... | &T | {EXTERNAL LOCATION} | i64 |
3935
| dereference.rs:37:16:37:17 | a2 | | dereference.rs:4:1:6:1 | MyIntPointer |
4036
| dereference.rs:40:9:40:10 | a3 | | dereference.rs:4:1:6:1 | MyIntPointer |
4137
| dereference.rs:40:14:40:42 | MyIntPointer {...} | | dereference.rs:4:1:6:1 | MyIntPointer |
4238
| dereference.rs:40:36:40:40 | 34i64 | | {EXTERNAL LOCATION} | i64 |
4339
| dereference.rs:41:9:41:11 | _b3 | | {EXTERNAL LOCATION} | bool |
4440
| dereference.rs:41:15:41:19 | (...) | | {EXTERNAL LOCATION} | i64 |
45-
| dereference.rs:41:15:41:19 | (...) | | file://:0:0:0:0 | & |
46-
| dereference.rs:41:15:41:19 | (...) | &T | {EXTERNAL LOCATION} | i64 |
4741
| dereference.rs:41:15:41:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool |
4842
| dereference.rs:41:16:41:18 | * ... | | {EXTERNAL LOCATION} | i64 |
49-
| dereference.rs:41:16:41:18 | * ... | | file://:0:0:0:0 | & |
50-
| dereference.rs:41:16:41:18 | * ... | &T | {EXTERNAL LOCATION} | i64 |
5143
| dereference.rs:41:17:41:18 | a3 | | dereference.rs:4:1:6:1 | MyIntPointer |
5244
| dereference.rs:46:9:46:10 | c1 | | dereference.rs:17:1:19:1 | MySmartPointer |
5345
| dereference.rs:46:9:46:10 | c1 | T | {EXTERNAL LOCATION} | char |
@@ -66,11 +58,7 @@ inferType
6658
| dereference.rs:50:14:50:42 | MySmartPointer {...} | T | {EXTERNAL LOCATION} | char |
6759
| dereference.rs:50:38:50:40 | 'a' | | {EXTERNAL LOCATION} | char |
6860
| dereference.rs:51:9:51:11 | _d2 | | {EXTERNAL LOCATION} | char |
69-
| dereference.rs:51:9:51:11 | _d2 | | file://:0:0:0:0 | & |
70-
| dereference.rs:51:9:51:11 | _d2 | &T | {EXTERNAL LOCATION} | char |
7161
| dereference.rs:51:15:51:17 | * ... | | {EXTERNAL LOCATION} | char |
72-
| dereference.rs:51:15:51:17 | * ... | | file://:0:0:0:0 | & |
73-
| dereference.rs:51:15:51:17 | * ... | &T | {EXTERNAL LOCATION} | char |
7462
| dereference.rs:51:16:51:17 | c2 | | dereference.rs:17:1:19:1 | MySmartPointer |
7563
| dereference.rs:51:16:51:17 | c2 | T | {EXTERNAL LOCATION} | char |
7664
| dereference.rs:54:9:54:10 | c3 | | dereference.rs:17:1:19:1 | MySmartPointer |
@@ -80,12 +68,8 @@ inferType
8068
| dereference.rs:54:38:54:42 | 34i64 | | {EXTERNAL LOCATION} | i64 |
8169
| dereference.rs:55:9:55:11 | _d3 | | {EXTERNAL LOCATION} | bool |
8270
| dereference.rs:55:15:55:19 | (...) | | {EXTERNAL LOCATION} | i64 |
83-
| dereference.rs:55:15:55:19 | (...) | | file://:0:0:0:0 | & |
84-
| dereference.rs:55:15:55:19 | (...) | &T | {EXTERNAL LOCATION} | i64 |
8571
| dereference.rs:55:15:55:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool |
8672
| dereference.rs:55:16:55:18 | * ... | | {EXTERNAL LOCATION} | i64 |
87-
| dereference.rs:55:16:55:18 | * ... | | file://:0:0:0:0 | & |
88-
| dereference.rs:55:16:55:18 | * ... | &T | {EXTERNAL LOCATION} | i64 |
8973
| dereference.rs:55:17:55:18 | c3 | | dereference.rs:17:1:19:1 | MySmartPointer |
9074
| dereference.rs:55:17:55:18 | c3 | T | {EXTERNAL LOCATION} | i64 |
9175
| dereference.rs:60:9:60:10 | e1 | | file://:0:0:0:0 | & |
@@ -107,11 +91,7 @@ inferType
10791
| dereference.rs:64:14:64:17 | &'a' | &T | {EXTERNAL LOCATION} | char |
10892
| dereference.rs:64:15:64:17 | 'a' | | {EXTERNAL LOCATION} | char |
10993
| dereference.rs:65:9:65:11 | _f2 | | {EXTERNAL LOCATION} | char |
110-
| dereference.rs:65:9:65:11 | _f2 | | file://:0:0:0:0 | & |
111-
| dereference.rs:65:9:65:11 | _f2 | &T | {EXTERNAL LOCATION} | char |
11294
| dereference.rs:65:15:65:17 | * ... | | {EXTERNAL LOCATION} | char |
113-
| dereference.rs:65:15:65:17 | * ... | | file://:0:0:0:0 | & |
114-
| dereference.rs:65:15:65:17 | * ... | &T | {EXTERNAL LOCATION} | char |
11595
| dereference.rs:65:16:65:17 | e2 | | file://:0:0:0:0 | & |
11696
| dereference.rs:65:16:65:17 | e2 | &T | {EXTERNAL LOCATION} | char |
11797
| dereference.rs:68:9:68:10 | e3 | | file://:0:0:0:0 | & |
@@ -121,12 +101,8 @@ inferType
121101
| dereference.rs:68:15:68:19 | 34i64 | | {EXTERNAL LOCATION} | i64 |
122102
| dereference.rs:69:9:69:11 | _f3 | | {EXTERNAL LOCATION} | bool |
123103
| dereference.rs:69:15:69:19 | (...) | | {EXTERNAL LOCATION} | i64 |
124-
| dereference.rs:69:15:69:19 | (...) | | file://:0:0:0:0 | & |
125-
| dereference.rs:69:15:69:19 | (...) | &T | {EXTERNAL LOCATION} | i64 |
126104
| dereference.rs:69:15:69:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool |
127105
| dereference.rs:69:16:69:18 | * ... | | {EXTERNAL LOCATION} | i64 |
128-
| dereference.rs:69:16:69:18 | * ... | | file://:0:0:0:0 | & |
129-
| dereference.rs:69:16:69:18 | * ... | &T | {EXTERNAL LOCATION} | i64 |
130106
| dereference.rs:69:17:69:18 | e3 | | file://:0:0:0:0 | & |
131107
| dereference.rs:69:17:69:18 | e3 | &T | {EXTERNAL LOCATION} | i64 |
132108
| dereference.rs:74:9:74:10 | g1 | | {EXTERNAL LOCATION} | Box |
@@ -151,11 +127,7 @@ inferType
151127
| dereference.rs:78:25:78:37 | ...::new(...) | T | {EXTERNAL LOCATION} | char |
152128
| dereference.rs:78:34:78:36 | 'a' | | {EXTERNAL LOCATION} | char |
153129
| dereference.rs:79:9:79:11 | _h2 | | {EXTERNAL LOCATION} | char |
154-
| dereference.rs:79:9:79:11 | _h2 | | file://:0:0:0:0 | & |
155-
| dereference.rs:79:9:79:11 | _h2 | &T | {EXTERNAL LOCATION} | char |
156130
| dereference.rs:79:15:79:17 | * ... | | {EXTERNAL LOCATION} | char |
157-
| dereference.rs:79:15:79:17 | * ... | | file://:0:0:0:0 | & |
158-
| dereference.rs:79:15:79:17 | * ... | &T | {EXTERNAL LOCATION} | char |
159131
| dereference.rs:79:16:79:17 | g2 | | {EXTERNAL LOCATION} | Box |
160132
| dereference.rs:79:16:79:17 | g2 | A | {EXTERNAL LOCATION} | Global |
161133
| dereference.rs:79:16:79:17 | g2 | T | {EXTERNAL LOCATION} | char |
@@ -168,12 +140,8 @@ inferType
168140
| dereference.rs:82:33:82:37 | 34i64 | | {EXTERNAL LOCATION} | i64 |
169141
| dereference.rs:83:9:83:11 | _h3 | | {EXTERNAL LOCATION} | bool |
170142
| dereference.rs:83:15:83:19 | (...) | | {EXTERNAL LOCATION} | i64 |
171-
| dereference.rs:83:15:83:19 | (...) | | file://:0:0:0:0 | & |
172-
| dereference.rs:83:15:83:19 | (...) | &T | {EXTERNAL LOCATION} | i64 |
173143
| dereference.rs:83:15:83:33 | ... .is_positive() | | {EXTERNAL LOCATION} | bool |
174144
| dereference.rs:83:16:83:18 | * ... | | {EXTERNAL LOCATION} | i64 |
175-
| dereference.rs:83:16:83:18 | * ... | | file://:0:0:0:0 | & |
176-
| dereference.rs:83:16:83:18 | * ... | &T | {EXTERNAL LOCATION} | i64 |
177145
| dereference.rs:83:17:83:18 | g3 | | {EXTERNAL LOCATION} | Box |
178146
| dereference.rs:83:17:83:18 | g3 | A | {EXTERNAL LOCATION} | Global |
179147
| dereference.rs:83:17:83:18 | g3 | T | {EXTERNAL LOCATION} | i64 |
@@ -2372,41 +2340,25 @@ inferType
23722340
| main.rs:1109:29:1109:33 | SelfParam | &T | main.rs:1082:5:1085:5 | MyInt |
23732341
| main.rs:1109:29:1109:33 | SelfParam | &T.&T | main.rs:1082:5:1085:5 | MyInt |
23742342
| main.rs:1109:43:1111:9 | { ... } | | {EXTERNAL LOCATION} | i64 |
2375-
| main.rs:1110:13:1110:22 | (...) | | file://:0:0:0:0 | & |
23762343
| main.rs:1110:13:1110:22 | (...) | | main.rs:1082:5:1085:5 | MyInt |
2377-
| main.rs:1110:13:1110:22 | (...) | &T | file://:0:0:0:0 | & |
2378-
| main.rs:1110:13:1110:22 | (...) | &T | main.rs:1082:5:1085:5 | MyInt |
2379-
| main.rs:1110:13:1110:22 | (...) | &T.&T | main.rs:1082:5:1085:5 | MyInt |
23802344
| main.rs:1110:13:1110:24 | ... .a | | {EXTERNAL LOCATION} | i64 |
2381-
| main.rs:1110:14:1110:21 | * ... | | file://:0:0:0:0 | & |
23822345
| main.rs:1110:14:1110:21 | * ... | | main.rs:1082:5:1085:5 | MyInt |
2383-
| main.rs:1110:14:1110:21 | * ... | &T | file://:0:0:0:0 | & |
2384-
| main.rs:1110:14:1110:21 | * ... | &T | main.rs:1082:5:1085:5 | MyInt |
2385-
| main.rs:1110:14:1110:21 | * ... | &T.&T | main.rs:1082:5:1085:5 | MyInt |
23862346
| main.rs:1110:15:1110:21 | (...) | | file://:0:0:0:0 | & |
23872347
| main.rs:1110:15:1110:21 | (...) | | main.rs:1082:5:1085:5 | MyInt |
2388-
| main.rs:1110:15:1110:21 | (...) | &T | file://:0:0:0:0 | & |
23892348
| main.rs:1110:15:1110:21 | (...) | &T | main.rs:1082:5:1085:5 | MyInt |
2390-
| main.rs:1110:15:1110:21 | (...) | &T.&T | main.rs:1082:5:1085:5 | MyInt |
23912349
| main.rs:1110:16:1110:20 | * ... | | file://:0:0:0:0 | & |
23922350
| main.rs:1110:16:1110:20 | * ... | | main.rs:1082:5:1085:5 | MyInt |
2393-
| main.rs:1110:16:1110:20 | * ... | &T | file://:0:0:0:0 | & |
23942351
| main.rs:1110:16:1110:20 | * ... | &T | main.rs:1082:5:1085:5 | MyInt |
2395-
| main.rs:1110:16:1110:20 | * ... | &T.&T | main.rs:1082:5:1085:5 | MyInt |
23962352
| main.rs:1110:17:1110:20 | self | | file://:0:0:0:0 | & |
23972353
| main.rs:1110:17:1110:20 | self | &T | file://:0:0:0:0 | & |
23982354
| main.rs:1110:17:1110:20 | self | &T | main.rs:1082:5:1085:5 | MyInt |
23992355
| main.rs:1110:17:1110:20 | self | &T.&T | main.rs:1082:5:1085:5 | MyInt |
24002356
| main.rs:1114:33:1114:36 | SelfParam | | file://:0:0:0:0 | & |
24012357
| main.rs:1114:33:1114:36 | SelfParam | &T | main.rs:1082:5:1085:5 | MyInt |
24022358
| main.rs:1114:46:1116:9 | { ... } | | {EXTERNAL LOCATION} | i64 |
2403-
| main.rs:1115:13:1115:19 | (...) | | file://:0:0:0:0 | & |
24042359
| main.rs:1115:13:1115:19 | (...) | | main.rs:1082:5:1085:5 | MyInt |
2405-
| main.rs:1115:13:1115:19 | (...) | &T | main.rs:1082:5:1085:5 | MyInt |
24062360
| main.rs:1115:13:1115:21 | ... .a | | {EXTERNAL LOCATION} | i64 |
2407-
| main.rs:1115:14:1115:18 | * ... | | file://:0:0:0:0 | & |
24082361
| main.rs:1115:14:1115:18 | * ... | | main.rs:1082:5:1085:5 | MyInt |
2409-
| main.rs:1115:14:1115:18 | * ... | &T | main.rs:1082:5:1085:5 | MyInt |
24102362
| main.rs:1115:15:1115:18 | self | | file://:0:0:0:0 | & |
24112363
| main.rs:1115:15:1115:18 | self | &T | main.rs:1082:5:1085:5 | MyInt |
24122364
| main.rs:1120:13:1120:14 | x1 | | main.rs:1076:5:1077:19 | S |
@@ -2504,16 +2456,10 @@ inferType
25042456
| main.rs:1143:19:1143:23 | S(...) | T | main.rs:1079:5:1080:14 | S2 |
25052457
| main.rs:1143:21:1143:22 | S2 | | main.rs:1079:5:1080:14 | S2 |
25062458
| main.rs:1146:18:1146:23 | "{:?}\\n" | | {EXTERNAL LOCATION} | str |
2507-
| main.rs:1146:26:1146:30 | (...) | | file://:0:0:0:0 | & |
25082459
| main.rs:1146:26:1146:30 | (...) | | main.rs:1076:5:1077:19 | S |
2509-
| main.rs:1146:26:1146:30 | (...) | &T | main.rs:1076:5:1077:19 | S |
2510-
| main.rs:1146:26:1146:30 | (...) | &T.T | main.rs:1079:5:1080:14 | S2 |
25112460
| main.rs:1146:26:1146:30 | (...) | T | main.rs:1079:5:1080:14 | S2 |
25122461
| main.rs:1146:26:1146:35 | ... .m1() | | main.rs:1079:5:1080:14 | S2 |
2513-
| main.rs:1146:27:1146:29 | * ... | | file://:0:0:0:0 | & |
25142462
| main.rs:1146:27:1146:29 | * ... | | main.rs:1076:5:1077:19 | S |
2515-
| main.rs:1146:27:1146:29 | * ... | &T | main.rs:1076:5:1077:19 | S |
2516-
| main.rs:1146:27:1146:29 | * ... | &T.T | main.rs:1079:5:1080:14 | S2 |
25172463
| main.rs:1146:27:1146:29 | * ... | T | main.rs:1079:5:1080:14 | S2 |
25182464
| main.rs:1146:28:1146:29 | x6 | | file://:0:0:0:0 | & |
25192465
| main.rs:1146:28:1146:29 | x6 | &T | main.rs:1076:5:1077:19 | S |
@@ -2739,20 +2685,10 @@ inferType
27392685
| main.rs:1251:15:1251:16 | &x | &T | main.rs:1227:5:1227:13 | S |
27402686
| main.rs:1251:16:1251:16 | x | | main.rs:1227:5:1227:13 | S |
27412687
| main.rs:1253:13:1253:13 | n | | {EXTERNAL LOCATION} | bool |
2742-
| main.rs:1253:13:1253:13 | n | | file://:0:0:0:0 | & |
2743-
| main.rs:1253:13:1253:13 | n | &T | {EXTERNAL LOCATION} | bool |
2744-
| main.rs:1253:13:1253:13 | n | &T | file://:0:0:0:0 | & |
2745-
| main.rs:1253:13:1253:13 | n | &T.&T | {EXTERNAL LOCATION} | bool |
27462688
| main.rs:1253:17:1253:24 | * ... | | {EXTERNAL LOCATION} | bool |
2747-
| main.rs:1253:17:1253:24 | * ... | | file://:0:0:0:0 | & |
2748-
| main.rs:1253:17:1253:24 | * ... | &T | {EXTERNAL LOCATION} | bool |
2749-
| main.rs:1253:17:1253:24 | * ... | &T | file://:0:0:0:0 | & |
2750-
| main.rs:1253:17:1253:24 | * ... | &T.&T | {EXTERNAL LOCATION} | bool |
27512689
| main.rs:1253:18:1253:24 | * ... | | {EXTERNAL LOCATION} | bool |
27522690
| main.rs:1253:18:1253:24 | * ... | | file://:0:0:0:0 | & |
27532691
| main.rs:1253:18:1253:24 | * ... | &T | {EXTERNAL LOCATION} | bool |
2754-
| main.rs:1253:18:1253:24 | * ... | &T | file://:0:0:0:0 | & |
2755-
| main.rs:1253:18:1253:24 | * ... | &T.&T | {EXTERNAL LOCATION} | bool |
27562692
| main.rs:1253:19:1253:24 | &... | | file://:0:0:0:0 | & |
27572693
| main.rs:1253:19:1253:24 | &... | &T | {EXTERNAL LOCATION} | bool |
27582694
| main.rs:1253:19:1253:24 | &... | &T | file://:0:0:0:0 | & |
@@ -3863,10 +3799,12 @@ inferType
38633799
| main.rs:1859:14:1859:29 | ...[index] | | main.rs:1854:10:1854:10 | T |
38643800
| main.rs:1859:24:1859:28 | index | | {EXTERNAL LOCATION} | usize |
38653801
| main.rs:1863:22:1863:26 | slice | | file://:0:0:0:0 | & |
3802+
| main.rs:1863:22:1863:26 | slice | | file://:0:0:0:0 | [] |
38663803
| main.rs:1863:22:1863:26 | slice | &T | file://:0:0:0:0 | [] |
38673804
| main.rs:1863:22:1863:26 | slice | &T.[T] | main.rs:1830:5:1831:13 | S |
38683805
| main.rs:1864:13:1864:13 | x | | main.rs:1830:5:1831:13 | S |
38693806
| main.rs:1864:17:1864:21 | slice | | file://:0:0:0:0 | & |
3807+
| main.rs:1864:17:1864:21 | slice | | file://:0:0:0:0 | [] |
38703808
| main.rs:1864:17:1864:21 | slice | &T | file://:0:0:0:0 | [] |
38713809
| main.rs:1864:17:1864:21 | slice | &T.[T] | main.rs:1830:5:1831:13 | S |
38723810
| main.rs:1864:17:1864:24 | slice[0] | | main.rs:1830:5:1831:13 | S |
@@ -3881,7 +3819,10 @@ inferType
38813819
| main.rs:1869:18:1869:18 | S | | main.rs:1830:5:1831:13 | S |
38823820
| main.rs:1870:9:1870:11 | vec | | main.rs:1839:5:1842:5 | MyVec |
38833821
| main.rs:1870:9:1870:11 | vec | T | main.rs:1830:5:1831:13 | S |
3822+
| main.rs:1870:9:1870:14 | vec[0] | | main.rs:1830:5:1831:13 | S |
3823+
| main.rs:1870:9:1870:20 | ... .foo() | | main.rs:1830:5:1831:13 | S |
38843824
| main.rs:1870:13:1870:13 | 0 | | {EXTERNAL LOCATION} | i32 |
3825+
| main.rs:1870:13:1870:13 | 0 | | {EXTERNAL LOCATION} | usize |
38853826
| main.rs:1872:13:1872:14 | xs | | file://:0:0:0:0 | [] |
38863827
| main.rs:1872:13:1872:14 | xs | | file://:0:0:0:0 | [] |
38873828
| main.rs:1872:13:1872:14 | xs | [T;...] | main.rs:1830:5:1831:13 | S |
@@ -3926,11 +3867,7 @@ inferType
39263867
| main.rs:1899:26:1899:30 | value | | file://:0:0:0:0 | & |
39273868
| main.rs:1899:26:1899:30 | value | &T | {EXTERNAL LOCATION} | i64 |
39283869
| main.rs:1899:47:1901:9 | { ... } | | {EXTERNAL LOCATION} | i64 |
3929-
| main.rs:1899:47:1901:9 | { ... } | | file://:0:0:0:0 | & |
3930-
| main.rs:1899:47:1901:9 | { ... } | &T | {EXTERNAL LOCATION} | i64 |
39313870
| main.rs:1900:13:1900:18 | * ... | | {EXTERNAL LOCATION} | i64 |
3932-
| main.rs:1900:13:1900:18 | * ... | | file://:0:0:0:0 | & |
3933-
| main.rs:1900:13:1900:18 | * ... | &T | {EXTERNAL LOCATION} | i64 |
39343871
| main.rs:1900:14:1900:18 | value | | file://:0:0:0:0 | & |
39353872
| main.rs:1900:14:1900:18 | value | &T | {EXTERNAL LOCATION} | i64 |
39363873
| main.rs:1906:19:1906:23 | SelfParam | | file://:0:0:0:0 | & |

0 commit comments

Comments
 (0)