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

intentional incompleteness #18

Closed
lcnr opened this issue May 26, 2023 · 2 comments
Closed

intentional incompleteness #18

lcnr opened this issue May 26, 2023 · 2 comments

Comments

@lcnr
Copy link

lcnr commented May 26, 2023

Trait solving has to be complete during coherence to be sound.

We however have a lot of stable code which depends on incompleteness. The new solver is intentionally incomplete when run outside of coherence.

try_merge_candidates

For trait and project goals, we fall back to only considering ParamEnv and AliasBound candidates if trying to merge all candidates failed.

This is similar to the behavior of the old solver. TODO: Do we incorrectly guide GAT substs inference rn, I think we may be missing a check there?

Why do we have to be incomplete here

TODO

AliasRelate

We prefer to relate the generic arguments of aliases over normalization in case of ambiguity.

Why do we have to be incomplete here

TODO

@lcnr
Copy link
Author

lcnr commented May 26, 2023

Relating generic arguments of aliases together with lazy norm results in the following test to pass:

https://github.com/rust-lang/rust/blob/be72f2587c91579406117f99fa332383d66b7dcd/tests/ui/traits/new-solver/alias_eq_substs_eq_not_intercrate.rs#L10-L22

@lcnr lcnr closed this as completed Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant