Only make GAT ambiguous in match_projection_projections considering shallow resolvability#125214
Merged
bors merged 1 commit intorust-lang:masterfrom May 18, 2024
Merged
Conversation
ed46830 to
3518606
Compare
compiler-errors
commented
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() |
Contributor
Author
There was a problem hiding this comment.
this has_non_region_infer is technically redundant
This comment has been minimized.
This comment has been minimized.
…hallow resolvability
3518606 to
fa829fe
Compare
Contributor
|
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 |
Collaborator
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
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`
Contributor
Merged
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
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
May 15, 2025
…piler-errors normalization: avoid incompletely constraining GAT args We need to copy the behavior of rust-lang#125214 in the new solver. This fixes rust-lang/trait-system-refactor-initiative#202 which seems to be the cause of the regression in `deptypes`. r? `@compiler-errors`
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this pull request
May 15, 2025
…piler-errors normalization: avoid incompletely constraining GAT args We need to copy the behavior of rust-lang#125214 in the new solver. This fixes rust-lang/trait-system-refactor-initiative#202 which seems to be the cause of the regression in `deptypes`. r? ``@compiler-errors``
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
May 15, 2025
…piler-errors normalization: avoid incompletely constraining GAT args We need to copy the behavior of rust-lang#125214 in the new solver. This fixes rust-lang/trait-system-refactor-initiative#202 which seems to be the cause of the regression in `deptypes`. r? ```@compiler-errors```
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 16, 2025
Rollup merge of rust-lang#140712 - lcnr:normalization-gat-args, r=compiler-errors normalization: avoid incompletely constraining GAT args We need to copy the behavior of rust-lang#125214 in the new solver. This fixes rust-lang/trait-system-refactor-initiative#202 which seems to be the cause of the regression in `deptypes`. r? ```@compiler-errors```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #123537, I tweaked the hack from #93892 to use
resolve_vars_if_possibleinstead ofshallow_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