mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
Rust: Associated types are inherited as type parameters by traits and dyn traits
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
private import codeql.rust.elements.internal.generated.Trait
|
||||
private import codeql.rust.internal.PathResolution as PathResolution
|
||||
|
||||
/**
|
||||
* INTERNAL: This module contains the customizable definition of `Trait` and should not
|
||||
@@ -67,5 +68,11 @@ module Impl {
|
||||
* `where` clauses for `Self`.
|
||||
*/
|
||||
TypeBound getATypeBound() { result = this.getTypeBound(_) }
|
||||
|
||||
/** Gets a direct supertrait of this trait, if any. */
|
||||
Trait getSupertrait() {
|
||||
result =
|
||||
PathResolution::resolvePath(this.getATypeBound().getTypeRepr().(PathTypeRepr).getPath())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,10 +9,17 @@ private import codeql.rust.elements.internal.generated.Synth
|
||||
private import codeql.rust.frameworks.stdlib.Stdlib
|
||||
private import codeql.rust.frameworks.stdlib.Builtins as Builtins
|
||||
|
||||
/** Gets a type alias of `trait` or of a supertrait of `trait`. */
|
||||
private TypeAlias getTraitTypeAlias(Trait trait) {
|
||||
result = trait.getSupertrait*().getAssocItemList().getAnAssocItem()
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if a dyn trait type should have a type parameter associated with `n`. A
|
||||
* dyn trait type inherits the type parameters of the trait it implements. That
|
||||
* includes the type parameters corresponding to associated types.
|
||||
* Holds if a dyn trait type for the trait `trait` should have a type parameter
|
||||
* associated with `n`.
|
||||
*
|
||||
* A dyn trait type inherits the type parameters of the trait it implements.
|
||||
* That includes the type parameters corresponding to associated types.
|
||||
*
|
||||
* For instance in
|
||||
* ```rust
|
||||
@@ -24,10 +31,7 @@ private import codeql.rust.frameworks.stdlib.Builtins as Builtins
|
||||
*/
|
||||
private predicate dynTraitTypeParameter(Trait trait, AstNode n) {
|
||||
trait = any(DynTraitTypeRepr dt).getTrait() and
|
||||
(
|
||||
n = trait.getGenericParamList().getATypeParam() or
|
||||
n = trait.(TraitItemNode).getAnAssocItem().(TypeAlias)
|
||||
)
|
||||
n = [trait.getGenericParamList().getATypeParam().(AstNode), getTraitTypeAlias(trait)]
|
||||
}
|
||||
|
||||
cached
|
||||
@@ -39,8 +43,10 @@ newtype TType =
|
||||
TNeverType() or
|
||||
TUnknownType() or
|
||||
TTypeParamTypeParameter(TypeParam t) or
|
||||
TAssociatedTypeTypeParameter(TypeAlias t) { any(TraitItemNode trait).getAnAssocItem() = t } or
|
||||
TDynTraitTypeParameter(AstNode n) { dynTraitTypeParameter(_, n) } or
|
||||
TAssociatedTypeTypeParameter(Trait trait, TypeAlias typeAlias) {
|
||||
getTraitTypeAlias(trait) = typeAlias
|
||||
} or
|
||||
TDynTraitTypeParameter(Trait trait, AstNode n) { dynTraitTypeParameter(trait, n) } or
|
||||
TImplTraitTypeParameter(ImplTraitTypeRepr implTrait, TypeParam tp) {
|
||||
implTraitTypeParam(implTrait, _, tp)
|
||||
} or
|
||||
@@ -270,17 +276,10 @@ class DynTraitType extends Type, TDynTraitType {
|
||||
DynTraitType() { this = TDynTraitType(trait) }
|
||||
|
||||
override DynTraitTypeParameter getPositionalTypeParameter(int i) {
|
||||
result = TDynTraitTypeParameter(trait.getGenericParamList().getTypeParam(i))
|
||||
result.getTypeParam() = trait.getGenericParamList().getTypeParam(i)
|
||||
}
|
||||
|
||||
override TypeParameter getATypeParameter() {
|
||||
result = super.getATypeParameter()
|
||||
or
|
||||
exists(AstNode n |
|
||||
dynTraitTypeParameter(trait, n) and
|
||||
result = TDynTraitTypeParameter(n)
|
||||
)
|
||||
}
|
||||
override DynTraitTypeParameter getATypeParameter() { result.getTrait() = trait }
|
||||
|
||||
Trait getTrait() { result = trait }
|
||||
|
||||
@@ -427,30 +426,54 @@ class TypeParamTypeParameter extends TypeParameter, TTypeParamTypeParameter {
|
||||
* // ...
|
||||
* }
|
||||
* ```
|
||||
* Furthermore, associated types of a supertrait induce a corresponding type
|
||||
* parameter in any subtraits. E.g., if we have a trait `SubTrait: ATrait` then
|
||||
* `SubTrait` also has a type parameter for the associated type
|
||||
* `AssociatedType`.
|
||||
*/
|
||||
class AssociatedTypeTypeParameter extends TypeParameter, TAssociatedTypeTypeParameter {
|
||||
private Trait trait;
|
||||
private TypeAlias typeAlias;
|
||||
|
||||
AssociatedTypeTypeParameter() { this = TAssociatedTypeTypeParameter(typeAlias) }
|
||||
AssociatedTypeTypeParameter() { this = TAssociatedTypeTypeParameter(trait, typeAlias) }
|
||||
|
||||
TypeAlias getTypeAlias() { result = typeAlias }
|
||||
|
||||
/** Gets the trait that contains this associated type declaration. */
|
||||
TraitItemNode getTrait() { result.getAnAssocItem() = typeAlias }
|
||||
TraitItemNode getTrait() { result = trait }
|
||||
|
||||
override ItemNode getDeclaringItem() { result = this.getTrait() }
|
||||
/**
|
||||
* Holds if this associated type type parameter corresponds directly its
|
||||
* trait, that is, it is not inherited from a supertrait.
|
||||
*/
|
||||
predicate isDirect() { trait.(TraitItemNode).getAnAssocItem() = typeAlias }
|
||||
|
||||
override string toString() { result = typeAlias.getName().getText() }
|
||||
override ItemNode getDeclaringItem() { result = trait }
|
||||
|
||||
override string toString() {
|
||||
result = typeAlias.getName().getText() + "[" + trait.getName().toString() + "]"
|
||||
}
|
||||
|
||||
override Location getLocation() { result = typeAlias.getLocation() }
|
||||
}
|
||||
|
||||
/** Gets the associated type type parameter corresponding directly to `typeAlias`. */
|
||||
AssociatedTypeTypeParameter getAssociatedTypeTypeParameter(TypeAlias typeAlias) {
|
||||
result.isDirect() and result.getTypeAlias() = typeAlias
|
||||
}
|
||||
|
||||
/** Gets the dyn type type parameter corresponding directly to `typeAlias`. */
|
||||
DynTraitTypeParameter getDynTraitTypeParameter(TypeAlias typeAlias) {
|
||||
result.getTraitTypeParameter() = getAssociatedTypeTypeParameter(typeAlias)
|
||||
}
|
||||
|
||||
class DynTraitTypeParameter extends TypeParameter, TDynTraitTypeParameter {
|
||||
private Trait trait;
|
||||
private AstNode n;
|
||||
|
||||
DynTraitTypeParameter() { this = TDynTraitTypeParameter(n) }
|
||||
DynTraitTypeParameter() { this = TDynTraitTypeParameter(trait, n) }
|
||||
|
||||
Trait getTrait() { dynTraitTypeParameter(result, n) }
|
||||
Trait getTrait() { result = trait }
|
||||
|
||||
/** Gets the dyn trait type that this type parameter belongs to. */
|
||||
DynTraitType getDynTraitType() { result.getTrait() = this.getTrait() }
|
||||
@@ -465,7 +488,7 @@ class DynTraitTypeParameter extends TypeParameter, TDynTraitTypeParameter {
|
||||
TypeParameter getTraitTypeParameter() {
|
||||
result.(TypeParamTypeParameter).getTypeParam() = n
|
||||
or
|
||||
result.(AssociatedTypeTypeParameter).getTypeAlias() = n
|
||||
result = TAssociatedTypeTypeParameter(trait, n)
|
||||
}
|
||||
|
||||
private string toStringInner() {
|
||||
|
||||
@@ -90,7 +90,7 @@ private module Input1 implements InputSig1<Location> {
|
||||
tp =
|
||||
rank[result](TypeParameter tp0, int kind, int id1, int id2 |
|
||||
kind = 1 and
|
||||
id1 = 0 and
|
||||
id1 = idOfTypeParameterAstNode(tp0.(DynTraitTypeParameter).getTrait()) and
|
||||
id2 =
|
||||
idOfTypeParameterAstNode([
|
||||
tp0.(DynTraitTypeParameter).getTypeParam().(AstNode),
|
||||
@@ -102,10 +102,13 @@ private module Input1 implements InputSig1<Location> {
|
||||
id2 = idOfTypeParameterAstNode(tp0.(ImplTraitTypeParameter).getTypeParam())
|
||||
or
|
||||
kind = 3 and
|
||||
id1 = idOfTypeParameterAstNode(tp0.(AssociatedTypeTypeParameter).getTrait()) and
|
||||
id2 = idOfTypeParameterAstNode(tp0.(AssociatedTypeTypeParameter).getTypeAlias())
|
||||
or
|
||||
kind = 4 and
|
||||
id1 = 0 and
|
||||
exists(AstNode node | id2 = idOfTypeParameterAstNode(node) |
|
||||
node = tp0.(TypeParamTypeParameter).getTypeParam() or
|
||||
node = tp0.(AssociatedTypeTypeParameter).getTypeAlias() or
|
||||
node = tp0.(SelfTypeParameter).getTrait() or
|
||||
node = tp0.(ImplTraitTypeTypeParameter).getImplTraitTypeRepr()
|
||||
)
|
||||
@@ -3507,12 +3510,12 @@ private DynTraitType getFutureTraitType() { result.getTrait() instanceof FutureT
|
||||
|
||||
pragma[nomagic]
|
||||
private AssociatedTypeTypeParameter getFutureOutputTypeParameter() {
|
||||
result.getTypeAlias() = any(FutureTrait ft).getOutputType()
|
||||
result = getAssociatedTypeTypeParameter(any(FutureTrait ft).getOutputType())
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
private DynTraitTypeParameter getDynFutureOutputTypeParameter() {
|
||||
result = TDynTraitTypeParameter(any(FutureTrait ft).getOutputType())
|
||||
result.getTraitTypeParameter() = getFutureOutputTypeParameter()
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
@@ -3824,20 +3827,20 @@ private Type invokedClosureFnTypeAt(InvokedClosureExpr ce, TypePath path) {
|
||||
|
||||
/** Gets the path to a closure's return type. */
|
||||
private TypePath closureReturnPath() {
|
||||
result = TypePath::singleton(TDynTraitTypeParameter(any(FnOnceTrait t).getOutputType()))
|
||||
result = TypePath::singleton(getDynTraitTypeParameter(any(FnOnceTrait t).getOutputType()))
|
||||
}
|
||||
|
||||
/** Gets the path to a closure with arity `arity`s `index`th parameter type. */
|
||||
pragma[nomagic]
|
||||
private TypePath closureParameterPath(int arity, int index) {
|
||||
result =
|
||||
TypePath::cons(TDynTraitTypeParameter(any(FnOnceTrait t).getTypeParam()),
|
||||
TypePath::cons(TDynTraitTypeParameter(_, any(FnOnceTrait t).getTypeParam()),
|
||||
TypePath::singleton(getTupleTypeParameter(arity, index)))
|
||||
}
|
||||
|
||||
/** Gets the path to the return type of the `FnOnce` trait. */
|
||||
private TypePath fnReturnPath() {
|
||||
result = TypePath::singleton(TAssociatedTypeTypeParameter(any(FnOnceTrait t).getOutputType()))
|
||||
result = TypePath::singleton(getAssociatedTypeTypeParameter(any(FnOnceTrait t).getOutputType()))
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3898,7 +3901,7 @@ private Type inferClosureExprType(AstNode n, TypePath path) {
|
||||
result = TDynTraitType(any(FnOnceTrait t)) // always exists because of the mention in `builtins/mentions.rs`
|
||||
or
|
||||
n = ce and
|
||||
path = TypePath::singleton(TDynTraitTypeParameter(any(FnOnceTrait t).getTypeParam())) and
|
||||
path = TypePath::singleton(TDynTraitTypeParameter(_, any(FnOnceTrait t).getTypeParam())) and
|
||||
result.(TupleType).getArity() = ce.getNumberOfParams()
|
||||
or
|
||||
// Propagate return type annotation to body
|
||||
|
||||
@@ -148,30 +148,11 @@ class NonAliasPathTypeMention extends PathTypeMention {
|
||||
|
||||
TypeItemNode getResolved() { result = resolved }
|
||||
|
||||
/**
|
||||
* Gets a type alias with the name `name` of the trait that this path resolves
|
||||
* to, if any.
|
||||
*/
|
||||
pragma[nomagic]
|
||||
private TypeAlias getResolvedTraitAlias(string name) {
|
||||
result = resolved.(TraitItemNode).getAnAssocItem() and
|
||||
name = result.getName().getText()
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
private TypeRepr getAssocTypeArg(string name) {
|
||||
result = this.getSegment().getGenericArgList().getAssocTypeArg(name)
|
||||
}
|
||||
|
||||
/** Gets the type argument for the associated type `alias`, if any. */
|
||||
pragma[nomagic]
|
||||
private TypeRepr getAnAssocTypeArgument(TypeAlias alias) {
|
||||
exists(string name |
|
||||
alias = this.getResolvedTraitAlias(name) and
|
||||
result = this.getAssocTypeArg(name)
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the type mention that instantiates the implicit `Self` type parameter
|
||||
* for this path, if it occurs in the position of a trait bound.
|
||||
@@ -239,7 +220,7 @@ class NonAliasPathTypeMention extends PathTypeMention {
|
||||
tp = TTypeParamTypeParameter(t.getTypeParam()) and
|
||||
result = s.getParenthesizedArgList().(TypeMention).resolveTypeAt(path)
|
||||
or
|
||||
tp = TAssociatedTypeTypeParameter(t.getOutputType()) and
|
||||
tp = TAssociatedTypeTypeParameter(t, t.getOutputType()) and
|
||||
(
|
||||
result = s.getRetType().getTypeRepr().(TypeMention).resolveTypeAt(path)
|
||||
or
|
||||
@@ -249,6 +230,28 @@ class NonAliasPathTypeMention extends PathTypeMention {
|
||||
path.isEmpty()
|
||||
)
|
||||
)
|
||||
or
|
||||
// If `path` is the supertrait of a trait block then any associated types
|
||||
// of the supertrait should be instantiated with the subtrait's
|
||||
// corresponding copies.
|
||||
//
|
||||
// As an example, for
|
||||
// ```rust
|
||||
// trait Sub: Super {
|
||||
// // ^^^^^ this
|
||||
// ```
|
||||
// we do something to the effect of:
|
||||
// ```rust
|
||||
// trait Sub: Super<Assoc=Assoc[Sub]>
|
||||
// ```
|
||||
// Where `Assoc` is an associated type of `Super` and `Assoc[Sub]` denotes
|
||||
// the copy of the type parameter inherited into `Sub`.
|
||||
exists(Trait subtrait, TypeAlias alias |
|
||||
subtrait.getATypeBound().getTypeRepr().(PathTypeRepr).getPath() = this and
|
||||
result = TAssociatedTypeTypeParameter(subtrait, alias) and
|
||||
tp = TAssociatedTypeTypeParameter(resolved, alias) and
|
||||
path.isEmpty()
|
||||
)
|
||||
}
|
||||
|
||||
pragma[nomagic]
|
||||
@@ -259,9 +262,10 @@ class NonAliasPathTypeMention extends PathTypeMention {
|
||||
/** Gets the type mention in this path for the type parameter `tp`, if any. */
|
||||
pragma[nomagic]
|
||||
private TypeMention getTypeMentionForTypeParameter(TypeParameter tp) {
|
||||
exists(TypeAlias alias |
|
||||
result = this.getAnAssocTypeArgument(alias) and
|
||||
tp = TAssociatedTypeTypeParameter(alias)
|
||||
exists(TypeAlias alias, string name |
|
||||
result = this.getAssocTypeArg(name) and
|
||||
tp = TAssociatedTypeTypeParameter(resolved, alias) and
|
||||
alias = resolved.(TraitItemNode).getASuccessor(name)
|
||||
)
|
||||
or
|
||||
// If `path` is the trait of an `impl` block then any associated types
|
||||
@@ -281,7 +285,8 @@ class NonAliasPathTypeMention extends PathTypeMention {
|
||||
this = impl.getTraitPath() and
|
||||
alias = impl.getASuccessor(pragma[only_bind_into](name)) and
|
||||
result = alias.getTypeRepr() and
|
||||
tp = TAssociatedTypeTypeParameter(this.getResolvedAlias(pragma[only_bind_into](name)))
|
||||
tp =
|
||||
TAssociatedTypeTypeParameter(resolved, this.getResolvedAlias(pragma[only_bind_into](name)))
|
||||
)
|
||||
}
|
||||
|
||||
@@ -299,7 +304,7 @@ class NonAliasPathTypeMention extends PathTypeMention {
|
||||
or
|
||||
result = TTypeParamTypeParameter(resolved)
|
||||
or
|
||||
result = TAssociatedTypeTypeParameter(resolved)
|
||||
result = TAssociatedTypeTypeParameter(resolvePath(this.getQualifier()), resolved)
|
||||
}
|
||||
|
||||
override Type resolvePathTypeAt(TypePath typePath) {
|
||||
@@ -384,9 +389,8 @@ class TraitMention extends TypeMention instanceof TraitItemNode {
|
||||
result = TSelfTypeParameter(this)
|
||||
or
|
||||
exists(TypeAlias alias |
|
||||
alias = super.getAnAssocItem() and
|
||||
typePath = TypePath::singleton(result) and
|
||||
result = TAssociatedTypeTypeParameter(alias)
|
||||
result = TAssociatedTypeTypeParameter(this, alias)
|
||||
)
|
||||
or
|
||||
exists(TypeParam tp |
|
||||
@@ -540,7 +544,7 @@ class DynTraitTypeReprMention extends TypeMention instanceof DynTraitTypeRepr {
|
||||
// impl<A, B, ..> Trait<A, B, ..> for (dyn Trait)<A, B, ..>
|
||||
// ```
|
||||
// To achieve this:
|
||||
// - `DynTypeAbstraction` is an abstraction over type parameters of the trait.
|
||||
// - `DynTypeAbstraction` is an abstraction over the type parameters of the trait.
|
||||
// - `DynTypeBoundListMention` (this class) is a type mention which has `dyn
|
||||
// Trait` at the root and which for every type parameter of `dyn Trait` has the
|
||||
// corresponding type parameter of the trait.
|
||||
|
||||
@@ -69,7 +69,7 @@ mod default_method_using_associated_type {
|
||||
Self::AssociatedType: Default,
|
||||
Self: Sized,
|
||||
{
|
||||
self.m1(); // $ target=MyTrait::m1 type=self.m1():AssociatedType
|
||||
self.m1(); // $ target=MyTrait::m1 type=self.m1():AssociatedType[MyTrait]
|
||||
let _default = Self::AssociatedType::default(); // $ MISSING: target=default _default:AssociatedType
|
||||
Self::AssociatedType::default() // $ MISSING: target=default
|
||||
}
|
||||
@@ -144,8 +144,8 @@ mod equality_on_associated_type {
|
||||
where
|
||||
T: AnotherGet<Output = i32, AnotherOutput = bool>,
|
||||
{
|
||||
let _a1 = x.get(); // $ target=GetSet::get MISSING: type=_a1:i32
|
||||
let _a2 = get(&x); // $ target=get MISSING: type=_a2:i32
|
||||
let _a1 = x.get(); // $ target=GetSet::get type=_a1:i32
|
||||
let _a2 = get(&x); // $ target=get type=_a2:i32
|
||||
let _b = x.get_another(); // $ type=_b:bool target=AnotherGet::get_another
|
||||
}
|
||||
|
||||
@@ -346,9 +346,9 @@ mod dyn_trait {
|
||||
}
|
||||
|
||||
fn _assoc_type_from_supertrait(t: &dyn AnotherGet<Output = i32, AnotherOutput = bool>) {
|
||||
let _a1 = (*t).get(); // $ target=deref target=GetSet::get MISSING: type=_a1:i32
|
||||
let _a2 = t.get(); // $ target=GetSet::get MISSING: type=_a2:i32
|
||||
let _a3 = get(t); // $ target=get MISSING: type=_a3:i32
|
||||
let _a1 = (*t).get(); // $ target=deref target=GetSet::get type=_a1:i32
|
||||
let _a2 = t.get(); // $ target=GetSet::get type=_a2:i32
|
||||
let _a3 = get(t); // $ target=get type=_a3:i32
|
||||
let _b1 = (*t).get_another(); // $ target=deref target=AnotherGet::get_another type=_b1:bool
|
||||
let _b2 = t.get_another(); // $ target=AnotherGet::get_another type=_b2:bool
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ inferCertainType
|
||||
| associated_types.rs:23:12:23:16 | SelfParam | TRef | associated_types.rs:19:1:27:1 | Self [trait GetSet] |
|
||||
| associated_types.rs:26:12:26:16 | SelfParam | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:26:12:26:16 | SelfParam | TRef | associated_types.rs:19:1:27:1 | Self [trait GetSet] |
|
||||
| associated_types.rs:26:19:26:20 | _a | | associated_types.rs:20:5:20:16 | Output |
|
||||
| associated_types.rs:26:19:26:20 | _a | | associated_types.rs:20:5:20:16 | Output[GetSet] |
|
||||
| associated_types.rs:26:37:26:38 | { ... } | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:29:43:29:46 | item | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:29:43:29:46 | item | TRef | associated_types.rs:29:11:29:40 | T |
|
||||
@@ -29,7 +29,7 @@ inferCertainType
|
||||
| associated_types.rs:54:9:54:12 | self | TRef.A | associated_types.rs:49:6:49:12 | T |
|
||||
| associated_types.rs:65:15:65:18 | SelfParam | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] |
|
||||
| associated_types.rs:67:15:67:18 | SelfParam | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] |
|
||||
| associated_types.rs:71:9:75:9 | { ... } | | associated_types.rs:62:9:62:28 | AssociatedType |
|
||||
| associated_types.rs:71:9:75:9 | { ... } | | associated_types.rs:62:9:62:28 | AssociatedType[MyTrait] |
|
||||
| associated_types.rs:72:13:72:16 | self | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] |
|
||||
| associated_types.rs:82:15:82:18 | SelfParam | | associated_types.rs:10:1:11:9 | S |
|
||||
| associated_types.rs:82:45:84:9 | { ... } | | associated_types.rs:16:1:17:10 | S3 |
|
||||
@@ -87,7 +87,7 @@ inferCertainType
|
||||
| associated_types.rs:190:23:190:27 | SelfParam | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] |
|
||||
| associated_types.rs:190:30:190:30 | a | | associated_types.rs:190:20:190:20 | A |
|
||||
| associated_types.rs:190:36:190:36 | b | | associated_types.rs:190:20:190:20 | A |
|
||||
| associated_types.rs:190:76:193:9 | { ... } | | associated_types.rs:184:9:184:52 | GenericAssociatedType |
|
||||
| associated_types.rs:190:76:193:9 | { ... } | | associated_types.rs:184:9:184:52 | GenericAssociatedType[MyTraitAssoc2] |
|
||||
| associated_types.rs:191:13:191:16 | self | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:191:13:191:16 | self | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] |
|
||||
| associated_types.rs:191:22:191:22 | a | | associated_types.rs:190:20:190:20 | A |
|
||||
@@ -124,11 +124,15 @@ inferCertainType
|
||||
| associated_types.rs:260:24:260:28 | SelfParam | TRef | associated_types.rs:258:5:261:5 | Self [trait Subtrait] |
|
||||
| associated_types.rs:269:23:269:27 | SelfParam | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:269:23:269:27 | SelfParam | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] |
|
||||
| associated_types.rs:269:30:269:31 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] |
|
||||
| associated_types.rs:269:48:269:49 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] |
|
||||
| associated_types.rs:269:66:272:9 | { ... } | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:270:13:270:16 | self | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:270:13:270:16 | self | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] |
|
||||
| associated_types.rs:270:22:270:23 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] |
|
||||
| associated_types.rs:271:13:271:16 | self | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:271:13:271:16 | self | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] |
|
||||
| associated_types.rs:271:22:271:23 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] |
|
||||
| associated_types.rs:280:16:280:20 | SelfParam | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:280:16:280:20 | SelfParam | TRef | associated_types.rs:275:5:275:24 | MyType |
|
||||
| associated_types.rs:280:16:280:20 | SelfParam | TRef.T | associated_types.rs:277:10:277:16 | T |
|
||||
@@ -193,22 +197,28 @@ inferCertainType
|
||||
| associated_types.rs:348:36:348:36 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:348:36:348:36 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:348:36:348:36 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:348:36:348:36 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:348:92:354:5 | { ... } | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:349:21:349:21 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:349:21:349:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:349:21:349:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:349:21:349:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:350:19:350:19 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:350:19:350:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:350:19:350:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:350:19:350:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:351:23:351:23 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:351:23:351:23 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:351:23:351:23 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:351:23:351:23 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:352:21:352:21 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:352:21:352:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:352:21:352:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:352:21:352:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:353:19:353:19 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:353:19:353:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:353:19:353:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:353:19:353:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:357:15:364:1 | { ... } | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:358:5:358:48 | ...::test(...) | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:359:5:359:45 | ...::test(...) | | {EXTERNAL LOCATION} | () |
|
||||
@@ -4628,7 +4638,7 @@ inferType
|
||||
| associated_types.rs:23:12:23:16 | SelfParam | TRef | associated_types.rs:19:1:27:1 | Self [trait GetSet] |
|
||||
| associated_types.rs:26:12:26:16 | SelfParam | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:26:12:26:16 | SelfParam | TRef | associated_types.rs:19:1:27:1 | Self [trait GetSet] |
|
||||
| associated_types.rs:26:19:26:20 | _a | | associated_types.rs:20:5:20:16 | Output |
|
||||
| associated_types.rs:26:19:26:20 | _a | | associated_types.rs:20:5:20:16 | Output[GetSet] |
|
||||
| associated_types.rs:26:37:26:38 | { ... } | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:29:43:29:46 | item | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:29:43:29:46 | item | TRef | associated_types.rs:29:11:29:40 | T |
|
||||
@@ -4652,10 +4662,10 @@ inferType
|
||||
| associated_types.rs:54:9:54:14 | self.0 | | associated_types.rs:49:6:49:12 | T |
|
||||
| associated_types.rs:65:15:65:18 | SelfParam | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] |
|
||||
| associated_types.rs:67:15:67:18 | SelfParam | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] |
|
||||
| associated_types.rs:71:9:75:9 | { ... } | | associated_types.rs:62:9:62:28 | AssociatedType |
|
||||
| associated_types.rs:71:9:75:9 | { ... } | | associated_types.rs:62:9:62:28 | AssociatedType[MyTrait] |
|
||||
| associated_types.rs:72:13:72:16 | self | | associated_types.rs:61:5:76:5 | Self [trait MyTrait] |
|
||||
| associated_types.rs:72:13:72:21 | self.m1() | | associated_types.rs:62:9:62:28 | AssociatedType |
|
||||
| associated_types.rs:74:13:74:43 | ...::default(...) | | associated_types.rs:62:9:62:28 | AssociatedType |
|
||||
| associated_types.rs:72:13:72:21 | self.m1() | | associated_types.rs:62:9:62:28 | AssociatedType[MyTrait] |
|
||||
| associated_types.rs:74:13:74:43 | ...::default(...) | | associated_types.rs:62:9:62:28 | AssociatedType[MyTrait] |
|
||||
| associated_types.rs:82:15:82:18 | SelfParam | | associated_types.rs:10:1:11:9 | S |
|
||||
| associated_types.rs:82:45:84:9 | { ... } | | associated_types.rs:16:1:17:10 | S3 |
|
||||
| associated_types.rs:83:13:83:14 | S3 | | associated_types.rs:16:1:17:10 | S3 |
|
||||
@@ -4720,7 +4730,11 @@ inferType
|
||||
| associated_types.rs:139:18:139:24 | x.get() | | {EXTERNAL LOCATION} | char |
|
||||
| associated_types.rs:143:24:143:24 | x | | associated_types.rs:143:21:143:21 | T |
|
||||
| associated_types.rs:146:5:150:5 | { ... } | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:147:13:147:15 | _a1 | | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:147:19:147:19 | x | | associated_types.rs:143:21:143:21 | T |
|
||||
| associated_types.rs:147:19:147:25 | x.get() | | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:148:13:148:15 | _a2 | | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:148:19:148:25 | get(...) | | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:148:23:148:24 | &x | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:148:23:148:24 | &x | TRef | associated_types.rs:143:21:143:21 | T |
|
||||
| associated_types.rs:148:24:148:24 | x | | associated_types.rs:143:21:143:21 | T |
|
||||
@@ -4755,14 +4769,14 @@ inferType
|
||||
| associated_types.rs:190:23:190:27 | SelfParam | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] |
|
||||
| associated_types.rs:190:30:190:30 | a | | associated_types.rs:190:20:190:20 | A |
|
||||
| associated_types.rs:190:36:190:36 | b | | associated_types.rs:190:20:190:20 | A |
|
||||
| associated_types.rs:190:76:193:9 | { ... } | | associated_types.rs:184:9:184:52 | GenericAssociatedType |
|
||||
| associated_types.rs:190:76:193:9 | { ... } | | associated_types.rs:184:9:184:52 | GenericAssociatedType[MyTraitAssoc2] |
|
||||
| associated_types.rs:191:13:191:16 | self | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:191:13:191:16 | self | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] |
|
||||
| associated_types.rs:191:13:191:23 | self.put(...) | | associated_types.rs:184:9:184:52 | GenericAssociatedType |
|
||||
| associated_types.rs:191:13:191:23 | self.put(...) | | associated_types.rs:184:9:184:52 | GenericAssociatedType[MyTraitAssoc2] |
|
||||
| associated_types.rs:191:22:191:22 | a | | associated_types.rs:190:20:190:20 | A |
|
||||
| associated_types.rs:192:13:192:16 | self | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:192:13:192:16 | self | TRef | associated_types.rs:183:5:194:5 | Self [trait MyTraitAssoc2] |
|
||||
| associated_types.rs:192:13:192:23 | self.put(...) | | associated_types.rs:184:9:184:52 | GenericAssociatedType |
|
||||
| associated_types.rs:192:13:192:23 | self.put(...) | | associated_types.rs:184:9:184:52 | GenericAssociatedType[MyTraitAssoc2] |
|
||||
| associated_types.rs:192:22:192:22 | b | | associated_types.rs:190:20:190:20 | A |
|
||||
| associated_types.rs:201:19:201:23 | SelfParam | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:201:19:201:23 | SelfParam | TRef | associated_types.rs:10:1:11:9 | S |
|
||||
@@ -4818,13 +4832,17 @@ inferType
|
||||
| associated_types.rs:260:24:260:28 | SelfParam | TRef | associated_types.rs:258:5:261:5 | Self [trait Subtrait] |
|
||||
| associated_types.rs:269:23:269:27 | SelfParam | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:269:23:269:27 | SelfParam | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] |
|
||||
| associated_types.rs:269:30:269:31 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] |
|
||||
| associated_types.rs:269:48:269:49 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] |
|
||||
| associated_types.rs:269:66:272:9 | { ... } | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:270:13:270:16 | self | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:270:13:270:16 | self | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] |
|
||||
| associated_types.rs:270:13:270:24 | self.set(...) | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:270:22:270:23 | c1 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] |
|
||||
| associated_types.rs:271:13:271:16 | self | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:271:13:271:16 | self | TRef | associated_types.rs:263:5:273:5 | Self [trait Subtrait2] |
|
||||
| associated_types.rs:271:13:271:24 | self.set(...) | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:271:22:271:23 | c2 | | associated_types.rs:20:5:20:16 | Output[Subtrait2] |
|
||||
| associated_types.rs:280:16:280:20 | SelfParam | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:280:16:280:20 | SelfParam | TRef | associated_types.rs:275:5:275:24 | MyType |
|
||||
| associated_types.rs:280:16:280:20 | SelfParam | TRef.T | associated_types.rs:277:10:277:16 | T |
|
||||
@@ -4935,33 +4953,49 @@ inferType
|
||||
| associated_types.rs:348:36:348:36 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:348:36:348:36 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:348:36:348:36 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:348:36:348:36 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:348:92:354:5 | { ... } | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:349:13:349:15 | _a1 | | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:349:19:349:22 | (...) | | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:349:19:349:22 | (...) | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:349:19:349:22 | (...) | dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:349:19:349:28 | ... .get() | | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:349:20:349:21 | * ... | | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:349:20:349:21 | * ... | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:349:20:349:21 | * ... | dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:349:21:349:21 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:349:21:349:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:349:21:349:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:349:21:349:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:350:13:350:15 | _a2 | | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:350:19:350:19 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:350:19:350:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:350:19:350:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:350:19:350:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:350:19:350:25 | t.get() | | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:351:13:351:15 | _a3 | | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:351:19:351:24 | get(...) | | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:351:23:351:23 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:351:23:351:23 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:351:23:351:23 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:351:23:351:23 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:352:13:352:15 | _b1 | | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:352:19:352:22 | (...) | | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:352:19:352:22 | (...) | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:352:19:352:22 | (...) | dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:352:19:352:36 | ... .get_another() | | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:352:20:352:21 | * ... | | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:352:20:352:21 | * ... | dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:352:20:352:21 | * ... | dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:352:21:352:21 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:352:21:352:21 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:352:21:352:21 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:352:21:352:21 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:353:13:353:15 | _b2 | | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:353:19:353:19 | t | | {EXTERNAL LOCATION} | & |
|
||||
| associated_types.rs:353:19:353:19 | t | TRef | associated_types.rs:33:1:38:1 | dyn AnotherGet |
|
||||
| associated_types.rs:353:19:353:19 | t | TRef.dyn(AnotherOutput) | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:353:19:353:19 | t | TRef.dyn(Output) | {EXTERNAL LOCATION} | i32 |
|
||||
| associated_types.rs:353:19:353:33 | t.get_another() | | {EXTERNAL LOCATION} | bool |
|
||||
| associated_types.rs:357:15:364:1 | { ... } | | {EXTERNAL LOCATION} | () |
|
||||
| associated_types.rs:358:5:358:48 | ...::test(...) | | {EXTERNAL LOCATION} | () |
|
||||
|
||||
Reference in New Issue
Block a user