Rollup merge of #146597 - modhanami:add-struct-tail-recursion-limit-span, r=oli-obk

Add span for struct tail recursion limit error

Fixes rust-lang/rust#135629

Changes
1. Add span to RecursionLimitReached
2. Add ObligationCause parameter to struct_tail_raw
4. Update call sites to pass nearby ObligationCause or create one
5. Update affected .stderr
This commit is contained in:
Matthias Krüger
2025-09-18 17:20:57 +02:00
committed by GitHub
19 changed files with 111 additions and 65 deletions

View File

@@ -1057,6 +1057,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
Some(LangItem::PointeeTrait) => {
let tail = selcx.tcx().struct_tail_raw(
self_ty,
&obligation.cause,
|ty| {
// We throw away any obligations we get from this, since we normalize
// and confirm these obligations once again during confirmation