diff options
Diffstat (limited to 'compiler/rustc_traits')
| -rw-r--r-- | compiler/rustc_traits/src/chalk/lowering.rs | 32 | ||||
| -rw-r--r-- | compiler/rustc_traits/src/chalk/mod.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_traits/src/dropck_outlives.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_traits/src/evaluate_obligation.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_traits/src/implied_outlives_bounds.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_traits/src/lib.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_traits/src/normalize_erasing_regions.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_traits/src/normalize_projection_ty.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_traits/src/type_op.rs | 2 |
9 files changed, 27 insertions, 28 deletions
diff --git a/compiler/rustc_traits/src/chalk/lowering.rs b/compiler/rustc_traits/src/chalk/lowering.rs index e3c865ce9e6..2b7ba22c4de 100644 --- a/compiler/rustc_traits/src/chalk/lowering.rs +++ b/compiler/rustc_traits/src/chalk/lowering.rs @@ -44,7 +44,7 @@ use std::collections::btree_map::{BTreeMap, Entry}; use std::ops::ControlFlow; /// Essentially an `Into` with a `&RustInterner` parameter -crate trait LowerInto<'tcx, T> { +pub(crate) trait LowerInto<'tcx, T> { /// Lower a rustc construct (e.g., `ty::TraitPredicate`) to a chalk type, consuming `self`. fn lower_into(self, interner: RustInterner<'tcx>) -> T; } @@ -836,7 +836,7 @@ impl<'tcx> LowerInto<'tcx, chalk_solve::rust_ir::AliasEqBound<RustInterner<'tcx> /// It's important to note that because of prior substitution, we may have /// late-bound regions, even outside of fn contexts, since this is the best way /// to prep types for chalk lowering. -crate fn collect_bound_vars<'tcx, T: TypeFoldable<'tcx>>( +pub(crate) fn collect_bound_vars<'tcx, T: TypeFoldable<'tcx>>( interner: RustInterner<'tcx>, tcx: TyCtxt<'tcx>, ty: Binder<'tcx, T>, @@ -870,14 +870,14 @@ crate fn collect_bound_vars<'tcx, T: TypeFoldable<'tcx>>( (new_ty, binders, named_parameters) } -crate struct BoundVarsCollector<'tcx> { +pub(crate) struct BoundVarsCollector<'tcx> { binder_index: ty::DebruijnIndex, - crate parameters: BTreeMap<u32, chalk_ir::VariableKind<RustInterner<'tcx>>>, - crate named_parameters: Vec<DefId>, + pub(crate) parameters: BTreeMap<u32, chalk_ir::VariableKind<RustInterner<'tcx>>>, + pub(crate) named_parameters: Vec<DefId>, } impl<'tcx> BoundVarsCollector<'tcx> { - crate fn new() -> Self { + pub(crate) fn new() -> Self { BoundVarsCollector { binder_index: ty::INNERMOST, parameters: BTreeMap::new(), @@ -1001,17 +1001,17 @@ impl<'a, 'tcx> TypeFolder<'tcx> for NamedBoundVarSubstitutor<'a, 'tcx> { /// Used to substitute `Param`s with placeholders. We do this since Chalk /// have a notion of `Param`s. -crate struct ParamsSubstitutor<'tcx> { +pub(crate) struct ParamsSubstitutor<'tcx> { tcx: TyCtxt<'tcx>, binder_index: ty::DebruijnIndex, list: Vec<rustc_middle::ty::ParamTy>, next_ty_placeholder: usize, - crate params: rustc_data_structures::fx::FxHashMap<usize, rustc_middle::ty::ParamTy>, - crate named_regions: BTreeMap<DefId, u32>, + pub(crate) params: rustc_data_structures::fx::FxHashMap<usize, rustc_middle::ty::ParamTy>, + pub(crate) named_regions: BTreeMap<DefId, u32>, } impl<'tcx> ParamsSubstitutor<'tcx> { - crate fn new(tcx: TyCtxt<'tcx>, next_ty_placeholder: usize) -> Self { + pub(crate) fn new(tcx: TyCtxt<'tcx>, next_ty_placeholder: usize) -> Self { ParamsSubstitutor { tcx, binder_index: ty::INNERMOST, @@ -1083,13 +1083,13 @@ impl<'tcx> TypeFolder<'tcx> for ParamsSubstitutor<'tcx> { } } -crate struct ReverseParamsSubstitutor<'tcx> { +pub(crate) struct ReverseParamsSubstitutor<'tcx> { tcx: TyCtxt<'tcx>, params: rustc_data_structures::fx::FxHashMap<usize, rustc_middle::ty::ParamTy>, } impl<'tcx> ReverseParamsSubstitutor<'tcx> { - crate fn new( + pub(crate) fn new( tcx: TyCtxt<'tcx>, params: rustc_data_structures::fx::FxHashMap<usize, rustc_middle::ty::ParamTy>, ) -> Self { @@ -1117,14 +1117,14 @@ impl<'tcx> TypeFolder<'tcx> for ReverseParamsSubstitutor<'tcx> { } /// Used to collect `Placeholder`s. -crate struct PlaceholdersCollector { +pub(crate) struct PlaceholdersCollector { universe_index: ty::UniverseIndex, - crate next_ty_placeholder: usize, - crate next_anon_region_placeholder: u32, + pub(crate) next_ty_placeholder: usize, + pub(crate) next_anon_region_placeholder: u32, } impl PlaceholdersCollector { - crate fn new() -> Self { + pub(crate) fn new() -> Self { PlaceholdersCollector { universe_index: ty::UniverseIndex::ROOT, next_ty_placeholder: 0, diff --git a/compiler/rustc_traits/src/chalk/mod.rs b/compiler/rustc_traits/src/chalk/mod.rs index 4e19479da87..59cf37fee9c 100644 --- a/compiler/rustc_traits/src/chalk/mod.rs +++ b/compiler/rustc_traits/src/chalk/mod.rs @@ -3,8 +3,8 @@ //! In order to call `chalk-solve`, this file must convert a `CanonicalChalkEnvironmentAndGoal` into //! a Chalk uncanonical goal. It then calls Chalk, and converts the answer back into rustc solution. -crate mod db; -crate mod lowering; +pub(crate) mod db; +pub(crate) mod lowering; use rustc_data_structures::fx::FxHashMap; @@ -27,11 +27,11 @@ use crate::chalk::lowering::{ParamsSubstitutor, PlaceholdersCollector, ReversePa use chalk_solve::Solution; -crate fn provide(p: &mut Providers) { +pub(crate) fn provide(p: &mut Providers) { *p = Providers { evaluate_goal, ..*p }; } -crate fn evaluate_goal<'tcx>( +pub(crate) fn evaluate_goal<'tcx>( tcx: TyCtxt<'tcx>, obligation: CanonicalChalkEnvironmentAndGoal<'tcx>, ) -> Result<&'tcx Canonical<'tcx, QueryResponse<'tcx, ()>>, traits::query::NoSolution> { diff --git a/compiler/rustc_traits/src/dropck_outlives.rs b/compiler/rustc_traits/src/dropck_outlives.rs index 3fd0bb1814a..a20de08b4ef 100644 --- a/compiler/rustc_traits/src/dropck_outlives.rs +++ b/compiler/rustc_traits/src/dropck_outlives.rs @@ -17,7 +17,7 @@ use rustc_trait_selection::traits::{ Normalized, ObligationCause, TraitEngine, TraitEngineExt as _, }; -crate fn provide(p: &mut Providers) { +pub(crate) fn provide(p: &mut Providers) { *p = Providers { dropck_outlives, adt_dtorck_constraint, ..*p }; } @@ -304,7 +304,7 @@ fn dtorck_constraint_for_ty<'tcx>( } /// Calculates the dtorck constraint for a type. -crate fn adt_dtorck_constraint( +pub(crate) fn adt_dtorck_constraint( tcx: TyCtxt<'_>, def_id: DefId, ) -> Result<&DropckConstraint<'_>, NoSolution> { diff --git a/compiler/rustc_traits/src/evaluate_obligation.rs b/compiler/rustc_traits/src/evaluate_obligation.rs index 2404b7ff4b5..3fc141471b9 100644 --- a/compiler/rustc_traits/src/evaluate_obligation.rs +++ b/compiler/rustc_traits/src/evaluate_obligation.rs @@ -7,7 +7,7 @@ use rustc_trait_selection::traits::{ EvaluationResult, Obligation, ObligationCause, OverflowError, SelectionContext, TraitQueryMode, }; -crate fn provide(p: &mut Providers) { +pub(crate) fn provide(p: &mut Providers) { *p = Providers { evaluate_obligation, ..*p }; } diff --git a/compiler/rustc_traits/src/implied_outlives_bounds.rs b/compiler/rustc_traits/src/implied_outlives_bounds.rs index 90c698db8fb..965324113d5 100644 --- a/compiler/rustc_traits/src/implied_outlives_bounds.rs +++ b/compiler/rustc_traits/src/implied_outlives_bounds.rs @@ -18,7 +18,7 @@ use rustc_trait_selection::traits::FulfillmentContext; use rustc_trait_selection::traits::TraitEngine; use smallvec::{smallvec, SmallVec}; -crate fn provide(p: &mut Providers) { +pub(crate) fn provide(p: &mut Providers) { *p = Providers { implied_outlives_bounds, ..*p }; } diff --git a/compiler/rustc_traits/src/lib.rs b/compiler/rustc_traits/src/lib.rs index 73fd95e98ca..6489bd2202d 100644 --- a/compiler/rustc_traits/src/lib.rs +++ b/compiler/rustc_traits/src/lib.rs @@ -1,7 +1,6 @@ //! New recursive solver modeled on Chalk's recursive solver. Most of //! the guts are broken up into modules; see the comments in those modules. -#![feature(crate_visibility_modifier)] #![feature(let_else)] #![feature(nll)] #![recursion_limit = "256"] diff --git a/compiler/rustc_traits/src/normalize_erasing_regions.rs b/compiler/rustc_traits/src/normalize_erasing_regions.rs index a4aa965ec95..a8a324dec97 100644 --- a/compiler/rustc_traits/src/normalize_erasing_regions.rs +++ b/compiler/rustc_traits/src/normalize_erasing_regions.rs @@ -6,7 +6,7 @@ use rustc_trait_selection::traits::query::normalize::AtExt; use rustc_trait_selection::traits::{Normalized, ObligationCause}; use std::sync::atomic::Ordering; -crate fn provide(p: &mut Providers) { +pub(crate) fn provide(p: &mut Providers) { *p = Providers { try_normalize_generic_arg_after_erasing_regions: |tcx, goal| { debug!("try_normalize_generic_arg_after_erasing_regions(goal={:#?}", goal); diff --git a/compiler/rustc_traits/src/normalize_projection_ty.rs b/compiler/rustc_traits/src/normalize_projection_ty.rs index 1de50bae31b..98bb42c9afd 100644 --- a/compiler/rustc_traits/src/normalize_projection_ty.rs +++ b/compiler/rustc_traits/src/normalize_projection_ty.rs @@ -10,7 +10,7 @@ use rustc_trait_selection::traits::query::{ use rustc_trait_selection::traits::{self, ObligationCause, SelectionContext}; use std::sync::atomic::Ordering; -crate fn provide(p: &mut Providers) { +pub(crate) fn provide(p: &mut Providers) { *p = Providers { normalize_projection_ty, ..*p }; } diff --git a/compiler/rustc_traits/src/type_op.rs b/compiler/rustc_traits/src/type_op.rs index 861d3bc564f..f8bac1d7b26 100644 --- a/compiler/rustc_traits/src/type_op.rs +++ b/compiler/rustc_traits/src/type_op.rs @@ -23,7 +23,7 @@ use rustc_trait_selection::traits::query::{Fallible, NoSolution}; use rustc_trait_selection::traits::{Normalized, Obligation, ObligationCause, TraitEngine}; use std::fmt; -crate fn provide(p: &mut Providers) { +pub(crate) fn provide(p: &mut Providers) { *p = Providers { type_op_ascribe_user_type, type_op_eq, |
