@@ -16,7 +16,7 @@ use rustc_interface::interface;
1616use rustc_middle:: hir:: map:: Map ;
1717use rustc_middle:: middle:: cstore:: CrateStore ;
1818use rustc_middle:: middle:: privacy:: AccessLevels ;
19- use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
19+ use rustc_middle:: ty:: { Ty , TyCtxt } ;
2020use rustc_resolve as resolve;
2121use rustc_session:: config:: { self , CrateType , ErrorOutputType } ;
2222use rustc_session:: lint;
@@ -391,12 +391,6 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
391391 } ;
392392 // In case typeck does end up being called, don't ICE in case there were name resolution errors
393393 providers. typeck_tables_of = move |tcx, def_id| {
394- thread_local ! ( static DEFAULT_TYPECK : for <' tcx> fn ( TyCtxt <' tcx>, LocalDefId ) -> & ' tcx ty:: TypeckTables <' tcx> = {
395- let mut providers = ty:: query:: Providers :: default ( ) ;
396- rustc_typeck:: provide( & mut providers) ;
397- providers. typeck_tables_of
398- } ) ;
399-
400394 // Closures' tables come from their outermost function,
401395 // as they are part of the same "inference environment".
402396 // This avoids emitting errors for the parent twice (see similar code in `typeck_tables_of_with_fallback`)
@@ -409,7 +403,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
409403 let body = hir. body ( hir. body_owned_by ( hir. as_local_hir_id ( def_id) ) ) ;
410404 debug ! ( "visiting body for {:?}" , def_id) ;
411405 EmitIgnoredResolutionErrors :: new ( tcx) . visit_body ( body) ;
412- DEFAULT_TYPECK . with ( |typeck| typeck ( tcx, def_id) )
406+ ( rustc_interface :: DEFAULT_QUERY_PROVIDERS . typeck_tables_of ) ( tcx, def_id)
413407 } ;
414408 } ) ,
415409 registry : rustc_driver:: diagnostics_registry ( ) ,
0 commit comments