ignore higher-ranked object bound conditions created by WF #59132
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.
In the
issue-53548
test added in this PR, theBox<dyn Trait>
type is expanded toBox<dyn Trait + 'static>
, but the generator "witness" that results isfor<'r> { Box<dyn Trait + 'r> }
. The WF code was encountering an ICE (when debug-assertions were enabled) and an unexpected compilation error (without debug-asserions) when trying to process this'r
region bound. In particular, to be WF, the region bound must meet the requirements of the trait, and hence we gotfor<'r> { 'r: 'static }
. This would ICE because theBinder
constructor we were using was assering that no higher-ranked regions were involved (because the WF code is supposed to skip those). The error (if debug-asserions were disabled) came because we obviously cannot prove that'r: 'static
for any region'r
. Pursuant withour "lazy WF" strategy for higher-ranked regions, the fix is not to require that
for<'r> { 'r: 'static }
holds (this is also analogous to what we would do for higher-ranked regions appearing within the trait in other positions).Fixes #53548
r? @pnkfelix