-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
[WIP] Check more things for well-formedness #25701
Conversation
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
Because we don't check the well-formedness of region relationships of an impl's on the Self-type, or infer region relationss from them, many impls now have to specify their region relations, making this a [breaking-change]. The most common pattern I found that is now broken is that impl<'a, T> IntoIterator for &'a Collection<T> { type Item = &'a T; type IntoIter = ...; } now has to specify its `T: 'a` bound.
They don't do anything ATM. This is a [breaking-change]
☔ The latest upstream changes (presumably #25609) made this pull request unmergeable. Please resolve the merge conflicts. |
Hmm, I think this PR deserves a bit of thought. First, I've never been happy with the Second, I do think we should consider just when/where to enforce WF and trait requirements (and where to infer region relationships). The current policy is that we enforce all WF/trait requirements "everywhere" except that it is haphazardly enforced; but it's not totally clear to me that this is the best policy. Certainly the changes here seem ergonomically costly. I have to mull this a bit to form my opinion. (Note that enforcing WF in struct definitions, for example, was done deliberately in order to allow us to obviate things like In any case, certainly this change is breaking enough that we would want to start considering the steps and mitigation measures from (pending) RFC rust-lang/rfcs#1122. cc @rust-lang/lang |
ps @arielb1 just to be clear, thanks very much for the PR! I'm not intending those previous comments as a critique of the PR per se, just pointing out that we want to think about these changes and approach them the right way. |
@nikomatsakis I think it would be good to clean or clarify the relationship between |
Closing due to inactivity, but feel free to reopen with a rebase! |
Makes wf check more bounds (hopefully all of them).
Fixes #21748
Fixes #25692
Fixes #25388
Because it makes the rules stricter, this is technically a
[breaking-change]