-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
prioritize param env candidates if they don't guide type inference #109724
Conversation
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs
Outdated
Show resolved
Hide resolved
response.value.certainty == Certainty::Yes | ||
&& response.has_no_inference_or_external_constraints() |
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.
Noting that while sound, returning yes if we find a candidate with no external constraint eventually may need to be weakened for lcnr/solver-woes#12 (comment) to compile.
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.
i hope to move the prioritization to compute_alias_eq_goal
instead and keep try_merge_candidates
complete. might not work out perfectly but that's my vibe here for now.
r=me, nits or not (i guess there's only like one nit, the rest are just observations) |
☔ The latest upstream changes (presumably #109734) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #109791) made this pull request unmergeable. Please resolve the merge conflicts. |
9e3928f
to
013472c
Compare
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.
r=me
@bors r=compiler-errors rollup |
Rollup of 6 pull requests Successful merges: - rust-lang#109724 (prioritize param env candidates if they don't guide type inference) - rust-lang#110021 (Fix a couple ICEs in the new `CastKind::Transmute` code) - rust-lang#110044 (Avoid some manual slice length calculation) - rust-lang#110115 (compiletest: Use remap-path-prefix only in CI) - rust-lang#110121 (Fix `x check --stage 1` when download-rustc is enabled) - rust-lang#110124 (Some clippy fixes in the compiler) Failed merges: - rust-lang#109752 (Stall auto trait assembly in new solver for int/float vars) r? `@ghost` `@rustbot` modify labels: rollup
intended to supersede #109579. We disable the prioritization during coherence to maintain completeness.
Long term we can hopefully replace this hack with adding OR to external constraints at which point the only relevant part when merging responses is whether they guide type inference in the same way.
Reuses
try_merge_responses
for assembly and the cleanest way to impl that was to actually split that so thattry_merge_responses
returnsNone
if we fail to merge them and then addflounder
which is used afterwards which is allowed to lower the certainty of our responses.If, in the future, we add the ability to merge candidates
YES: ?0 = Vec<u32>
andYES: ?0 = Vec<i32>
toAMBIG: ?0 = Vec<?1>
, this should happen inflounder
.r? @compiler-errors @BoxyUwU