/// Allows overriding default rustc query providers,
/// after `default_provide` has installed them.
- pub provide: Box<dyn Fn(&mut ty::query::Providers) + 'a>,
+ pub provide: Box<dyn Fn(&mut ty::query::Providers) + 'a + sync::Send>,
/// Same as `provide`, but only for non-local crates,
/// applied after `default_provide_extern`.
- pub provide_extern: Box<dyn Fn(&mut ty::query::Providers) + 'a>,
+ pub provide_extern: Box<dyn Fn(&mut ty::query::Providers) + 'a + sync::Send>,
}
impl<'a> CompileController<'a> {
pub fn basic() -> CompileController<'a> {
+ sync::assert_send::<Self>();
CompileController {
after_parse: PhaseController::basic(),
after_expand: PhaseController::basic(),
// If true then the compiler will try to run the callback even if the phase
// ends with an error. Note that this is not always possible.
pub run_callback_on_error: bool,
- pub callback: Box<dyn Fn(&mut CompileState) + 'a>,
+ pub callback: Box<dyn Fn(&mut CompileState) + 'a + sync::Send>,
}
impl<'a> PhaseController<'a> {
}
pub fn default_provide(providers: &mut ty::query::Providers) {
+ proc_macro_decls::provide(providers);
+ plugin::build::provide(providers);
hir::provide(providers);
borrowck::provide(providers);
mir::provide(providers);
typeck::provide(providers);
ty::provide(providers);
traits::provide(providers);
+ stability::provide(providers);
reachable::provide(providers);
rustc_passes::provide(providers);
rustc_traits::provide(providers);
middle::entry::find_entry_point(sess, &hir_map, name)
});
- sess.plugin_registrar_fn
- .set(time(sess, "looking for plugin registrar", || {
- plugin::build::find_plugin_registrar(sess.diagnostic(), &hir_map)
- }));
- sess.proc_macro_decls_static
- .set(proc_macro_decls::find(&hir_map));
-
- time(sess, "loop checking", || loops::check_crate(sess, &hir_map));
-
let mut local_providers = ty::query::Providers::default();
default_provide(&mut local_providers);
codegen_backend.provide(&mut local_providers);
|tcx| {
// Do some initialization of the DepGraph that can only be done with the
// tcx available.
- rustc_incremental::dep_graph_tcx_init(tcx);
+ time(sess, "dep graph tcx init", || rustc_incremental::dep_graph_tcx_init(tcx));
+
+ time(sess, "looking for plugin registrar", || {
+ plugin::build::find_plugin_registrar(tcx)
+ });
+
+ time(sess, "looking for derive registrar", || {
+ proc_macro_decls::find(tcx)
+ });
+
+ time(sess, "loop checking", || loops::check_crate(tcx));
time(sess, "attribute checking", || {
hir::check_attr::check_crate(tcx)