diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-09-18 17:20:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-18 17:20:57 +0200 |
| commit | b7ab58eb4d6bc12907f2a13c490ac26d53356c85 (patch) | |
| tree | 7ad1c3ace059bba8b56bd09cd51e213b4d10ffbc /compiler/rustc_const_eval | |
| parent | fd852f4bee1e8cc7a0d5a287f055b03192656571 (diff) | |
| parent | 6912631d3ead427848a559ef5af66ab6f30e79ed (diff) | |
| download | rust-b7ab58eb4d6bc12907f2a13c490ac26d53356c85.tar.gz rust-b7ab58eb4d6bc12907f2a13c490ac26d53356c85.zip | |
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
Diffstat (limited to 'compiler/rustc_const_eval')
| -rw-r--r-- | compiler/rustc_const_eval/src/const_eval/valtrees.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_const_eval/src/const_eval/valtrees.rs b/compiler/rustc_const_eval/src/const_eval/valtrees.rs index 37c6c4a61d8..7c41258ebfe 100644 --- a/compiler/rustc_const_eval/src/const_eval/valtrees.rs +++ b/compiler/rustc_const_eval/src/const_eval/valtrees.rs @@ -1,6 +1,7 @@ use rustc_abi::{BackendRepr, FieldIdx, VariantIdx}; use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_middle::mir::interpret::{EvalToValTreeResult, GlobalId, ValTreeCreationError}; +use rustc_middle::traits::ObligationCause; use rustc_middle::ty::layout::{LayoutCx, TyAndLayout}; use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_middle::{bug, mir}; @@ -196,6 +197,7 @@ fn reconstruct_place_meta<'tcx>( // Traverse the type, and update `last_valtree` as we go. let tail = tcx.struct_tail_raw( layout.ty, + &ObligationCause::dummy(), |ty| ty, || { let branches = last_valtree.unwrap_branch(); |
