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

generalizing projections is sus #11

Closed
lcnr opened this issue Mar 23, 2023 · 1 comment
Closed

generalizing projections is sus #11

lcnr opened this issue Mar 23, 2023 · 1 comment

Comments

@lcnr
Copy link
Owner

lcnr commented Mar 23, 2023

when generalizing a projection we have to be careful of 2 things, using ?ident.universe for inference variables in a given universe.

?x sub <() as Trait<?y>>::Assoc

must not generalize ?x to <() as Trait<?y>>::Assoc as ?x may get inferred to a subtype of the normalized projection. Otherwise this would be incomplete. Should emit AliasRelate in this case instead.

?x.0 eq <() as Trait<?y.1>>::Assoc

This must not generalize ?x.0 to <() as Trait<?z.1>>::Assoc because that should result in a universe error but it must also not relate it to <() as Trait<?z.0>>::Assoc because the projection may not actually normalize to a type mentioning z so if we then equate the substs in AliasRelate we end up pulling down the universe of ?y to 0 as well which would be incomplete. Should instead emit AliasRelate(?x.0, <() as Trait<?y.1>>::Assoc, Equate).

@lcnr
Copy link
Owner Author

lcnr commented Apr 17, 2023

closed in favor of rust-lang/trait-system-refactor-initiative#8

@lcnr lcnr closed this as completed Apr 17, 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