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

Remove specialized instance for PartialEq on Option #938

Open
xldenis opened this issue Feb 7, 2024 · 2 comments
Open

Remove specialized instance for PartialEq on Option #938

xldenis opened this issue Feb 7, 2024 · 2 comments

Comments

@xldenis
Copy link
Collaborator

xldenis commented Feb 7, 2024

Due to increased strictness in the checks performed by rustc in trait resolution, we had to specialize the extern_spec for Option. Otherwise, we would have an issue where the ParamEnv would contain a constraint of the form:

T : DeepModel<DeepModelTy = T::DeepModelTy>

which causes rustc to get very unhappy with us.

This appears due to the manner we extend the ParamEnv for functions with "inherited extern contracts" where we instantiate and concatenate their parameter environments. If during ParamEnv construction we throw away trivial constraints, (aka this one), we should be good.

ref: https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Unexpected.20trait.20resolution.20failure

@jhjourdan
Copy link
Collaborator

If during ParamEnv construction we throw away trivial constraints, (aka this one), we should be good.

It's actually rather a matter of transforming this constraint into T: DeepModel. This constraint actually tells something, we should not drop it!

@xldenis
Copy link
Collaborator Author

xldenis commented Feb 7, 2024

It's actually rather a matter of transforming this constraint into T: DeepModel. This constraint actually tells something, we should not drop it!

YEs, what's not said here is that there is already another T : DeepModel constraint in this environment so we should be able to throw out the problematic one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants