-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Normalize bounds fully when checking defaulted types #74670
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
Conversation
Friendly ping, can I get a review? |
Can you try replacing the value of |
That worked! Note that I now add the predicate unconditionally (removing the branch on |
@bors r+ |
📌 Commit e35d286 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
When checking that the default type for
<T as X>::Y
is valid in this example:We will have to prove the bound
S: PartialEq<<T as X>::Y>
. In this casewe want
<T as X>::Y
to normalize toS
. This is valid because we arechecking the default value specifically here. Add
<T as X>::Y = S
to theParamEnv for normalization of the bound we are checking only.
Fixes #73818.
I noticed that adding this to the env for bounds checking didn't break any tests. Not sure if this is because we can't rely on it to prove anything, or because of missing test coverage.
r? @matthewjasper, @nikomatsakis