Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6f7d206

Browse files
authoredOct 5, 2024··
Unrolled build for rust-lang#131264
Rollup merge of rust-lang#131264 - compiler-errors:fix-pub-crate, r=jieyouxu Fix some `pub(crate)` that were undetected bc of `#[instrument]` Self-explanatory, minor clean up.
2 parents 14f303b + be2540a commit 6f7d206

File tree

16 files changed

+31
-29
lines changed

16 files changed

+31
-29
lines changed
 

‎compiler/rustc_borrowck/src/renumber.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use crate::BorrowckInferCtxt;
1111
/// Replaces all free regions appearing in the MIR with fresh
1212
/// inference variables, returning the number of variables created.
1313
#[instrument(skip(infcx, body, promoted), level = "debug")]
14-
pub fn renumber_mir<'tcx>(
14+
pub(crate) fn renumber_mir<'tcx>(
1515
infcx: &BorrowckInferCtxt<'tcx>,
1616
body: &mut Body<'tcx>,
1717
promoted: &mut IndexSlice<Promoted, Body<'tcx>>,

‎compiler/rustc_borrowck/src/type_check/constraint_conversion.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl<'a, 'tcx> ConstraintConversion<'a, 'tcx> {
9797
/// that we computed for the closure. This has the effect of adding new outlives obligations
9898
/// to existing region variables in `closure_args`.
9999
#[instrument(skip(self), level = "debug")]
100-
pub fn apply_closure_requirements(
100+
pub(crate) fn apply_closure_requirements(
101101
&mut self,
102102
closure_requirements: &ClosureRegionRequirements<'tcx>,
103103
closure_def_id: DefId,

‎compiler/rustc_hir_typeck/src/_match.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{Diverges, Expectation, FnCtxt, Needs};
1515

1616
impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
1717
#[instrument(skip(self), level = "debug", ret)]
18-
pub fn check_match(
18+
pub(crate) fn check_match(
1919
&self,
2020
expr: &'tcx hir::Expr<'tcx>,
2121
scrut: &'tcx hir::Expr<'tcx>,

‎compiler/rustc_hir_typeck/src/cast.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
671671
}
672672

673673
#[instrument(skip(fcx), level = "debug")]
674-
pub fn check(mut self, fcx: &FnCtxt<'a, 'tcx>) {
674+
pub(crate) fn check(mut self, fcx: &FnCtxt<'a, 'tcx>) {
675675
self.expr_ty = fcx.structurally_resolve_type(self.expr_span, self.expr_ty);
676676
self.cast_ty = fcx.structurally_resolve_type(self.cast_span, self.cast_ty);
677677

‎compiler/rustc_hir_typeck/src/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct ClosureSignatures<'tcx> {
4444

4545
impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
4646
#[instrument(skip(self, closure), level = "debug")]
47-
pub fn check_expr_closure(
47+
pub(crate) fn check_expr_closure(
4848
&self,
4949
closure: &hir::Closure<'tcx>,
5050
expr_span: Span,

‎compiler/rustc_hir_typeck/src/demand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
182182
}
183183

184184
#[instrument(skip(self), level = "debug")]
185-
pub fn demand_suptype_with_origin(
185+
pub(crate) fn demand_suptype_with_origin(
186186
&'a self,
187187
cause: &ObligationCause<'tcx>,
188188
expected: Ty<'tcx>,
@@ -247,7 +247,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
247247
/// N.B., this code relies on `self.diverges` to be accurate. In particular, assignments to `!`
248248
/// will be permitted if the diverges flag is currently "always".
249249
#[instrument(level = "debug", skip(self, expr, expected_ty_expr, allow_two_phase))]
250-
pub fn demand_coerce_diag(
250+
pub(crate) fn demand_coerce_diag(
251251
&'a self,
252252
mut expr: &'tcx hir::Expr<'tcx>,
253253
checked_ty: Ty<'tcx>,

‎compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+13-9
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
187187
}
188188

189189
#[instrument(level = "debug", skip(self))]
190-
pub fn write_method_call_and_enforce_effects(
190+
pub(crate) fn write_method_call_and_enforce_effects(
191191
&self,
192192
hir_id: HirId,
193193
span: Span,
@@ -214,7 +214,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
214214
/// occurred**, so that annotations like `Vec<_>` are preserved
215215
/// properly.
216216
#[instrument(skip(self), level = "debug")]
217-
pub fn write_user_type_annotation_from_args(
217+
pub(crate) fn write_user_type_annotation_from_args(
218218
&self,
219219
hir_id: HirId,
220220
def_id: DefId,
@@ -235,7 +235,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
235235
}
236236

237237
#[instrument(skip(self), level = "debug")]
238-
pub fn write_user_type_annotation(
238+
pub(crate) fn write_user_type_annotation(
239239
&self,
240240
hir_id: HirId,
241241
canonical_user_type_annotation: CanonicalUserType<'tcx>,
@@ -254,7 +254,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
254254
}
255255

256256
#[instrument(skip(self, expr), level = "debug")]
257-
pub fn apply_adjustments(&self, expr: &hir::Expr<'_>, adj: Vec<Adjustment<'tcx>>) {
257+
pub(crate) fn apply_adjustments(&self, expr: &hir::Expr<'_>, adj: Vec<Adjustment<'tcx>>) {
258258
debug!("expr = {:#?}", expr);
259259

260260
if adj.is_empty() {
@@ -448,7 +448,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
448448
}
449449

450450
#[instrument(level = "debug", skip_all)]
451-
pub fn lower_ty_saving_user_provided_ty(&self, hir_ty: &hir::Ty<'tcx>) -> Ty<'tcx> {
451+
pub(crate) fn lower_ty_saving_user_provided_ty(&self, hir_ty: &hir::Ty<'tcx>) -> Ty<'tcx> {
452452
let ty = self.lower_ty(hir_ty);
453453
debug!(?ty);
454454

@@ -736,7 +736,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
736736
/// Resolves an associated value path into a base type and associated constant, or method
737737
/// resolution. The newly resolved definition is written into `type_dependent_defs`.
738738
#[instrument(level = "trace", skip(self), ret)]
739-
pub fn resolve_ty_and_res_fully_qualified_call(
739+
pub(crate) fn resolve_ty_and_res_fully_qualified_call(
740740
&self,
741741
qpath: &'tcx QPath<'tcx>,
742742
hir_id: HirId,
@@ -995,7 +995,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
995995
// Instantiates the given path, which must refer to an item with the given
996996
// number of type parameters and type.
997997
#[instrument(skip(self, span), level = "debug")]
998-
pub fn instantiate_value_path(
998+
pub(crate) fn instantiate_value_path(
999999
&self,
10001000
segments: &'tcx [hir::PathSegment<'tcx>],
10011001
self_ty: Option<LoweredTy<'tcx>>,
@@ -1446,7 +1446,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14461446
/// variable. This is different from `structurally_resolve_type` which errors
14471447
/// in this case.
14481448
#[instrument(level = "debug", skip(self, sp), ret)]
1449-
pub fn try_structurally_resolve_type(&self, sp: Span, ty: Ty<'tcx>) -> Ty<'tcx> {
1449+
pub(crate) fn try_structurally_resolve_type(&self, sp: Span, ty: Ty<'tcx>) -> Ty<'tcx> {
14501450
let ty = self.resolve_vars_with_obligations(ty);
14511451

14521452
if self.next_trait_solver()
@@ -1471,7 +1471,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14711471
}
14721472

14731473
#[instrument(level = "debug", skip(self, sp), ret)]
1474-
pub fn try_structurally_resolve_const(&self, sp: Span, ct: ty::Const<'tcx>) -> ty::Const<'tcx> {
1474+
pub(crate) fn try_structurally_resolve_const(
1475+
&self,
1476+
sp: Span,
1477+
ct: ty::Const<'tcx>,
1478+
) -> ty::Const<'tcx> {
14751479
// FIXME(min_const_generic_exprs): We could process obligations here if `ct` is a var.
14761480

14771481
if self.next_trait_solver()

‎compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

-1
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
984984

985985
self.suggest_deref_unwrap_or(
986986
&mut err,
987-
error_span,
988987
callee_ty,
989988
call_ident,
990989
expected_ty,

‎compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14621462
pub(crate) fn suggest_deref_unwrap_or(
14631463
&self,
14641464
err: &mut Diag<'_>,
1465-
error_span: Span,
14661465
callee_ty: Option<Ty<'tcx>>,
14671466
call_ident: Option<Ident>,
14681467
expected_ty: Ty<'tcx>,

‎compiler/rustc_hir_typeck/src/method/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub(crate) enum CandidateSource {
9494
impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
9595
/// Determines whether the type `self_ty` supports a visible method named `method_name` or not.
9696
#[instrument(level = "debug", skip(self))]
97-
pub fn method_exists_for_diagnostic(
97+
pub(crate) fn method_exists_for_diagnostic(
9898
&self,
9999
method_name: Ident,
100100
self_ty: Ty<'tcx>,
@@ -178,7 +178,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
178178
/// * `self_expr`: the self expression (`foo`)
179179
/// * `args`: the expressions of the arguments (`a, b + 1, ...`)
180180
#[instrument(level = "debug", skip(self))]
181-
pub fn lookup_method(
181+
pub(crate) fn lookup_method(
182182
&self,
183183
self_ty: Ty<'tcx>,
184184
segment: &'tcx hir::PathSegment<'tcx>,
@@ -281,7 +281,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
281281
}
282282

283283
#[instrument(level = "debug", skip(self, call_expr))]
284-
pub fn lookup_probe(
284+
pub(crate) fn lookup_probe(
285285
&self,
286286
method_name: Ident,
287287
self_ty: Ty<'tcx>,
@@ -498,7 +498,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
498498
/// * `self_ty_span` the span for the type being searched within (span of `Foo`)
499499
/// * `expr_id`: the [`hir::HirId`] of the expression composing the entire call
500500
#[instrument(level = "debug", skip(self), ret)]
501-
pub fn resolve_fully_qualified_call(
501+
pub(crate) fn resolve_fully_qualified_call(
502502
&self,
503503
span: Span,
504504
method_name: Ident,

‎compiler/rustc_hir_typeck/src/method/probe.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
224224
/// would use to decide if a method is a plausible fit for
225225
/// ambiguity purposes).
226226
#[instrument(level = "debug", skip(self, candidate_filter))]
227-
pub fn probe_for_return_type_for_diagnostic(
227+
pub(crate) fn probe_for_return_type_for_diagnostic(
228228
&self,
229229
span: Span,
230230
mode: Mode,
@@ -267,7 +267,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
267267
}
268268

269269
#[instrument(level = "debug", skip(self))]
270-
pub fn probe_for_name(
270+
pub(crate) fn probe_for_name(
271271
&self,
272272
mode: Mode,
273273
item_name: Ident,

‎compiler/rustc_hir_typeck/src/method/suggest.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
183183
}
184184

185185
#[instrument(level = "debug", skip(self))]
186-
pub fn report_method_error(
186+
pub(crate) fn report_method_error(
187187
&self,
188188
call_id: HirId,
189189
rcvr_ty: Ty<'tcx>,

‎compiler/rustc_mir_dataflow/src/elaborate_drops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ where
225225
// FIXME: I think we should just control the flags externally,
226226
// and then we do not need this machinery.
227227
#[instrument(level = "debug")]
228-
pub fn elaborate_drop(&mut self, bb: BasicBlock) {
228+
fn elaborate_drop(&mut self, bb: BasicBlock) {
229229
match self.elaborator.drop_style(self.path, DropFlagMode::Deep) {
230230
DropStyle::Dead => {
231231
self.elaborator

‎compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ fn encode_region<'tcx>(region: Region<'tcx>, dict: &mut FxHashMap<DictKey<'tcx>,
315315
/// Encodes a ty:Ty using the Itanium C++ ABI with vendor extended type qualifiers and types for
316316
/// Rust types that are not used at the FFI boundary.
317317
#[instrument(level = "trace", skip(tcx, dict))]
318-
pub fn encode_ty<'tcx>(
318+
pub(crate) fn encode_ty<'tcx>(
319319
tcx: TyCtxt<'tcx>,
320320
ty: Ty<'tcx>,
321321
dict: &mut FxHashMap<DictKey<'tcx>, usize>,

‎compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/transform.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ fn trait_object_ty<'tcx>(tcx: TyCtxt<'tcx>, poly_trait_ref: ty::PolyTraitRef<'tc
291291
/// the Fn trait that defines the method (for being attached as a secondary type id).
292292
///
293293
#[instrument(level = "trace", skip(tcx))]
294-
pub fn transform_instance<'tcx>(
294+
pub(crate) fn transform_instance<'tcx>(
295295
tcx: TyCtxt<'tcx>,
296296
mut instance: Instance<'tcx>,
297297
options: TransformTyOptions,

‎compiler/rustc_transmute/src/maybe_transmutable/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ mod rustc {
4040
/// This method begins by converting `src` and `dst` from `Ty`s to `Tree`s,
4141
/// then computes an answer using those trees.
4242
#[instrument(level = "debug", skip(self), fields(src = ?self.src, dst = ?self.dst))]
43-
pub fn answer(self) -> Answer<<TyCtxt<'tcx> as QueryContext>::Ref> {
43+
pub(crate) fn answer(self) -> Answer<<TyCtxt<'tcx> as QueryContext>::Ref> {
4444
let Self { src, dst, assume, context } = self;
4545

4646
let layout_cx = LayoutCx::new(context, ParamEnv::reveal_all());

0 commit comments

Comments
 (0)
Please sign in to comment.