@@ -541,7 +541,7 @@ macro_rules! expand_if_cached {
541
541
/// Don't show the backtrace for query system by default
542
542
/// use `RUST_BACKTRACE=full` to show all the backtraces
543
543
#[ inline( never) ]
544
- pub fn __rust_begin_short_backtrace < F , T > ( f : F ) -> T
544
+ pub ( crate ) fn __rust_begin_short_backtrace < F , T > ( f : F ) -> T
545
545
where
546
546
F : FnOnce ( ) -> T ,
547
547
{
@@ -557,17 +557,17 @@ macro_rules! define_queries {
557
557
$( $( #[ $attr: meta] ) *
558
558
[ $( $modifiers: tt) * ] fn $name: ident( $( $K: tt) * ) -> $V: ty, ) * ) => {
559
559
560
- pub ( crate ) mod query_impl { $( pub mod $name {
560
+ pub ( crate ) mod query_impl { $( pub ( crate ) mod $name {
561
561
use super :: super :: * ;
562
562
use std:: marker:: PhantomData ;
563
563
564
- pub mod get_query_incr {
564
+ pub ( crate ) mod get_query_incr {
565
565
use super :: * ;
566
566
567
567
// Adding `__rust_end_short_backtrace` marker to backtraces so that we emit the frames
568
568
// when `RUST_BACKTRACE=1`, add a new mod with `$name` here is to allow duplicate naming
569
569
#[ inline( never) ]
570
- pub fn __rust_end_short_backtrace<' tcx>(
570
+ pub ( crate ) fn __rust_end_short_backtrace<' tcx>(
571
571
tcx: TyCtxt <' tcx>,
572
572
span: Span ,
573
573
key: queries:: $name:: Key <' tcx>,
@@ -585,11 +585,11 @@ macro_rules! define_queries {
585
585
}
586
586
}
587
587
588
- pub mod get_query_non_incr {
588
+ pub ( crate ) mod get_query_non_incr {
589
589
use super :: * ;
590
590
591
591
#[ inline( never) ]
592
- pub fn __rust_end_short_backtrace<' tcx>(
592
+ pub ( crate ) fn __rust_end_short_backtrace<' tcx>(
593
593
tcx: TyCtxt <' tcx>,
594
594
span: Span ,
595
595
key: queries:: $name:: Key <' tcx>,
@@ -604,7 +604,9 @@ macro_rules! define_queries {
604
604
}
605
605
}
606
606
607
- pub fn dynamic_query<' tcx>( ) -> DynamicQuery <' tcx, queries:: $name:: Storage <' tcx>> {
607
+ pub ( crate ) fn dynamic_query<' tcx>( )
608
+ -> DynamicQuery <' tcx, queries:: $name:: Storage <' tcx>>
609
+ {
608
610
DynamicQuery {
609
611
name: stringify!( $name) ,
610
612
eval_always: is_eval_always!( [ $( $modifiers) * ] ) ,
@@ -667,7 +669,7 @@ macro_rules! define_queries {
667
669
}
668
670
669
671
#[ derive( Copy , Clone , Default ) ]
670
- pub struct QueryType <' tcx> {
672
+ pub ( crate ) struct QueryType <' tcx> {
671
673
data: PhantomData <& ' tcx ( ) >
672
674
}
673
675
@@ -696,7 +698,7 @@ macro_rules! define_queries {
696
698
}
697
699
}
698
700
699
- pub fn try_collect_active_jobs<' tcx>( tcx: TyCtxt <' tcx>, qmap: & mut QueryMap ) {
701
+ pub ( crate ) fn try_collect_active_jobs<' tcx>( tcx: TyCtxt <' tcx>, qmap: & mut QueryMap ) {
700
702
let make_query = |tcx, key| {
701
703
let kind = rustc_middle:: dep_graph:: dep_kinds:: $name;
702
704
let name = stringify!( $name) ;
@@ -711,11 +713,17 @@ macro_rules! define_queries {
711
713
// don't `unwrap()` here, just manually check for `None` and do best-effort error
712
714
// reporting.
713
715
if res. is_none( ) {
714
- tracing:: warn!( "Failed to collect active jobs for query with name `{}`!" , stringify!( $name) ) ;
716
+ tracing:: warn!(
717
+ "Failed to collect active jobs for query with name `{}`!" ,
718
+ stringify!( $name)
719
+ ) ;
715
720
}
716
721
}
717
722
718
- pub fn alloc_self_profile_query_strings<' tcx>( tcx: TyCtxt <' tcx>, string_cache: & mut QueryKeyStringCache ) {
723
+ pub ( crate ) fn alloc_self_profile_query_strings<' tcx>(
724
+ tcx: TyCtxt <' tcx>,
725
+ string_cache: & mut QueryKeyStringCache
726
+ ) {
719
727
$crate:: profiling_support:: alloc_self_profile_query_strings_for_query_cache(
720
728
tcx,
721
729
stringify!( $name) ,
@@ -725,7 +733,7 @@ macro_rules! define_queries {
725
733
}
726
734
727
735
item_if_cached! { [ $( $modifiers) * ] {
728
- pub fn encode_query_results<' tcx>(
736
+ pub ( crate ) fn encode_query_results<' tcx>(
729
737
tcx: TyCtxt <' tcx>,
730
738
encoder: & mut CacheEncoder <' _, ' tcx>,
731
739
query_result_index: & mut EncodedDepNodeIndex
@@ -739,7 +747,7 @@ macro_rules! define_queries {
739
747
}
740
748
} }
741
749
742
- pub fn query_key_hash_verify<' tcx>( tcx: TyCtxt <' tcx>) {
750
+ pub ( crate ) fn query_key_hash_verify<' tcx>( tcx: TyCtxt <' tcx>) {
743
751
$crate:: plumbing:: query_key_hash_verify(
744
752
query_impl:: $name:: QueryType :: config( tcx) ,
745
753
QueryCtxt :: new( tcx) ,
@@ -795,7 +803,7 @@ macro_rules! define_queries {
795
803
use rustc_query_system:: dep_graph:: FingerprintStyle ;
796
804
797
805
// We use this for most things when incr. comp. is turned off.
798
- pub fn Null <' tcx>( ) -> DepKindStruct <' tcx> {
806
+ pub ( crate ) fn Null <' tcx>( ) -> DepKindStruct <' tcx> {
799
807
DepKindStruct {
800
808
is_anon: false ,
801
809
is_eval_always: false ,
@@ -807,7 +815,7 @@ macro_rules! define_queries {
807
815
}
808
816
809
817
// We use this for the forever-red node.
810
- pub fn Red <' tcx>( ) -> DepKindStruct <' tcx> {
818
+ pub ( crate ) fn Red <' tcx>( ) -> DepKindStruct <' tcx> {
811
819
DepKindStruct {
812
820
is_anon: false ,
813
821
is_eval_always: false ,
@@ -818,7 +826,7 @@ macro_rules! define_queries {
818
826
}
819
827
}
820
828
821
- pub fn TraitSelect <' tcx>( ) -> DepKindStruct <' tcx> {
829
+ pub ( crate ) fn TraitSelect <' tcx>( ) -> DepKindStruct <' tcx> {
822
830
DepKindStruct {
823
831
is_anon: true ,
824
832
is_eval_always: false ,
@@ -829,7 +837,7 @@ macro_rules! define_queries {
829
837
}
830
838
}
831
839
832
- pub fn CompileCodegenUnit <' tcx>( ) -> DepKindStruct <' tcx> {
840
+ pub ( crate ) fn CompileCodegenUnit <' tcx>( ) -> DepKindStruct <' tcx> {
833
841
DepKindStruct {
834
842
is_anon: false ,
835
843
is_eval_always: false ,
@@ -840,7 +848,7 @@ macro_rules! define_queries {
840
848
}
841
849
}
842
850
843
- pub fn CompileMonoItem <' tcx>( ) -> DepKindStruct <' tcx> {
851
+ pub ( crate ) fn CompileMonoItem <' tcx>( ) -> DepKindStruct <' tcx> {
844
852
DepKindStruct {
845
853
is_anon: false ,
846
854
is_eval_always: false ,
0 commit comments