diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 514600b4733d..bc01da324b66 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -955,7 +955,7 @@ where val.fold_with(&mut FixupFolder { tcx }) } -pub fn typeck_tables_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::TypeckTables<'tcx> { +fn typeck_tables_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::TypeckTables<'tcx> { let fallback = move || tcx.type_of(def_id.to_def_id()); typeck_tables_of_with_fallback(tcx, def_id, fallback) } diff --git a/src/librustc_typeck/lib.rs b/src/librustc_typeck/lib.rs index 79e1585ce3cd..9ba2545ba63c 100644 --- a/src/librustc_typeck/lib.rs +++ b/src/librustc_typeck/lib.rs @@ -78,7 +78,7 @@ extern crate rustc_middle; pub mod expr_use_visitor; mod astconv; -pub mod check; +mod check; mod check_unused; mod coherence; mod collect; diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 413faff283e1..78b4456ba9c6 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -375,7 +375,6 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt override_queries: Some(|_sess, local_providers, external_providers| { local_providers.lint_mod = |_, _| {}; external_providers.lint_mod = |_, _| {}; - //let old_typeck = local_providers.typeck_tables_of; local_providers.typeck_tables_of = move |tcx, def_id| { // Closures' tables come from their outermost function, // as they are part of the same "inference environment". @@ -389,8 +388,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt let body = hir.body(hir.body_owned_by(hir.as_local_hir_id(def_id))); debug!("visiting body for {:?}", def_id); EmitIgnoredResolutionErrors::new(&tcx.sess, hir).visit_body(body); - rustc_typeck::check::typeck_tables_of(tcx, def_id) - //DEFAULT_TYPECK.with(|typeck| typeck(tcx, def_id)) + DEFAULT_TYPECK.with(|typeck| typeck(tcx, def_id)) }; }), registry: rustc_driver::diagnostics_registry(), @@ -596,13 +594,11 @@ use rustc_hir::{ }; use rustc_middle::hir::map::Map; -/* thread_local!(static DEFAULT_TYPECK: for<'tcx> fn(rustc_middle::ty::TyCtxt<'tcx>, rustc_span::def_id::LocalDefId) -> &'tcx rustc_middle::ty::TypeckTables<'tcx> = { let mut providers = rustc_middle::ty::query::Providers::default(); rustc_typeck::provide(&mut providers); providers.typeck_tables_of }); -*/ /// Due to https://github.com/rust-lang/rust/pull/73566, /// the name resolution pass may find errors that are never emitted.