Skip to content
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

stop leaking inference variables from snapshots #121365

Closed
wants to merge 1 commit into from

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Feb 20, 2024

a revival of #100745. Right now we can very easily ICE when trying to use the returned values from probe and commit_if_ok.

I closed that PR as this check detected issues but we didn't get any unexpected ICEs from this, so I thought:

so afaict inference variables actually remain valid, we just drop any unifications from inside of the snapshot 🤔 so i guess while still weird, this isn't a soundness issue?

nah, we just tend to not use the leaked inference vars in any way that causes ICEs. A slight change to coercion which I am working on separately did result in such an ICE.

r? @compiler-errors

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Feb 20, 2024
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
GITHUB_ENV=/home/runner/work/_temp/_runner_file_commands/set_env_c0bfd535-ed39-4f93-a7ce-fb15d7701d2c
GITHUB_EVENT_NAME=pull_request
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_HEAD_REF=commit_if_ok-leaks
GITHUB_JOB=pr
GITHUB_PATH=/home/runner/work/_temp/_runner_file_commands/add_path_c0bfd535-ed39-4f93-a7ce-fb15d7701d2c
GITHUB_REF=refs/pull/121365/merge
GITHUB_REF_NAME=121365/merge
GITHUB_REF_PROTECTED=false
---
#13 4.035 Building wheels for collected packages: reuse
#13 4.036   Building wheel for reuse (pyproject.toml): started
#13 4.387   Building wheel for reuse (pyproject.toml): finished with status 'done'
#13 4.388   Created wheel for reuse: filename=reuse-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl size=181117 sha256=f5f58750481f69515c2c0d1d503daf565e2565c370d07fc6aeb95fe3498b4269
#13 4.389   Stored in directory: /tmp/pip-ephem-wheel-cache-ydipxqsy/wheels/c2/3c/b9/1120c2ab4bd82694f7e6f0537dc5b9a085c13e2c69a8d0c76d
#13 4.391 Installing collected packages: boolean-py, binaryornot, setuptools, reuse, python-debian, markupsafe, license-expression, jinja2, chardet
#13 4.415   Attempting uninstall: setuptools
#13 4.415     Found existing installation: setuptools 59.6.0
#13 4.417     Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
---
    Checking rustc_incremental v0.0.0 (/checkout/compiler/rustc_incremental)
error[E0308]: mismatched types
   --> compiler/rustc_infer/src/infer/mod.rs:902:17
    |
891 |     pub fn commit_if_ok<T, E, F>(&self, f: F) -> Result<T, E>
    |                                                  ------------ expected `Result<T, E>` because of return type
902 |                 Some(value)
902 |                 Some(value)
    |                 ^^^^^^^^^^^ expected `Result<T, E>`, found `Option<T>`
    = note: expected enum `Result<T, E>`
               found enum `std::option::Option<T>`

For more information about this error, try `rustc --explain E0308`.

@compiler-errors
Copy link
Member

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 21, 2024
@bors
Copy link
Contributor

bors commented Feb 23, 2024

☔ The latest upstream changes (presumably #120730) made this pull request unmergeable. Please resolve the merge conflicts.

@lcnr
Copy link
Contributor Author

lcnr commented Mar 8, 2024

closing in favor of #122189

@lcnr lcnr closed this Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants