Skip to content

snapshots sometimes leak inference variables #122188

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

Open
lcnr opened this issue Mar 8, 2024 · 0 comments
Open

snapshots sometimes leak inference variables #122188

lcnr opened this issue Mar 8, 2024 · 0 comments
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@lcnr
Copy link
Contributor

lcnr commented Mar 8, 2024

When using InferCtxt::probe/commit_if_ok, we discard all inference variables created inside of this snapshot. This means that returning a type containing inference variables from it can later result in ICE if we try to access them.

This should not happen and we should protect ourselves from doing so in the future. cc https://rust-lang.zulipchat.com/#narrow/stream/144729-t-types/topic/leaking.20infer.20vars.20from.20snapshots

@lcnr lcnr added C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-types Relevant to the types team, which will review and decide on the PR/issue. labels Mar 8, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 8, 2024
snapshot: avoid leaking inference vars

A first step towards fixing rust-lang#122188. There are still some FIXMEs left, most notably method probing.

fixes rust-lang#122098

r? `@oli-obk`
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 8, 2024
snapshot: avoid leaking inference vars

A first step towards fixing rust-lang#122188. There are still some FIXMEs left, most notably method probing.

fixes rust-lang#122098

r? `@oli-obk`
bors added a commit to rust-lang-ci/rust that referenced this issue Mar 12, 2024
snapshot: avoid leaking inference vars

A first step towards fixing rust-lang#122188. There are still some FIXMEs left, most notably method probing.

fixes rust-lang#122098

r? `@oli-obk`
@jieyouxu jieyouxu removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants