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

Do not ICE when we have fn pointer Fn obligations with bound vars in the self type #108834

Merged
merged 1 commit into from
Mar 11, 2023

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Mar 6, 2023

We never supported solving for<'a> fn(&'a ()): Fn(&'a ()) -- I tried to add that support in #104929, but iirc @lcnr wanted to support this more generally by eagerly instantiating trait predicate binders with placeholders. That never happened due to blockers in the old solver, but we probably shouldn't ICE in any case.

On the bright side, this passes on the new solver :^)

@rustbot
Copy link
Collaborator

rustbot commented Mar 6, 2023

r? @lcnr

(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 Mar 6, 2023
@compiler-errors
Copy link
Member Author

r? types (i've assigned lcnr a lot of prs already)

@rustbot rustbot assigned spastorino and unassigned lcnr Mar 7, 2023
@jackh726
Copy link
Member

jackh726 commented Mar 8, 2023

I don't think (at the very least) this should close #108832. Just not ICEing doesn't mean that it's "fixed" - this should pass. So, I would instead make the test a known-bug test.

That being said, why exactly doesn't this work? Do we not instantiate the predicate binder as placeholders when solving?

@compiler-errors
Copy link
Member Author

Do we not instantiate the predicate binder as placeholders when solving?

No, this is something that we don't do during trait selection in the old solver -- at least not for Fn obligations. We instead use confirm_poly_trait_refs, which does a higher-ranked sub.

@spastorino
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Mar 9, 2023

📌 Commit 4fe232b has been approved by spastorino

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 Mar 9, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 11, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#106921 (Add documentation about the memory layout of `Cell`)
 - rust-lang#108828 (Emit alias-eq when equating numeric var and projection)
 - rust-lang#108834 (Do not ICE when we have fn pointer `Fn` obligations with bound vars in the self type)
 - rust-lang#108900 (fix(lexer): print whitespace warning for \x0c)
 - rust-lang#108930 (feat: implement better error for manual impl of `Fn*` traits)
 - rust-lang#108937 (improve readability of winnowing)
 - rust-lang#108947 (Don't even try to combine consts with incompatible types)
 - rust-lang#108976 (Update triagebot rust-analyzer team mention)
 - rust-lang#108983 (Forbid `#[target_feature]` on safe default implementations)

Failed merges:

 - rust-lang#108950 (Directly construct Inherited in typeck.)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit bee8473 into rust-lang:master Mar 11, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 11, 2023
@compiler-errors compiler-errors deleted the fn-ptr-fn-obl branch August 11, 2023 20:01
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.

6 participants