Skip to content

Commit cf844d2

Browse files
committed
Don't make typeck_tables_of public
1 parent d010443 commit cf844d2

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ where
955955
val.fold_with(&mut FixupFolder { tcx })
956956
}
957957

958-
pub fn typeck_tables_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::TypeckTables<'tcx> {
958+
fn typeck_tables_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::TypeckTables<'tcx> {
959959
let fallback = move || tcx.type_of(def_id.to_def_id());
960960
typeck_tables_of_with_fallback(tcx, def_id, fallback)
961961
}

src/librustc_typeck/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ extern crate rustc_middle;
7878
pub mod expr_use_visitor;
7979

8080
mod astconv;
81-
pub mod check;
81+
mod check;
8282
mod check_unused;
8383
mod coherence;
8484
mod collect;

src/librustdoc/core.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,6 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
375375
override_queries: Some(|_sess, local_providers, external_providers| {
376376
local_providers.lint_mod = |_, _| {};
377377
external_providers.lint_mod = |_, _| {};
378-
//let old_typeck = local_providers.typeck_tables_of;
379378
local_providers.typeck_tables_of = move |tcx, def_id| {
380379
// Closures' tables come from their outermost function,
381380
// as they are part of the same "inference environment".
@@ -389,8 +388,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
389388
let body = hir.body(hir.body_owned_by(hir.as_local_hir_id(def_id)));
390389
debug!("visiting body for {:?}", def_id);
391390
EmitIgnoredResolutionErrors::new(&tcx.sess, hir).visit_body(body);
392-
rustc_typeck::check::typeck_tables_of(tcx, def_id)
393-
//DEFAULT_TYPECK.with(|typeck| typeck(tcx, def_id))
391+
DEFAULT_TYPECK.with(|typeck| typeck(tcx, def_id))
394392
};
395393
}),
396394
registry: rustc_driver::diagnostics_registry(),
@@ -596,13 +594,11 @@ use rustc_hir::{
596594
};
597595
use rustc_middle::hir::map::Map;
598596

599-
/*
600597
thread_local!(static DEFAULT_TYPECK: for<'tcx> fn(rustc_middle::ty::TyCtxt<'tcx>, rustc_span::def_id::LocalDefId) -> &'tcx rustc_middle::ty::TypeckTables<'tcx> = {
601598
let mut providers = rustc_middle::ty::query::Providers::default();
602599
rustc_typeck::provide(&mut providers);
603600
providers.typeck_tables_of
604601
});
605-
*/
606602

607603
/// Due to https://github.com/rust-lang/rust/pull/73566,
608604
/// the name resolution pass may find errors that are never emitted.

0 commit comments

Comments
 (0)