rust/compiler/rustc_const_eval/src/interpret
Dylan DPC 021d21c888
Rollup merge of #98549 - RalfJung:interpret-stacktraces, r=oli-obk
interpret: do not prune requires_caller_location stack frames quite so early

https://github.com/rust-lang/rust/pull/87000 made the interpreter skip `caller_location` frames for its stacktraces and `cur_span`. However, those functions are used for much more than just panic reporting, and e.g. when Miri reports UB somewhere, it probably wants to point inside `caller_location` frames. (And if it did not, it would want to have its own logic to decide that, not be forced into it by the core interpreter engine.) This fixes some rare ICEs in Miri that say "we should never pop more than one frame at once".

So let's remove all `caller_location` logic from the core interpreter, and instead move it to CTFE error reporting. This does not change user-visible behavior. That's the first commit.

We might additionally want to change CTFE error reporting to treat panics differently from other errors: only prune `caller_location` frames for panics. The second commit does that. But honestly I am not sure if this is an improvement.

r? ``@oli-obk``
2022-06-29 10:28:23 +05:30
..
intrinsics tweak some bug!s 2022-06-04 11:15:36 -04:00
cast.rs Allow ptr_from_addr_cast to fail 2022-06-05 10:53:35 -04:00
eval_context.rs interpret: do not prune requires_caller_location stack frames quite so early 2022-06-26 14:42:26 -04:00
intern.rs interpret: err instead of ICE on size mismatches in to_bits_or_ptr_internal 2022-04-07 16:24:48 -04:00
intrinsics.rs interpret: unify offset_from check with offset check 2022-06-09 20:47:06 -04:00
machine.rs interpret: convert_tag_add_extra, init_allocation_extra: allow tagger to raise errors 2022-06-16 09:41:07 -07:00
memory.rs interpret: refactor allocation info query 2022-06-26 22:49:40 -04:00
mod.rs make AllocKind actually public 2022-06-27 10:58:30 -04:00
operand.rs rebase 2022-06-14 17:57:51 +02:00
operator.rs tweak some bug!s 2022-06-04 11:15:36 -04:00
place.rs make sure miri ices when dereferencing a box 2022-06-15 18:39:23 -07:00
step.rs use precise spans for recursive const evaluation 2022-06-04 16:18:03 -04:00
terminator.rs interpret: do not claim UB until we looked more into variadic functions 2022-06-05 13:24:24 -04:00
traits.rs interpret: better control over whether we read data with provenance, and implicit provenance stripping where possible 2022-06-05 10:13:34 -04:00
util.rs Rename the ConstS::val field as kind. 2022-06-14 13:06:44 +10:00
validity.rs validating the vtable can lead to Stacked Borrows errors 2022-06-05 12:27:08 -04:00
visitor.rs Rename rustc_mir to rustc_const_eval. 2021-09-07 20:46:26 +02:00