Remove crate visibility usage in compiler

This commit is contained in:
Jacob Pratt
2022-05-20 19:51:09 -04:00
parent 536020c5f9
commit 49c82f31a8
186 changed files with 865 additions and 800 deletions

View File

@@ -17,7 +17,7 @@ pub struct FulfillmentContext<'tcx> {
}
impl FulfillmentContext<'_> {
crate fn new() -> Self {
pub(crate) fn new() -> Self {
FulfillmentContext {
obligations: FxIndexSet::default(),
relationships: FxHashMap::default(),

View File

@@ -1488,7 +1488,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
expected_ref: ty::PolyTraitRef<'tcx>,
found: ty::PolyTraitRef<'tcx>,
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
crate fn build_fn_sig_string<'tcx>(
pub(crate) fn build_fn_sig_string<'tcx>(
tcx: TyCtxt<'tcx>,
trait_ref: ty::PolyTraitRef<'tcx>,
) -> String {

View File

@@ -2116,7 +2116,7 @@ fn assoc_def(
}
}
crate trait ProjectionCacheKeyExt<'cx, 'tcx>: Sized {
pub(crate) trait ProjectionCacheKeyExt<'cx, 'tcx>: Sized {
fn from_poly_projection_predicate(
selcx: &mut SelectionContext<'cx, 'tcx>,
predicate: ty::PolyProjectionPredicate<'tcx>,

View File

@@ -332,7 +332,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
}
}
crate fn select_from_obligation(
pub(crate) fn select_from_obligation(
&mut self,
obligation: &TraitObligation<'tcx>,
) -> SelectionResult<'tcx, SelectionCandidate<'tcx>> {

View File

@@ -486,7 +486,7 @@ fn report_conflicting_impls(
/// Recovers the "impl X for Y" signature from `impl_def_id` and returns it as a
/// string.
crate fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Option<String> {
pub(crate) fn to_pretty_impl_header(tcx: TyCtxt<'_>, impl_def_id: DefId) -> Option<String> {
use std::fmt::Write;
let trait_ref = tcx.impl_trait_ref(impl_def_id)?;