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

Don't create dummy if val has escaping bounds var #105694

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

ouz-a
Copy link
Contributor

@ouz-a ouz-a commented Dec 14, 2022

Skips creating/pushing obligations if val has escaping bounds vars.

Fixes #105689

@rustbot
Copy link
Collaborator

rustbot commented Dec 14, 2022

r? @estebank

(rustbot has picked a reviewer for you, use r? to override)

@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. labels Dec 14, 2022
@estebank
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 15, 2022

📌 Commit 75cf31f has been approved by estebank

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 15, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 15, 2022
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#105481 (Start improving monomorphization items stats)
 - rust-lang#105674 (Point at method chains on `E0271` errors)
 - rust-lang#105679 (Suggest constraining type parameter with `Clone`)
 - rust-lang#105694 (Don't create dummy if val has escaping bounds var)
 - rust-lang#105727 (Tweak output for bare `dyn Trait` in arguments)
 - rust-lang#105739 (Migrate Jump to def links background to CSS variable)
 - rust-lang#105743 (`SimplifiedType` cleanups)
 - rust-lang#105758 (Move `TypeckResults` to separate module)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 24e584b into rust-lang:master Dec 16, 2022
@rustbot rustbot added this to the 1.68.0 milestone Dec 16, 2022
self.param_env,
predicate,
));
if !ct.has_escaping_bound_vars() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this fixes the ICE this is probably unsound around inline consts and const generics.

We should not skip logic if there are excess bound vars outside of possibly diagnostics. The right fix here would be to find out where the binder was skipped and stop doing that. This will require wrappig some function arguments in binders at call sites to the current function.

Copy link
Contributor

@oli-obk oli-obk Dec 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah... this is "ok" because it can't cause unsoundness at present and fixing it in the way I described would cause errors about things having to live for 'static.

Please add a comment explaining why not adding these obligations is ok

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm not really sure how I feel about this change overall. I don't like adding yet another place that we're not registering WF with bound vars.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm willing to work on another solution, but I am not sure where to start for that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could keep the binders around, but then we'd do higher ranked trait solving which just tells us that all lifetimes must be 'static. So basically turning the ICE into an error

@ouz-a ouz-a deleted the issue_105689 branch July 26, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: generic_const_exprs: ConstEvaluatable has escaping bound vars, so it cannot be wrapped in a dummy binder.
6 participants