Rust: Improvements to tuple type inference based on PR feedback

This commit is contained in:
Simon Friis Vindum
2025-07-16 09:38:29 +02:00
parent 8858f213ff
commit a508089df8
8 changed files with 189 additions and 128 deletions

View File

@@ -417,7 +417,6 @@ lib/codeql/rust/elements/internal/TupleFieldConstructor.qll 89d3cf2540235044ed5a
lib/codeql/rust/elements/internal/TupleFieldListConstructor.qll 4335ba2061b6e4968db9ec05c0b4d3e6a564db89a2df69e036f317672a7900b1 0b8dded875dbf696cf588e8c21acc27332a2ff66ced7bfabdfc1ad621991f888
lib/codeql/rust/elements/internal/TupleFieldListImpl.qll 74869e92a3cbdd7895adaaa418d29d5e97387daf46c17315f219ad967af15d76 5815e4b37db958663df1f6fedc9667a11b261c9c2133e3f983a3aedc452c01fc
lib/codeql/rust/elements/internal/TuplePatConstructor.qll 2a5e83ad5b8713a732e610128aeddf14e9b344402d6cf30ff0b43aa39e838418 6d467f7141307523994f03ed7b8e8b1a5bcf860963c9934b90e54582ea38096a
lib/codeql/rust/elements/internal/TuplePatImpl.qll 4adb38f0f8dae4ff285b9f5843efb92af419719a7549e0ff62dc56969bd3c852 3f622130771d7731ed053175a83b289bab1d1f5931526c4854923dbcec7e43f1
lib/codeql/rust/elements/internal/TupleStructPatConstructor.qll 9d68f67a17a5cec0e78907a53eccfa7696be5b0571da4b486c8184274e56344a 3ffa29f546cd6c644be4fecc7415477a3a4dc00d69b8764be9119abe4c6d8b9e
lib/codeql/rust/elements/internal/TupleTypeReprConstructor.qll 80c31c25fd27e330690fb500d757a4bbd33f226186d88ea73bfe4cf29a7db508 d572a72fa361990a3d0a3f9b81d1e966e2ba1ac0a60314ec824c1b8b2814c857
lib/codeql/rust/elements/internal/TupleTypeReprImpl.qll daf679e3cac0eaf1c20880b49b22bbe0822a27cc6ab2c241916b4bf6da995586 ebd87d7fce7d8acd7fa37c4107f8210e60412dd418104bd9fdbdbcde13c8b6a7

1
rust/ql/.gitattributes generated vendored
View File

@@ -419,7 +419,6 @@
/lib/codeql/rust/elements/internal/TupleFieldListConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/TupleFieldListImpl.qll linguist-generated
/lib/codeql/rust/elements/internal/TuplePatConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/TuplePatImpl.qll linguist-generated
/lib/codeql/rust/elements/internal/TupleStructPatConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/TupleTypeReprConstructor.qll linguist-generated
/lib/codeql/rust/elements/internal/TupleTypeReprImpl.qll linguist-generated

View File

@@ -1,4 +1,3 @@
// generated by codegen, remove this comment if you wish to edit this file
/**
* This module provides a hand-modifiable wrapper around the generated class `TuplePat`.
*
@@ -12,6 +11,9 @@ private import codeql.rust.elements.internal.generated.TuplePat
* be referenced directly.
*/
module Impl {
private import rust
// the following QLdoc is generated: if you need to edit it, do it in the schema file
/**
* A tuple pattern. For example:
* ```rust
@@ -19,5 +21,15 @@ module Impl {
* let (a, b, .., z) = (1, 2, 3, 4, 5);
* ```
*/
class TuplePat extends Generated::TuplePat { }
class TuplePat extends Generated::TuplePat {
/**
* Gets the arity of the tuple matched by this pattern, if any.
*
* This is the number of fields in the tuple pattern if and only if the
* pattern does not contain a `..` pattern.
*/
int getTupleArity() {
result = this.getNumberOfFields() and not this.getAField() instanceof RestPat
}
}
}

