]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #98549 - RalfJung:interpret-stacktraces, r=oli-obk
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>
Wed, 29 Jun 2022 04:58:23 +0000 (10:28 +0530)
committerGitHub <noreply@github.com>
Wed, 29 Jun 2022 04:58:23 +0000 (10:28 +0530)
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``


Trivial merge