-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Conversation
ed46830
to
3518606
Compare
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() |
There was a problem hiding this comment.
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
This comment has been minimized.
This comment has been minimized.
…hallow resolvability
3518606
to
fa829fe
Compare
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 |
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
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`
[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
[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
In #123537, I tweaked the hack from #93892 to use
resolve_vars_if_possible
instead 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