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! {
579
579
desc { |tcx| "type-checking `{}`" , tcx. def_path_str( key. to_def_id( ) ) }
580
580
cache_on_disk_if { true }
581
581
}
582
- query typeck_tables_of_const_arg (
582
+ query _typeck_tables_of_const_arg (
583
583
key: ty:: WithOptParam <LocalDefId >
584
584
) -> & ' tcx ty:: TypeckTables <' tcx> {
585
585
desc {
586
- |tcx| "type-checking the potential const argument `{}`" ,
586
+ |tcx| "type-checking the const argument `{}`" ,
587
587
tcx. def_path_str( key. did. to_def_id( ) ) ,
588
588
}
589
589
}
Original file line number Diff line number Diff line change @@ -980,6 +980,17 @@ pub struct GlobalCtxt<'tcx> {
980
980
}
981
981
982
982
impl < ' 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
+
983
994
pub fn alloc_steal_mir ( self , mir : Body < ' tcx > ) -> & ' tcx Steal < Body < ' tcx > > {
984
995
self . arena . alloc ( Steal :: new ( mir) )
985
996
}
Original file line number Diff line number Diff line change @@ -764,7 +764,7 @@ pub fn provide(providers: &mut Providers) {
764
764
method:: provide ( providers) ;
765
765
* providers = Providers {
766
766
typeck_item_bodies,
767
- typeck_tables_of_const_arg,
767
+ _typeck_tables_of_const_arg : typeck_tables_of_const_arg,
768
768
typeck_tables_of,
769
769
diagnostic_only_typeck_tables_of,
770
770
has_typeck_tables,
@@ -964,7 +964,7 @@ fn typeck_tables_of_const_arg<'tcx>(
964
964
let fallback = move || tcx. type_of ( param_did) ;
965
965
typeck_tables_of_with_fallback ( tcx, def. did , fallback)
966
966
} else {
967
- tcx . typeck_tables_of ( def . did )
967
+ bug ! ( "missing param_did" )
968
968
}
969
969
}
970
970
You can’t perform that action at this time.
0 commit comments