rust/compiler/rustc_borrowck
Yuki Okushi a7f789b502
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.
2022-06-21 20:08:10 +09:00
..
src Rollup merge of #98022 - compiler-errors:erroneous-borrowck-span, r=oli-obk 2022-06-21 20:08:10 +09:00
Cargo.toml Update itertools 2022-03-04 11:54:28 -06:00