Auto merge of #85830 - bjorn3:separate_provide_extern, r=cjgillot

Avoid a branch on key being local for queries that use the same local and extern providers

Currently based on https://github.com/rust-lang/rust/pull/85810 as it slightly conflicts with it. Only the last two commits are new.
This commit is contained in:
bors 2021-10-26 00:38:58 +00:00
commit 17e13b549f
12 changed files with 191 additions and 30 deletions

View file

@ -25,7 +25,7 @@ use rustc_hir::itemlikevisit::ItemLikeVisitor;
use rustc_interface::interface::Compiler;
use rustc_interface::{Config, Queries};
use rustc_middle::ty::query::query_values::mir_borrowck;
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::query::{ExternProviders, Providers};
use rustc_middle::ty::{self, TyCtxt};
use rustc_session::Session;
use std::cell::RefCell;
@ -87,9 +87,8 @@ impl rustc_driver::Callbacks for CompilerCalls {
}
}
fn override_queries(_session: &Session, local: &mut Providers, external: &mut Providers) {
fn override_queries(_session: &Session, local: &mut Providers, _external: &mut ExternProviders) {
local.mir_borrowck = mir_borrowck;
external.mir_borrowck = mir_borrowck;
}
// Since mir_borrowck does not have access to any other state, we need to use a