diff options
| author | Joshua Nelson <jyn514@gmail.com> | 2020-07-09 22:11:15 -0400 |
|---|---|---|
| committer | Joshua Nelson <jyn514@gmail.com> | 2020-07-15 10:54:05 -0400 |
| commit | cf844d2eabc8929edb0923d71ec6ff076ac3428b (patch) | |
| tree | cdc031b0329f738d7a94952da7355cc92c798b94 /src | |
| parent | d01044305a5f2eb177521f51a7d7bfaee1ccf688 (diff) | |
| download | rust-cf844d2eabc8929edb0923d71ec6ff076ac3428b.tar.gz rust-cf844d2eabc8929edb0923d71ec6ff076ac3428b.zip | |
Don't make typeck_tables_of public
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/check/mod.rs | 2 | ||||
| -rw-r--r-- | src/librustc_typeck/lib.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/core.rs | 6 |
3 files changed, 3 insertions, 7 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index 514600b4733..bc01da324b6 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 79e1585ce3c..9ba2545ba63 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 413faff283e..78b4456ba9c 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. |
