Skip to content

Rust: Support blanket implementations #20133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

paldepind
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Jul 28, 2025
)
}

private predicate noFirst2() { not exists(this.resolveBound(0)) and exists(this.resolveBound(1)) }

Check warning

Code scanning / CodeQL

Dead code Warning

This code is never used, and it's not publicly exported.
Comment on lines +1740 to +1745
}

private predicate blanketImplementationWithoutBound(Impl impl) {
not exists(impl.getAttributeMacroExpansion()) and
exists(TypeParam gp |
gp = impl.getGenericParamList().getAGenericParam() and

Check warning

Code scanning / CodeQL

Selecting minimum element using `rank[1]` Warning

Using rank1 is an anti-pattern, use min(..) instead.
gp = impl.getGenericParamList().getAGenericParam() and
gp = impl.(ImplItemNode).resolveSelfTy() and
not exists(gp.(TypeParamItemNode).getABoundPath())
)

Check warning

Code scanning / CodeQL

Dead code Warning

This code is never used, and it's not publicly exported.
not blanketImplementationTraitBound(impl, _) and
not blanketImplementationWithoutBound(impl) and
resolved = resolvePath(tp.getBoundPath(0))
)

Check warning

Code scanning / CodeQL

Dead code Warning

This code is never used, and it's not publicly exported.
}

predicate getBlanketImpl(MethodCall mc, Type t, Impl impl, Trait trait, Function f) {
SatisfiesConstraint<MethodCall, SatisfiesConstraintInput>::satisfiesConstraintType(mc,

Check warning

Code scanning / CodeQL

Dead code Warning

This code is never used, and it's not publicly exported.
methodCallMatchesBlanketImpl(mc, t, impl, trait, f)
}

pragma[nomagic]

Check warning

Code scanning / CodeQL

Predicates starting with "get" or "as" should return a value Warning

This predicate starts with 'get' but does not return a value.
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