Skip to content

Don't re-instantiate the already-instantiated signature in precompute_callable_param_contracts - #355

Open
coord-e wants to merge 1 commit into
mainfrom
claude/gifted-bohr-yk6a0s
Open

coord-e wants to merge 1 commit into
mainfrom
claude/gifted-bohr-yk6a0s

Conversation

@coord-e

@coord-e coord-e commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Fixes #354.

precompute_callable_param_contracts receives sig from fn_sig_with_body, which reads parameter types from self.body. Analyzer::generic_args has already instantiated that body. Instantiating each input with self.generic_args again applied the same args a second time.

On the impl → trait_item_ty path this panicked in rustc's binder whenever the impl had a lifetime parameter, e.g. impl<'a> Get for R<'a> of a trait method with a spec. With a type parameter it silently rewrote T to W<T> instead. This PR drops the second instantiation.

Test pair trait_impl_lifetime_param:

  • The pass file ICEs on main and verifies with this change.
  • The fail file breaks the ensures(result >= 0) contract in the impl and is rejected with Unsat.

cargo test passes locally (402 UI tests, with PCSat).


Generated by Claude Code

…_callable_param_contracts

The signature passed in is built from the body, which generic_args has
already instantiated. Instantiating its inputs again with the same args
reinterpreted the impl's own parameters as indices into the trait
method's args, so an impl with a lifetime parameter (impl<'a> Get for
R<'a>) of a specified trait method panicked in rustc's binder.

Fixes #354

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017R2xbmrztzZ35Qy7MPCymp
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T21:53:39.379743Z 5894e72 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants