Take the type of a call from the callee - #227
Draft
coord-e wants to merge 1 commit into
Draft
Conversation
A call bound its result to a template, and the return type of the callee was related to it by subtyping, leaving a predicate variable to be inferred for what the callee already states. Instantiate the return type of the callee at the arguments and bind that instead. Adapting the arguments to the parameter list of the callee now works on `PlaceType`s, which lets a `rust-call` tuple be untupled by projection rather than by rewriting refinements, and keeps the arguments as terms so that no variable stands between a call and its result. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P7MyQbvfkfNy1h7yeN553N
This was referenced Aug 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second of three, on top of #226. Each removes one predicate variable that stood for a fact the constraints already state elsewhere.
A call bound its result to a template and related the return type of the callee to it by subtyping. The callee already says everything known about its result, so its return type is instantiated at the arguments and bound directly (
instantiate_return_type).Adapting the arguments to the parameter list of the callee moves out into
adapt_args_to_abiand now works onPlaceTypes. That lets arust-calltuple be untupled by projection instead of by rewriting refinements, and keeps the arguments as terms, so no variable stands between a call and its result.Effect
Over
tests/ui/pass(160 files), predicate variables generated: 1293 → 734, the largest of the three steps — a call site is the most common place we were naming something already known.Notes for review
adapt_args_to_abi: therust-callexpansion both moved and was rewritten, so git shows it as a delete plus an add rather than a move.tests/ui/pass/closure_receiver_mut_model_byval.rs(the system stayed satisfiable — eliminating the trivial equalities from the generated.smt2by hand made itsatagain).mainrather than Take the precondition of the entry block from the signature #226, z3 needs far longer than its timeout ontests/ui/pass/mut_recursive.rs. With the entry block having given up its own predicate variable first, it stays at ~0.3s.316 tests pass.
Generated by Claude Code