pub(in super::super)
to pub(crate)
`super::super` of `rustc_hir_typeck::fn_ctxt::_impl` is just `rustc_hir_typeck`.
This commit is contained in:
parent
2293f1ed6a
commit
662eadbafb
1 changed files with 21 additions and 21 deletions
|
@ -46,7 +46,7 @@ use std::slice;
|
|||
impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
/// Produces warning on the given node, if the current point in the
|
||||
/// function is unreachable, and there hasn't been another warning.
|
||||
pub(in super::super) fn warn_if_unreachable(&self, id: HirId, span: Span, kind: &str) {
|
||||
pub(crate) fn warn_if_unreachable(&self, id: HirId, span: Span, kind: &str) {
|
||||
// FIXME: Combine these two 'if' expressions into one once
|
||||
// let chains are implemented
|
||||
if let Diverges::Always { span: orig_span, custom_note } = self.diverges.get() {
|
||||
|
@ -86,7 +86,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
// FIXME(-Znext-solver): A lot of the calls to this method should
|
||||
// probably be `try_structurally_resolve_type` or `structurally_resolve_type` instead.
|
||||
#[instrument(skip(self), level = "debug", ret)]
|
||||
pub(in super::super) fn resolve_vars_with_obligations(&self, mut ty: Ty<'tcx>) -> Ty<'tcx> {
|
||||
pub(crate) fn resolve_vars_with_obligations(&self, mut ty: Ty<'tcx>) -> Ty<'tcx> {
|
||||
// No Infer()? Nothing needs doing.
|
||||
if !ty.has_non_region_infer() {
|
||||
debug!("no inference var, nothing needs doing");
|
||||
|
@ -108,7 +108,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
self.resolve_vars_if_possible(ty)
|
||||
}
|
||||
|
||||
pub(in super::super) fn record_deferred_call_resolution(
|
||||
pub(crate) fn record_deferred_call_resolution(
|
||||
&self,
|
||||
closure_def_id: LocalDefId,
|
||||
r: DeferredCallResolution<'tcx>,
|
||||
|
@ -117,7 +117,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
deferred_call_resolutions.entry(closure_def_id).or_default().push(r);
|
||||
}
|
||||
|
||||
pub(in super::super) fn remove_deferred_call_resolutions(
|
||||
pub(crate) fn remove_deferred_call_resolutions(
|
||||
&self,
|
||||
closure_def_id: LocalDefId,
|
||||
) -> Vec<DeferredCallResolution<'tcx>> {
|
||||
|
@ -171,7 +171,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
pub(in super::super) fn write_resolution(
|
||||
pub(crate) fn write_resolution(
|
||||
&self,
|
||||
hir_id: HirId,
|
||||
r: Result<(DefKind, DefId), ErrorGuaranteed>,
|
||||
|
@ -335,7 +335,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
|
||||
/// Instantiates and normalizes the bounds for a given item
|
||||
pub(in super::super) fn instantiate_bounds(
|
||||
pub(crate) fn instantiate_bounds(
|
||||
&self,
|
||||
span: Span,
|
||||
def_id: DefId,
|
||||
|
@ -348,7 +348,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
result
|
||||
}
|
||||
|
||||
pub(in super::super) fn normalize<T>(&self, span: Span, value: T) -> T
|
||||
pub(crate) fn normalize<T>(&self, span: Span, value: T) -> T
|
||||
where
|
||||
T: TypeFoldable<TyCtxt<'tcx>>,
|
||||
{
|
||||
|
@ -536,7 +536,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
self.normalize(span, field.ty(self.tcx, args))
|
||||
}
|
||||
|
||||
pub(in super::super) fn resolve_rvalue_scopes(&self, def_id: DefId) {
|
||||
pub(crate) fn resolve_rvalue_scopes(&self, def_id: DefId) {
|
||||
let scope_tree = self.tcx.region_scope_tree(def_id);
|
||||
let rvalue_scopes = { rvalue_scopes::resolve_rvalue_scopes(self, scope_tree, def_id) };
|
||||
let mut typeck_results = self.typeck_results.borrow_mut();
|
||||
|
@ -552,7 +552,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
/// We must not attempt to select obligations after this method has run, or risk query cycle
|
||||
/// ICE.
|
||||
#[instrument(level = "debug", skip(self))]
|
||||
pub(in super::super) fn resolve_coroutine_interiors(&self) {
|
||||
pub(crate) fn resolve_coroutine_interiors(&self) {
|
||||
// Try selecting all obligations that are not blocked on inference variables.
|
||||
// Once we start unifying coroutine witnesses, trying to select obligations on them will
|
||||
// trigger query cycle ICEs, as doing so requires MIR.
|
||||
|
@ -593,7 +593,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
|
||||
#[instrument(skip(self), level = "debug")]
|
||||
pub(in super::super) fn report_ambiguity_errors(&self) {
|
||||
pub(crate) fn report_ambiguity_errors(&self) {
|
||||
let mut errors = self.fulfillment_cx.borrow_mut().collect_remaining_errors(self);
|
||||
|
||||
if !errors.is_empty() {
|
||||
|
@ -608,7 +608,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
|
||||
/// Select as many obligations as we can at present.
|
||||
pub(in super::super) fn select_obligations_where_possible(
|
||||
pub(crate) fn select_obligations_where_possible(
|
||||
&self,
|
||||
mutate_fulfillment_errors: impl Fn(&mut Vec<traits::FulfillmentError<'tcx>>),
|
||||
) {
|
||||
|
@ -624,7 +624,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
/// returns a type of `&T`, but the actual type we assign to the
|
||||
/// *expression* is `T`. So this function just peels off the return
|
||||
/// type by one layer to yield `T`.
|
||||
pub(in super::super) fn make_overloaded_place_return_type(
|
||||
pub(crate) fn make_overloaded_place_return_type(
|
||||
&self,
|
||||
method: MethodCallee<'tcx>,
|
||||
) -> ty::TypeAndMut<'tcx> {
|
||||
|
@ -635,7 +635,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
ret_ty.builtin_deref(true).unwrap()
|
||||
}
|
||||
|
||||
pub(in super::super) fn type_var_is_sized(&self, self_ty: ty::TyVid) -> bool {
|
||||
pub(crate) fn type_var_is_sized(&self, self_ty: ty::TyVid) -> bool {
|
||||
let sized_did = self.tcx.lang_items().sized_trait();
|
||||
self.obligations_for_self_ty(self_ty).any(|obligation| {
|
||||
match obligation.predicate.kind().skip_binder() {
|
||||
|
@ -647,7 +647,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
})
|
||||
}
|
||||
|
||||
pub(in super::super) fn err_args(&self, len: usize) -> Vec<Ty<'tcx>> {
|
||||
pub(crate) fn err_args(&self, len: usize) -> Vec<Ty<'tcx>> {
|
||||
let ty_error = Ty::new_misc_error(self.tcx);
|
||||
vec![ty_error; len]
|
||||
}
|
||||
|
@ -655,7 +655,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
/// Unifies the output type with the expected type early, for more coercions
|
||||
/// and forward type information on the input expressions.
|
||||
#[instrument(skip(self, call_span), level = "debug")]
|
||||
pub(in super::super) fn expected_inputs_for_expected_output(
|
||||
pub(crate) fn expected_inputs_for_expected_output(
|
||||
&self,
|
||||
call_span: Span,
|
||||
expected_ret: Expectation<'tcx>,
|
||||
|
@ -688,7 +688,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
expect_args
|
||||
}
|
||||
|
||||
pub(in super::super) fn resolve_lang_item_path(
|
||||
pub(crate) fn resolve_lang_item_path(
|
||||
&self,
|
||||
lang_item: hir::LangItem,
|
||||
span: Span,
|
||||
|
@ -867,7 +867,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
/// but we often want access to the parent function's signature.
|
||||
///
|
||||
/// Otherwise, return false.
|
||||
pub(in super::super) fn get_node_fn_decl(
|
||||
pub(crate) fn get_node_fn_decl(
|
||||
&self,
|
||||
node: Node<'tcx>,
|
||||
) -> Option<(LocalDefId, &'tcx hir::FnDecl<'tcx>, Ident, bool)> {
|
||||
|
@ -945,7 +945,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
})
|
||||
}
|
||||
|
||||
pub(in super::super) fn note_internal_mutation_in_method(
|
||||
pub(crate) fn note_internal_mutation_in_method(
|
||||
&self,
|
||||
err: &mut Diag<'_>,
|
||||
expr: &hir::Expr<'_>,
|
||||
|
@ -1490,7 +1490,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
pub(in super::super) fn with_breakable_ctxt<F: FnOnce() -> R, R>(
|
||||
pub(crate) fn with_breakable_ctxt<F: FnOnce() -> R, R>(
|
||||
&self,
|
||||
id: HirId,
|
||||
ctxt: BreakableCtxt<'tcx>,
|
||||
|
@ -1516,7 +1516,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
|
||||
/// Instantiate a QueryResponse in a probe context, without a
|
||||
/// good ObligationCause.
|
||||
pub(in super::super) fn probe_instantiate_query_response(
|
||||
pub(crate) fn probe_instantiate_query_response(
|
||||
&self,
|
||||
span: Span,
|
||||
original_values: &OriginalQueryValues<'tcx>,
|
||||
|
@ -1531,7 +1531,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
}
|
||||
|
||||
/// Returns `true` if an expression is contained inside the LHS of an assignment expression.
|
||||
pub(in super::super) fn expr_in_place(&self, mut expr_id: HirId) -> bool {
|
||||
pub(crate) fn expr_in_place(&self, mut expr_id: HirId) -> bool {
|
||||
let mut contained_in_place = false;
|
||||
|
||||
while let hir::Node::Expr(parent_expr) = self.tcx.parent_hir_node(expr_id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue