a7f789b502
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. |
||
---|---|---|
.. | ||
complex.rs | ||
due-to-where-clause.rs | ||
due-to-where-clause.stderr | ||
hrtb-cache-issue-54302.rs | ||
hrtb-cache-issue-54302.stderr | ||
hrtb-conflate-regions.rs | ||
hrtb-conflate-regions.stderr | ||
hrtb-debruijn-in-receiver.rs | ||
hrtb-debruijn-in-receiver.stderr | ||
hrtb-exists-forall-fn.rs | ||
hrtb-exists-forall-fn.stderr | ||
hrtb-exists-forall-trait-contravariant.rs | ||
hrtb-exists-forall-trait-contravariant.stderr | ||
hrtb-exists-forall-trait-covariant.rs | ||
hrtb-exists-forall-trait-invariant.rs | ||
hrtb-exists-forall-trait-invariant.stderr | ||
hrtb-higher-ranker-supertraits-transitive.rs | ||
hrtb-higher-ranker-supertraits-transitive.stderr | ||
hrtb-higher-ranker-supertraits.rs | ||
hrtb-higher-ranker-supertraits.stderr | ||
hrtb-identity-fn-borrows.rs | ||
hrtb-identity-fn-borrows.stderr | ||
hrtb-just-for-static.rs | ||
hrtb-just-for-static.stderr | ||
hrtb-perfect-forwarding.polonius.stderr | ||
hrtb-perfect-forwarding.rs | ||
hrtb-perfect-forwarding.stderr | ||
issue-30786.rs | ||
issue-30786.stderr | ||
issue-46989.rs | ||
issue-46989.stderr | ||
issue-57639.rs | ||
issue-58451.rs | ||
issue-58451.stderr | ||
issue-62203-hrtb-ice.rs | ||
issue-62203-hrtb-ice.stderr | ||
issue-88446.rs | ||
issue-90177.rs | ||
issue-95034.rs | ||
issue-95034.stderr |