Move some utils out of rustc_const_eval

This allows us to get rid of the `rustc_const_eval->rustc_borrowck`
dependency edge which was delaying the compilation of borrowck.

The added utils in `rustc_middle` are small and should not affect
compile times there.
This commit is contained in:
Nilstrieb 2023-04-16 12:03:39 +02:00
parent e6e956dade
commit 2109fe4e4e
15 changed files with 30 additions and 25 deletions

View file

@ -134,7 +134,12 @@ impl<'tcx> Visitor<'tcx> for ConstMutationChecker<'_, 'tcx> {
// the `self` parameter of a method call (as the terminator of our current
// BasicBlock). If so, we emit a more specific lint.
let method_did = self.target_local.and_then(|target_local| {
crate::util::find_self_call(self.tcx, &self.body, target_local, loc.block)
rustc_middle::util::find_self_call(
self.tcx,
&self.body,
target_local,
loc.block,
)
});
let lint_loc =
if method_did.is_some() { self.body.terminator_loc(loc.block) } else { loc };