Skip to content

Rust: Improve type inference for closures#21206

Draft
hvitved wants to merge 4 commits intogithub:mainfrom
hvitved:rust/type-inference-closure-param-context-typed
Draft

Rust: Improve type inference for closures#21206
hvitved wants to merge 4 commits intogithub:mainfrom
hvitved:rust/type-inference-closure-param-context-typed

Conversation

@hvitved
Copy link
Contributor

@hvitved hvitved commented Jan 22, 2026

No description provided.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jan 22, 2026
@hvitved hvitved force-pushed the rust/type-inference-closure-param-context-typed branch from b5bd829 to 29951e8 Compare January 22, 2026 15:29
@hvitved hvitved force-pushed the rust/type-inference-closure-param-context-typed branch 3 times, most recently from d40ec21 to c337f51 Compare March 10, 2026 19:16
@hvitved hvitved force-pushed the rust/type-inference-closure-param-context-typed branch from c337f51 to 888f87a Compare March 17, 2026 14:07

private module InvokedClosureSatisfiesConstraintInput implements
SatisfiesConstraintInputSig<InvokedClosureExpr>
private module InvokedClosureSatisfiesTypeInput implements SatisfiesTypeInputSig<InvokedClosureExpr>

Check warning

Code scanning / CodeQL

Dead code Warning

This code is never used, and it's not publicly exported.
hasTypeConstraint(tt, type, constraint) and
rootTypesSatisfaction(type, constraint, abs, cond, _) and
predicate potentialInstantiationOf(Term term, TypeAbstraction abs, TypeMention cond) {
exists(Constraint constraint, Type type, Type constraintRoot |

Check warning

Code scanning / CodeQL

Omittable 'exists' variable Warning

This exists variable can be omitted by using a don't-care expression
in this argument
.
Term term, Constraint constraint, TypeAbstraction abs, TypeMention sub, TypePath path,
Type t
) {
exists(Type constraintRoot, TypeMention constraintMention, boolean ambigous |

Check warning

Code scanning / CodeQL

Omittable 'exists' variable Warning

This exists variable can be omitted by using a don't-care expression
in this argument
.
)
}

predicate satisfiesConstraintTypeThrough(

Check warning

Code scanning / CodeQL

Dead code Warning

This code is never used, and it's not publicly exported.
) {
// not exists(getTypeArgument(a, target, tp, _)) and
exists(
TypeAbstraction abs, TypeMention constraint, TypePath pathToTypeParamInSub,

Check warning

Code scanning / CodeQL

Omittable 'exists' variable Warning

This exists variable can be omitted by using a don't-care expression
in this argument
.
// not exists(getTypeArgument(a, target, tp, _)) and
exists(
TypeAbstraction abs, TypeMention constraint, TypePath pathToTypeParamInSub,
TypePath pathToTp, TypePath pathToTp2, TypePath suffix, TypeParameter tp2, TypePath path3,

Check warning

Code scanning / CodeQL

Omittable 'exists' variable Warning

This exists variable can be omitted by using a don't-care expression
in this argument
.
// not exists(getTypeArgument(a, target, tp, _)) and
exists(
TypeAbstraction abs, TypeMention constraint, TypePath pathToTypeParamInSub,
TypePath pathToTp, TypePath pathToTp2, TypePath suffix, TypeParameter tp2, TypePath path3,

Check warning

Code scanning / CodeQL

Omittable 'exists' variable Warning

This exists variable can be omitted by using a don't-care expression
in this argument
.
// not exists(getTypeArgument(a, target, tp, _)) and
exists(
TypeMention constraint, TypePath pathToTypeParamInSub, TypePath pathToT,
TypeParameter tp2, TypePath path4, TypePath prefix, TypeParameter constrainedTp,

Check warning

Code scanning / CodeQL

Omittable 'exists' variable Warning

This exists variable can be omitted by using a don't-care expression
in this argument
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant