about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-06-21 20:08:10 +0900
committerGitHub <noreply@github.com>2022-06-21 20:08:10 +0900
commita7f789b5023226c585b9d5dd652054501c5e2e94 (patch)
tree5f7bf41fcd6357b309cdef12c04439bd60127bd2 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent9c800ec4e97ec92c5b9b2ae2bd3f2aeeb4146df6 (diff)
parentccf6124bd972ed2b0995f98a86554d201b8ac5c7 (diff)
downloadrust-a7f789b5023226c585b9d5dd652054501c5e2e94.tar.gz
rust-a7f789b5023226c585b9d5dd652054501c5e2e94.zip
Rollup merge of #98022 - compiler-errors:erroneous-borrowck-span, r=oli-obk
Fix erroneous span for borrowck error

I am not confident that this is the correct fix, but it does the job. Open to suggestions for a real fix instead.

Fixes #97997

The issue is that we pass a [dummy location](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_middle/mir/visit.rs.html#302) when type-checking the ["required consts"](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/mir/struct.Body.html#structfield.required_consts) that are needed by the MIR body during borrowck. This means that when we fail to evaluate the constant, we use the span of `bb0[0]`, instead of the actual span of the constant.

There are quite a few other places that use `START_BLOCK.start_location()`, `Location::START`, etc. when calling for a random/unspecified `Location` value. This is because, unlike (for example) `Span`, we don't have a dummy/miscellaneous value to use instead. I would appreciate guidance (either in this PR, or a follow-up) on what needs to be done to clean this up in general.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions