about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-09-24 14:06:10 +0000
committerbors <bors@rust-lang.org>2022-09-24 14:06:10 +0000
commitc217e07ea8a09eb28d5f6d8137594ada8775320c (patch)
treefdd95183e2a48cd3c1a56f2c3c4eb5861bfcaca9 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent6872a70343fd2e1dd5cc4a2710fae8373427bd3f (diff)
parent5f498cab13800da77be7f6450a8d5264d31b0d1f (diff)
downloadrust-c217e07ea8a09eb28d5f6d8137594ada8775320c.tar.gz
rust-c217e07ea8a09eb28d5f6d8137594ada8775320c.zip
Auto merge of #2537 - saethlin:dont-back-up-too-far, r=RalfJung
Don't back up past the caller when looking for an FnEntry span

Fixes https://github.com/rust-lang/miri/issues/2536

This adds a fix for the logic as well as a regression test. In the new test `tests/fail/stacked_borrows/fnentry_invalidation2.rs`, before this PR, we display this diagnostic:
```
help: <3278> was later invalidated at offsets [0x0..0xc] by a Unique FnEntry retag
  --> tests/fail/stacked_borrows/fnentry_invalidation2.rs:13:5
   |
13 |     inner(&mut t);
   |     ^^^^^^^^^^^^^
```
Which is very misleading. It is not this call itself, but what happens within the call that invalidates the tag we want. With this PR, we get:
```
help: <2798> was later invalidated at offsets [0x0..0xc] by a Unique FnEntry retag inside this call
  --> tests/fail/stacked_borrows/fnentry_invalidation2.rs:20:13
   |
20 |     let _ = t.sli.as_mut_ptr();
   |             ^^^^^^^^^^^^^^^^^^
```
Which is much better.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions