fix: Implement mixed site hygiene #18264
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The realization that made me do this (as explained in detail in the first commit) is that while def-site hygiene is incredibly hard for us, mixed-site hygiene should be easy (well, I underestimated it due to the need of the second commit, but still). And the best part in that is that mixed-site hygiene rules: def-site hygiene is available only on nightly and without a clear path to stabilization, and even when (if) it will stabilize this will still help solving the case of variables/labels.
This brings diagnostics on self down to four (from five, I think? or more) 🎉 and the remaining diagnostics all require next solver (three due to coercion issue, one due to the issue of trait bounds not being preferred).
Best reviewed commit by commit.
Fixes #18262.
Fixes #16342.
Fixes #13758.
Fixes #11681.
Fixes #10535.
(Wow, so many issues! That's heart-filling ❤️)