Rollup merge of #152444 - ShoyuVanilla:unsized-recursion-limit, r=lcnr

`-Znext-solver` Prevent committing unfulfilled unsized coercion

Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/266

r? lcnr
This commit is contained in:
Stuart Cook 2026-02-13 15:19:12 +11:00 committed by GitHub
commit 0c0af5c6a8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 84 additions and 3 deletions

View file

@ -443,9 +443,10 @@ impl<'a, 'tcx> InspectGoal<'a, 'tcx> {
pub(crate) fn visit_with<V: ProofTreeVisitor<'tcx>>(&self, visitor: &mut V) -> V::Result {
if self.depth < visitor.config().max_depth {
try_visit!(visitor.visit_goal(self));
V::Result::output()
} else {
visitor.on_recursion_limit()
}
V::Result::output()
}
}
@ -460,6 +461,10 @@ pub trait ProofTreeVisitor<'tcx> {
}
fn visit_goal(&mut self, goal: &InspectGoal<'_, 'tcx>) -> Self::Result;
fn on_recursion_limit(&mut self) -> Self::Result {
Self::Result::output()
}
}
#[extension(pub trait InferCtxtProofTreeExt<'tcx>)]