This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -579,11 +579,11 @@ rustc_queries! {
579579 desc { |tcx| "type-checking `{}`" , tcx. def_path_str( key. to_def_id( ) ) }
580580 cache_on_disk_if { true }
581581 }
582- query typeck_tables_of_const_arg (
582+ query _typeck_tables_of_const_arg (
583583 key: ty:: WithOptParam <LocalDefId >
584584 ) -> & ' tcx ty:: TypeckTables <' tcx> {
585585 desc {
586- |tcx| "type-checking the potential const argument `{}`" ,
586+ |tcx| "type-checking the const argument `{}`" ,
587587 tcx. def_path_str( key. did. to_def_id( ) ) ,
588588 }
589589 }
Original file line number Diff line number Diff line change @@ -980,6 +980,17 @@ pub struct GlobalCtxt<'tcx> {
980980}
981981
982982impl < ' tcx > TyCtxt < ' tcx > {
983+ pub fn typeck_tables_of_const_arg (
984+ self ,
985+ def : ty:: WithOptParam < LocalDefId > ,
986+ ) -> & ' tcx TypeckTables < ' tcx > {
987+ if def. param_did . is_some ( ) {
988+ self . _typeck_tables_of_const_arg ( def)
989+ } else {
990+ self . typeck_tables_of ( def. did )
991+ }
992+ }
993+
983994 pub fn alloc_steal_mir ( self , mir : Body < ' tcx > ) -> & ' tcx Steal < Body < ' tcx > > {
984995 self . arena . alloc ( Steal :: new ( mir) )
985996 }
Original file line number Diff line number Diff line change @@ -764,7 +764,7 @@ pub fn provide(providers: &mut Providers) {
764764 method:: provide ( providers) ;
765765 * providers = Providers {
766766 typeck_item_bodies,
767- typeck_tables_of_const_arg,
767+ _typeck_tables_of_const_arg : typeck_tables_of_const_arg,
768768 typeck_tables_of,
769769 diagnostic_only_typeck_tables_of,
770770 has_typeck_tables,
@@ -964,7 +964,7 @@ fn typeck_tables_of_const_arg<'tcx>(
964964 let fallback = move || tcx. type_of ( param_did) ;
965965 typeck_tables_of_with_fallback ( tcx, def. did , fallback)
966966 } else {
967- tcx . typeck_tables_of ( def . did )
967+ bug ! ( "missing param_did" )
968968 }
969969}
970970
You can’t perform that action at this time.
0 commit comments