View File

@@ -10,7 +10,12 @@ private import codeql.rust.elements.internal.generated.Synth
cached
newtype TType =
TTuple(int arity) {
arity = any(TupleTypeRepr t).getNumberOfFields() and
arity =
[
any(TupleTypeRepr t).getNumberOfFields(),
any(TupleExpr e).getNumberOfFields(),
any(TuplePat p).getNumberOfFields()
] and
Stages::TypeInferenceStage::ref()
} or
TStruct(Struct s) or
@@ -59,26 +64,11 @@ abstract class Type extends TType {
abstract Location getLocation();
}
/** The unit type `()`. */
class UnitType extends Type, TTuple {
UnitType() { this = TTuple(0) }
override StructField getStructField(string name) { none() }
override TupleField getTupleField(int i) { none() }
override TypeParameter getTypeParameter(int i) { none() }
override string toString() { result = "()" }
override Location getLocation() { result instanceof EmptyLocation }
}
/** A tuple type `(T, ...)`. */
class TupleType extends Type, TTuple {
private int arity;
TupleType() { this = TTuple(arity) and arity > 0 }
TupleType() { this = TTuple(arity) }
override StructField getStructField(string name) { none() }
@@ -86,6 +76,7 @@ class TupleType extends Type, TTuple {
override TypeParameter getTypeParameter(int i) { result = TTupleTypeParameter(arity, i) }
/** Gets the arity of this tuple type. */
int getArity() { result = arity }
override string toString() { result = "(T_" + arity + ")" }
@@ -93,6 +84,13 @@ class TupleType extends Type, TTuple {
override Location getLocation() { result instanceof EmptyLocation }
}
/** The unit type `()`. */
class UnitType extends TupleType, TTuple {
UnitType() { this = TTuple(0) }
override string toString() { result = "()" }
}
abstract private class StructOrEnumType extends Type {
abstract ItemNode asItemNode();
}
@@ -355,8 +353,9 @@ class AssociatedTypeTypeParameter extends TypeParameter, TAssociatedTypeTypePara
/**
* A tuple type parameter. For instance the `T` in `(T, U)`.
*
* Since tuples are structural their parameters can be represented simply as
* their positional index.
* Since tuples are structural their type parameters can be represented as their
* positional index. The type inference library requires that type parameters
* belong to a single type, so we also include the arity of the tuple type.
*/
class TupleTypeParameter extends TypeParameter, TTupleTypeParameter {
private int arity;
@@ -371,8 +370,8 @@ class TupleTypeParameter extends TypeParameter, TTupleTypeParameter {
/** Gets the index of this tuple type parameter. */
int getIndex() { result = index }
/** Gets the arity of this tuple type parameter. */
int getArity() { result = arity }
/** Gets the tuple type that corresponds to this tuple type parameter. */
TupleType getTupleType() { result = TTuple(arity) }
}
/** An implicit array type parameter. */

View File

@@ -108,7 +108,7 @@ private module Input1 implements InputSig1<Location> {
maxArity = max(int i | i = any(TupleType tt).getArity()) and
tp0 = ttp and
kind = 2 and
id = ttp.getArity() * maxArity + ttp.getIndex()
id = ttp.getTupleType().getArity() * maxArity + ttp.getIndex()
)
|
tp0 order by kind, id
@@ -335,7 +335,7 @@ private predicate typeEquality(AstNode n1, TypePath prefix1, AstNode n2, TypePat
arity = n2.(TupleExpr).getNumberOfFields() and
n1 = n2.(TupleExpr).getField(i)
or
arity = n2.(TuplePat).getNumberOfFields() and
arity = n2.(TuplePat).getTupleArity() and
n1 = n2.(TuplePat).getField(i)
)
or
@@ -553,9 +553,9 @@ private Type inferStructExprType(AstNode n, TypePath path) {
}
pragma[nomagic]
private Type inferTupleExprRootType(TupleExpr te) {
// `typeEquality` handles the non-root case
result = TTuple(te.getNumberOfFields())
private Type inferTupleRootType(AstNode n) {
// `typeEquality` handles the non-root cases
result = TTuple([n.(TupleExpr).getNumberOfFields(), n.(TuplePat).getTupleArity()])
}
pragma[nomagic]
@@ -1091,16 +1091,27 @@ private Type inferTupleIndexExprType(FieldExpr fe, TypePath path) {
/** Infers the type of `t` in `t.n` when `t` is a tuple. */
private Type inferTupleContainerExprType(Expr e, TypePath path) {
// NOTE: For a field expression `t.n` where `n` is a number `t` might both be
// a tuple struct or a tuple. It is only correct to let type information flow
// from `t.n` to tuple type parameters of `t` in the latter case. Hence we
// include the condition that the root type of `t` must be a tuple type.
// NOTE: For a field expression `t.n` where `n` is a number `t` might be a
// tuple as in:
// ```rust
// let t = (Default::default(), 2);
// let s: String = t.0;
// ```
// But it could also be a tuple struct as in:
// ```rust
// struct T(String, u32);
// let t = T(Default::default(), 2);
// let s: String = t.0;
// ```
// We need type information to flow from `t.n` to tuple type parameters of `t`
// in the former case but not the latter case. Hence we include the condition
// that the root type of `t` must be a tuple type.
exists(int i, TypePath path0, FieldExpr fe, int arity |
e = fe.getContainer() and
fe.getIdentifier().getText() = i.toString() and
arity = inferType(fe.getContainer()).(TupleType).getArity() and
result = inferType(fe, path0) and
path = TypePath::cons(TTupleTypeParameter(arity, i), path0) // FIXME:
path = TypePath::cons(TTupleTypeParameter(arity, i), path0)
)
}
@@ -1992,7 +2003,7 @@ private module Cached {
or
result = inferStructExprType(n, path)
or
result = inferTupleExprRootType(n) and
result = inferTupleRootType(n) and
path.isEmpty()
or
result = inferPathExprType(n, path)

View File

@@ -2357,6 +2357,13 @@ mod tuples {
let pair = (a, b); // $ type=pair:0(2).i64 type=pair:1(2).bool
let i: i64 = pair.0;
let j: bool = pair.1;
let pair = [1, 1].into(); // $ type=pair:0(2).i32 MISSING: target=into
match pair {
(0,0) => print!("unexpected"),
_ => print!("expected"),
}
let x = pair.0; // $ type=x:i32
}
}

View File

@@ -704,7 +704,7 @@ pub fn complex_nested_patterns() {
}
// Catch-all with identifier pattern
other => {
let other_complex = other; // $ MISSING: type=other_complex:?
let other_complex = other; // $ type=other_complex:0(2).Point type=other_complex:1(2).MyOption
println!("Other complex data: {:?}", other_complex);
}
}
@@ -766,7 +766,7 @@ pub fn patterns_in_function_parameters() {
// Call the functions to use them
let point = Point { x: 5, y: 10 };
let extracted = extract_point(point); // $ target=extract_point MISSING: type=extracted:?
let extracted = extract_point(point); // $ target=extract_point type=extracted:0(2).i32 type=extracted:1(2).i32
let color = Color(200, 100, 50);
let red = extract_color(color); // $ target=extract_color type=red:u8

View File

@@ -4172,96 +4172,130 @@ inferType
| main.rs:2359:23:2359:26 | pair | 0(2) | {EXTERNAL LOCATION} | i64 |
| main.rs:2359:23:2359:26 | pair | 1(2) | {EXTERNAL LOCATION} | bool |
| main.rs:2359:23:2359:28 | pair.1 | | {EXTERNAL LOCATION} | bool |
| main.rs:2366:13:2366:23 | boxed_value | | {EXTERNAL LOCATION} | Box |
| main.rs:2366:13:2366:23 | boxed_value | A | {EXTERNAL LOCATION} | Global |
| main.rs:2366:13:2366:23 | boxed_value | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2366:27:2366:42 | ...::new(...) | | {EXTERNAL LOCATION} | Box |
| main.rs:2366:27:2366:42 | ...::new(...) | A | {EXTERNAL LOCATION} | Global |
| main.rs:2366:27:2366:42 | ...::new(...) | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2366:36:2366:41 | 100i32 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2369:15:2369:25 | boxed_value | | {EXTERNAL LOCATION} | Box |
| main.rs:2369:15:2369:25 | boxed_value | A | {EXTERNAL LOCATION} | Global |
| main.rs:2369:15:2369:25 | boxed_value | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2370:13:2370:19 | box 100 | | {EXTERNAL LOCATION} | Box |
| main.rs:2370:13:2370:19 | box 100 | A | {EXTERNAL LOCATION} | Global |
| main.rs:2370:13:2370:19 | box 100 | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2370:17:2370:19 | 100 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2371:26:2371:36 | "Boxed 100\\n" | | file://:0:0:0:0 | & |
| main.rs:2371:26:2371:36 | "Boxed 100\\n" | &T | {EXTERNAL LOCATION} | str |
| main.rs:2371:26:2371:36 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2371:26:2371:36 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2373:13:2373:17 | box ... | | {EXTERNAL LOCATION} | Box |
| main.rs:2373:13:2373:17 | box ... | A | {EXTERNAL LOCATION} | Global |
| main.rs:2373:13:2373:17 | box ... | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2375:26:2375:42 | "Boxed value: {}\\n" | | file://:0:0:0:0 | & |
| main.rs:2375:26:2375:42 | "Boxed value: {}\\n" | &T | {EXTERNAL LOCATION} | str |
| main.rs:2375:26:2375:51 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2375:26:2375:51 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2380:13:2380:22 | nested_box | | {EXTERNAL LOCATION} | Box |
| main.rs:2380:13:2380:22 | nested_box | A | {EXTERNAL LOCATION} | Global |
| main.rs:2380:13:2380:22 | nested_box | T | {EXTERNAL LOCATION} | Box |
| main.rs:2380:13:2380:22 | nested_box | T.A | {EXTERNAL LOCATION} | Global |
| main.rs:2380:13:2380:22 | nested_box | T.T | {EXTERNAL LOCATION} | i32 |
| main.rs:2380:26:2380:50 | ...::new(...) | | {EXTERNAL LOCATION} | Box |
| main.rs:2380:26:2380:50 | ...::new(...) | A | {EXTERNAL LOCATION} | Global |
| main.rs:2380:26:2380:50 | ...::new(...) | T | {EXTERNAL LOCATION} | Box |
| main.rs:2380:26:2380:50 | ...::new(...) | T.A | {EXTERNAL LOCATION} | Global |
| main.rs:2380:26:2380:50 | ...::new(...) | T.T | {EXTERNAL LOCATION} | i32 |
| main.rs:2380:35:2380:49 | ...::new(...) | | {EXTERNAL LOCATION} | Box |
| main.rs:2380:35:2380:49 | ...::new(...) | A | {EXTERNAL LOCATION} | Global |
| main.rs:2380:35:2380:49 | ...::new(...) | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2380:44:2380:48 | 42i32 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2381:15:2381:24 | nested_box | | {EXTERNAL LOCATION} | Box |
| main.rs:2381:15:2381:24 | nested_box | A | {EXTERNAL LOCATION} | Global |
| main.rs:2381:15:2381:24 | nested_box | T | {EXTERNAL LOCATION} | Box |
| main.rs:2381:15:2381:24 | nested_box | T.A | {EXTERNAL LOCATION} | Global |
| main.rs:2381:15:2381:24 | nested_box | T.T | {EXTERNAL LOCATION} | i32 |
| main.rs:2382:13:2382:21 | box ... | | {EXTERNAL LOCATION} | Box |
| main.rs:2382:13:2382:21 | box ... | A | {EXTERNAL LOCATION} | Global |
| main.rs:2382:13:2382:21 | box ... | T | {EXTERNAL LOCATION} | Box |
| main.rs:2382:13:2382:21 | box ... | T.A | {EXTERNAL LOCATION} | Global |
| main.rs:2382:13:2382:21 | box ... | T.T | {EXTERNAL LOCATION} | i32 |
| main.rs:2384:26:2384:43 | "Nested boxed: {}\\n" | | file://:0:0:0:0 | & |
| main.rs:2384:26:2384:43 | "Nested boxed: {}\\n" | &T | {EXTERNAL LOCATION} | str |
| main.rs:2384:26:2384:59 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2384:26:2384:59 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2396:16:2396:20 | SelfParam | | file://:0:0:0:0 | & |
| main.rs:2396:16:2396:20 | SelfParam | &T | main.rs:2391:5:2393:5 | Row |
| main.rs:2396:30:2398:9 | { ... } | | {EXTERNAL LOCATION} | i64 |
| main.rs:2397:13:2397:16 | self | | file://:0:0:0:0 | & |
| main.rs:2397:13:2397:16 | self | &T | main.rs:2391:5:2393:5 | Row |
| main.rs:2397:13:2397:21 | self.data | | {EXTERNAL LOCATION} | i64 |
| main.rs:2406:26:2408:9 | { ... } | | main.rs:2401:5:2403:5 | Table |
| main.rs:2407:13:2407:38 | Table {...} | | main.rs:2401:5:2403:5 | Table |
| main.rs:2407:27:2407:36 | ...::new(...) | | {EXTERNAL LOCATION} | Vec |
| main.rs:2407:27:2407:36 | ...::new(...) | A | {EXTERNAL LOCATION} | Global |
| main.rs:2407:27:2407:36 | ...::new(...) | T | main.rs:2391:5:2393:5 | Row |
| main.rs:2410:23:2410:27 | SelfParam | | file://:0:0:0:0 | & |
| main.rs:2410:23:2410:27 | SelfParam | &T | main.rs:2401:5:2403:5 | Table |
| main.rs:2410:30:2410:37 | property | | main.rs:2410:40:2410:59 | ImplTraitTypeRepr |
| main.rs:2410:69:2412:9 | { ... } | | {EXTERNAL LOCATION} | i32 |
| main.rs:2410:69:2412:9 | { ... } | | {EXTERNAL LOCATION} | i64 |
| main.rs:2411:13:2411:13 | 0 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2411:13:2411:13 | 0 | | {EXTERNAL LOCATION} | i64 |
| main.rs:2416:9:2416:15 | Some(...) | | {EXTERNAL LOCATION} | Option |
| main.rs:2416:9:2416:15 | Some(...) | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2416:9:2419:10 | ... .map(...) | | {EXTERNAL LOCATION} | Option |
| main.rs:2416:14:2416:14 | 1 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2418:22:2418:26 | "{x}\\n" | | file://:0:0:0:0 | & |
| main.rs:2418:22:2418:26 | "{x}\\n" | &T | {EXTERNAL LOCATION} | str |
| main.rs:2418:22:2418:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2418:22:2418:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2421:13:2421:17 | table | | main.rs:2401:5:2403:5 | Table |
| main.rs:2421:21:2421:32 | ...::new(...) | | main.rs:2401:5:2403:5 | Table |
| main.rs:2422:13:2422:18 | result | | {EXTERNAL LOCATION} | i64 |
| main.rs:2422:22:2422:26 | table | | main.rs:2401:5:2403:5 | Table |
| main.rs:2422:22:2426:14 | table.count_with(...) | | {EXTERNAL LOCATION} | i64 |
| main.rs:2425:21:2425:21 | 0 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2432:5:2432:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo |
| main.rs:2433:5:2433:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo |
| main.rs:2433:20:2433:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
| main.rs:2433:41:2433:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
| main.rs:2449:5:2449:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future |
| main.rs:2361:13:2361:16 | pair | | file://:0:0:0:0 | (T_2) |
| main.rs:2361:13:2361:16 | pair | 0(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2361:13:2361:16 | pair | 1(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2361:20:2361:25 | [...] | | file://:0:0:0:0 | [] |
| main.rs:2361:20:2361:25 | [...] | [T;...] | {EXTERNAL LOCATION} | i32 |
| main.rs:2361:20:2361:32 | ... .into() | | file://:0:0:0:0 | (T_2) |
| main.rs:2361:20:2361:32 | ... .into() | 0(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2361:20:2361:32 | ... .into() | 1(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2361:21:2361:21 | 1 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2361:24:2361:24 | 1 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2362:15:2362:18 | pair | | file://:0:0:0:0 | (T_2) |
| main.rs:2362:15:2362:18 | pair | 0(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2362:15:2362:18 | pair | 1(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2363:13:2363:17 | TuplePat | | file://:0:0:0:0 | (T_2) |
| main.rs:2363:13:2363:17 | TuplePat | 0(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2363:13:2363:17 | TuplePat | 1(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2363:14:2363:14 | 0 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2363:16:2363:16 | 0 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2363:29:2363:40 | "unexpected" | | file://:0:0:0:0 | & |
| main.rs:2363:29:2363:40 | "unexpected" | &T | {EXTERNAL LOCATION} | str |
| main.rs:2363:29:2363:40 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2363:29:2363:40 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2364:13:2364:13 | _ | | file://:0:0:0:0 | (T_2) |
| main.rs:2364:13:2364:13 | _ | 0(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2364:13:2364:13 | _ | 1(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2364:25:2364:34 | "expected" | | file://:0:0:0:0 | & |
| main.rs:2364:25:2364:34 | "expected" | &T | {EXTERNAL LOCATION} | str |
| main.rs:2364:25:2364:34 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2364:25:2364:34 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2366:13:2366:13 | x | | {EXTERNAL LOCATION} | i32 |
| main.rs:2366:17:2366:20 | pair | | file://:0:0:0:0 | (T_2) |
| main.rs:2366:17:2366:20 | pair | 0(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2366:17:2366:20 | pair | 1(2) | {EXTERNAL LOCATION} | i32 |
| main.rs:2366:17:2366:22 | pair.0 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2373:13:2373:23 | boxed_value | | {EXTERNAL LOCATION} | Box |
| main.rs:2373:13:2373:23 | boxed_value | A | {EXTERNAL LOCATION} | Global |
| main.rs:2373:13:2373:23 | boxed_value | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2373:27:2373:42 | ...::new(...) | | {EXTERNAL LOCATION} | Box |
| main.rs:2373:27:2373:42 | ...::new(...) | A | {EXTERNAL LOCATION} | Global |
| main.rs:2373:27:2373:42 | ...::new(...) | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2373:36:2373:41 | 100i32 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2376:15:2376:25 | boxed_value | | {EXTERNAL LOCATION} | Box |
| main.rs:2376:15:2376:25 | boxed_value | A | {EXTERNAL LOCATION} | Global |
| main.rs:2376:15:2376:25 | boxed_value | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2377:13:2377:19 | box 100 | | {EXTERNAL LOCATION} | Box |
| main.rs:2377:13:2377:19 | box 100 | A | {EXTERNAL LOCATION} | Global |
| main.rs:2377:13:2377:19 | box 100 | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2377:17:2377:19 | 100 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2378:26:2378:36 | "Boxed 100\\n" | | file://:0:0:0:0 | & |
| main.rs:2378:26:2378:36 | "Boxed 100\\n" | &T | {EXTERNAL LOCATION} | str |
| main.rs:2378:26:2378:36 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2378:26:2378:36 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2380:13:2380:17 | box ... | | {EXTERNAL LOCATION} | Box |
| main.rs:2380:13:2380:17 | box ... | A | {EXTERNAL LOCATION} | Global |
| main.rs:2380:13:2380:17 | box ... | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2382:26:2382:42 | "Boxed value: {}\\n" | | file://:0:0:0:0 | & |
| main.rs:2382:26:2382:42 | "Boxed value: {}\\n" | &T | {EXTERNAL LOCATION} | str |
| main.rs:2382:26:2382:51 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2382:26:2382:51 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2387:13:2387:22 | nested_box | | {EXTERNAL LOCATION} | Box |
| main.rs:2387:13:2387:22 | nested_box | A | {EXTERNAL LOCATION} | Global |
| main.rs:2387:13:2387:22 | nested_box | T | {EXTERNAL LOCATION} | Box |
| main.rs:2387:13:2387:22 | nested_box | T.A | {EXTERNAL LOCATION} | Global |
| main.rs:2387:13:2387:22 | nested_box | T.T | {EXTERNAL LOCATION} | i32 |
| main.rs:2387:26:2387:50 | ...::new(...) | | {EXTERNAL LOCATION} | Box |
| main.rs:2387:26:2387:50 | ...::new(...) | A | {EXTERNAL LOCATION} | Global |
| main.rs:2387:26:2387:50 | ...::new(...) | T | {EXTERNAL LOCATION} | Box |
| main.rs:2387:26:2387:50 | ...::new(...) | T.A | {EXTERNAL LOCATION} | Global |
| main.rs:2387:26:2387:50 | ...::new(...) | T.T | {EXTERNAL LOCATION} | i32 |
| main.rs:2387:35:2387:49 | ...::new(...) | | {EXTERNAL LOCATION} | Box |
| main.rs:2387:35:2387:49 | ...::new(...) | A | {EXTERNAL LOCATION} | Global |
| main.rs:2387:35:2387:49 | ...::new(...) | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2387:44:2387:48 | 42i32 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2388:15:2388:24 | nested_box | | {EXTERNAL LOCATION} | Box |
| main.rs:2388:15:2388:24 | nested_box | A | {EXTERNAL LOCATION} | Global |
| main.rs:2388:15:2388:24 | nested_box | T | {EXTERNAL LOCATION} | Box |
| main.rs:2388:15:2388:24 | nested_box | T.A | {EXTERNAL LOCATION} | Global |
| main.rs:2388:15:2388:24 | nested_box | T.T | {EXTERNAL LOCATION} | i32 |
| main.rs:2389:13:2389:21 | box ... | | {EXTERNAL LOCATION} | Box |
| main.rs:2389:13:2389:21 | box ... | A | {EXTERNAL LOCATION} | Global |
| main.rs:2389:13:2389:21 | box ... | T | {EXTERNAL LOCATION} | Box |
| main.rs:2389:13:2389:21 | box ... | T.A | {EXTERNAL LOCATION} | Global |
| main.rs:2389:13:2389:21 | box ... | T.T | {EXTERNAL LOCATION} | i32 |
| main.rs:2391:26:2391:43 | "Nested boxed: {}\\n" | | file://:0:0:0:0 | & |
| main.rs:2391:26:2391:43 | "Nested boxed: {}\\n" | &T | {EXTERNAL LOCATION} | str |
| main.rs:2391:26:2391:59 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2391:26:2391:59 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2403:16:2403:20 | SelfParam | | file://:0:0:0:0 | & |
| main.rs:2403:16:2403:20 | SelfParam | &T | main.rs:2398:5:2400:5 | Row |
| main.rs:2403:30:2405:9 | { ... } | | {EXTERNAL LOCATION} | i64 |
| main.rs:2404:13:2404:16 | self | | file://:0:0:0:0 | & |
| main.rs:2404:13:2404:16 | self | &T | main.rs:2398:5:2400:5 | Row |
| main.rs:2404:13:2404:21 | self.data | | {EXTERNAL LOCATION} | i64 |
| main.rs:2413:26:2415:9 | { ... } | | main.rs:2408:5:2410:5 | Table |
| main.rs:2414:13:2414:38 | Table {...} | | main.rs:2408:5:2410:5 | Table |
| main.rs:2414:27:2414:36 | ...::new(...) | | {EXTERNAL LOCATION} | Vec |
| main.rs:2414:27:2414:36 | ...::new(...) | A | {EXTERNAL LOCATION} | Global |
| main.rs:2414:27:2414:36 | ...::new(...) | T | main.rs:2398:5:2400:5 | Row |
| main.rs:2417:23:2417:27 | SelfParam | | file://:0:0:0:0 | & |
| main.rs:2417:23:2417:27 | SelfParam | &T | main.rs:2408:5:2410:5 | Table |
| main.rs:2417:30:2417:37 | property | | main.rs:2417:40:2417:59 | ImplTraitTypeRepr |
| main.rs:2417:69:2419:9 | { ... } | | {EXTERNAL LOCATION} | i32 |
| main.rs:2417:69:2419:9 | { ... } | | {EXTERNAL LOCATION} | i64 |
| main.rs:2418:13:2418:13 | 0 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2418:13:2418:13 | 0 | | {EXTERNAL LOCATION} | i64 |
| main.rs:2423:9:2423:15 | Some(...) | | {EXTERNAL LOCATION} | Option |
| main.rs:2423:9:2423:15 | Some(...) | T | {EXTERNAL LOCATION} | i32 |
| main.rs:2423:9:2426:10 | ... .map(...) | | {EXTERNAL LOCATION} | Option |
| main.rs:2423:14:2423:14 | 1 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2425:22:2425:26 | "{x}\\n" | | file://:0:0:0:0 | & |
| main.rs:2425:22:2425:26 | "{x}\\n" | &T | {EXTERNAL LOCATION} | str |
| main.rs:2425:22:2425:26 | FormatArgsExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2425:22:2425:26 | MacroExpr | | {EXTERNAL LOCATION} | Arguments |
| main.rs:2428:13:2428:17 | table | | main.rs:2408:5:2410:5 | Table |
| main.rs:2428:21:2428:32 | ...::new(...) | | main.rs:2408:5:2410:5 | Table |
| main.rs:2429:13:2429:18 | result | | {EXTERNAL LOCATION} | i64 |
| main.rs:2429:22:2429:26 | table | | main.rs:2408:5:2410:5 | Table |
| main.rs:2429:22:2433:14 | table.count_with(...) | | {EXTERNAL LOCATION} | i64 |
| main.rs:2432:21:2432:21 | 0 | | {EXTERNAL LOCATION} | i32 |
| main.rs:2439:5:2439:20 | ...::f(...) | | main.rs:72:5:72:21 | Foo |
| main.rs:2440:5:2440:60 | ...::g(...) | | main.rs:72:5:72:21 | Foo |
| main.rs:2440:20:2440:38 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
| main.rs:2440:41:2440:59 | ...::Foo {...} | | main.rs:72:5:72:21 | Foo |
| main.rs:2456:5:2456:15 | ...::f(...) | | {EXTERNAL LOCATION} | trait Future |
| pattern_matching.rs:13:26:133:1 | { ... } | | {EXTERNAL LOCATION} | Option |
| pattern_matching.rs:13:26:133:1 | { ... } | T | file://:0:0:0:0 | () |
| pattern_matching.rs:14:9:14:13 | value | | {EXTERNAL LOCATION} | Option |