Fix rustdoc ICE caused by mishandling of ambiguity errors - #162782
Open
ShoyuVanilla wants to merge 1 commit into
Open
ShoyuVanilla wants to merge 1 commit into
ShoyuVanilla wants to merge 1 commit into
Conversation
Collaborator
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor These commits modify Please ensure that if you've changed the output:
cc @obi1kenobi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #162557
In the above minimization of the issue, when we try to check whether the blanket impl can be applied to
Verifier,rust/src/librustdoc/clean/blanket_impl.rs
Lines 42 to 67 in a8a1e6f
We make fresh args for the where-clause and skip normalization for it.
So, we have
<?MaybeVerify as Service<?Request>>::Future: 'staticbound to check. But it immediately evaluated into ambiguity due to stalled on infer vars in the fast path as the obligation contains the infer vars.But due #162182 we evaluated it directly in the solver without
stalled_onand this time it succeeded because we can normalize the alias into a concrete type&'static ()and it outlives the static region.So, I think it's very iffy to call
InferCtxt::evaluate_obligationon a non-rigid alias and we should eagerly normalize it inL67from the above rustdoc code.But it may break something in rustdoc as normalizations inside it is pretty messy in general 🫠 So, I guess in another PR with crater runs.
r? lcnr