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

Only make GAT ambiguous in match_projection_projections considering shallow resolvability #125214

Merged
merged 1 commit into from
May 18, 2024

Conversation

compiler-errors
Copy link
Member

In #123537, I tweaked the hack from #93892 to use resolve_vars_if_possible instead of shallow_resolve. This considers more inference guidance ambiguous. This resulted in crater regressions in #125196.

I've effectively reverted the change to the old behavior. That being said, I don't like this behavior, but I'd rather keep it for now since #123537 was not meant to make any behavioral changes. See the attached example.

This also affects the new solver, for the record, which doesn't have any rules about not guiding inference from param-env candidates which may constrain GAT args as a side-effect.

r? @lcnr or @jackh726

@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 May 17, 2024
if !generics.own_params.is_empty()
&& obligation.predicate.args[generics.parent_count..].iter().any(|&p| {
p.has_non_region_infer() && self.infcx.resolve_vars_if_possible(p) != p
p.has_non_region_infer()
Copy link
Member Author

Choose a reason for hiding this comment

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

this has_non_region_infer is technically redundant

@rust-log-analyzer

This comment has been minimized.

@lcnr
Copy link
Contributor

lcnr commented May 18, 2024

cc @rust-lang/types this an accidental change to behavior. While I consider the reverted behavior to be preferable, we should only cause this breakage in a separate PR after an FCP and after making sure this behavior will be also be implemented in the new trait solver.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 18, 2024

📌 Commit fa829fe has been approved by lcnr

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 May 18, 2024
@lcnr lcnr added beta-nominated Nominated for backporting to the compiler in the beta channel. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 18, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 18, 2024
Rollup of 3 pull requests

Successful merges:

 - rust-lang#125214 (Only make GAT ambiguous in `match_projection_projections` considering shallow resolvability)
 - rust-lang#125236 (Add tests for `-Zunpretty=expanded` ported from stringify's tests)
 - rust-lang#125251 (Clarify how String::leak and into_boxed_str differ )

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f08746a into rust-lang:master May 18, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 18, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 18, 2024
Rollup merge of rust-lang#125214 - compiler-errors:gat-guide, r=lcnr

Only make GAT ambiguous in `match_projection_projections` considering shallow resolvability

In rust-lang#123537, I tweaked the hack from rust-lang#93892 to use `resolve_vars_if_possible` instead of `shallow_resolve`. This considers more inference guidance ambiguous. This resulted in crater regressions in rust-lang#125196.

I've effectively reverted the change to the old behavior. That being said, I don't *like* this behavior, but I'd rather keep it for now since rust-lang#123537 was not meant to make any behavioral changes. See the attached example.

This also affects the new solver, for the record, which doesn't have any rules about not guiding inference from param-env candidates which may constrain GAT args as a side-effect.

r? `@lcnr` or `@jackh726`
@apiraino
Copy link
Contributor

Beta backport approved as per compiler team on Zulip. A backport PR will be authored by the release team at the end of the current development cycle.

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label May 24, 2024
@cuviper cuviper mentioned this pull request May 25, 2024
@cuviper cuviper modified the milestones: 1.80.0, 1.79.0 May 25, 2024
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label May 25, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 25, 2024
[beta] backports

- Add `#[inline]` to float `Debug` fallback used by `cfg(no_fp_fmt_parse)` rust-lang#125252
- Add v0 symbol mangling for `f16` and `f128` rust-lang#123816
- Only make GAT ambiguous in `match_projection_projections` considering shallow resolvability rust-lang#125214
- Update to LLVM 18.1.6 rust-lang#125288

r? cuviper
bors added a commit to rust-lang-ci/rust that referenced this pull request May 25, 2024
[beta] backports

- Add `#[inline]` to float `Debug` fallback used by `cfg(no_fp_fmt_parse)` rust-lang#125252
- Add v0 symbol mangling for `f16` and `f128` rust-lang#123816
- Only make GAT ambiguous in `match_projection_projections` considering shallow resolvability rust-lang#125214
- Update to LLVM 18.1.6 rust-lang#125288

r? cuviper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants