Skip to content

Commit 0368fb1

Browse files
committed
Auto merge of rust-lang#125044 - GuillaumeGomez:rollup-yjk7by4, r=GuillaumeGomez
Rollup of 4 pull requests Successful merges: - rust-lang#124807 (Migrate `run-make/rustdoc-io-error` to `rmake.rs`) - rust-lang#125021 (Update reference safety requirements) - rust-lang#125030 (Fix some minor issues from the ui-test auto-porting) - rust-lang#125036 (solve: all "non-structural" logging to trace) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 4fd98a4 + 25a716d commit 0368fb1

32 files changed

+103
-113
lines changed

Diff for: compiler/rustc_trait_selection/src/solve/alias_relate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc_middle::traits::solve::{Certainty, Goal, QueryResult};
2020
use rustc_middle::ty;
2121

2222
impl<'tcx> EvalCtxt<'_, 'tcx> {
23-
#[instrument(level = "debug", skip(self), ret)]
23+
#[instrument(level = "trace", skip(self), ret)]
2424
pub(super) fn compute_alias_relate_goal(
2525
&mut self,
2626
goal: Goal<'tcx, (ty::Term<'tcx>, ty::Term<'tcx>, ty::AliasRelationDirection)>,
@@ -50,7 +50,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
5050
self.try_evaluate_added_goals()?;
5151
let lhs = self.resolve_vars_if_possible(lhs);
5252
let rhs = self.resolve_vars_if_possible(rhs);
53-
debug!(?lhs, ?rhs);
53+
trace!(?lhs, ?rhs);
5454

5555
let variance = match direction {
5656
ty::AliasRelationDirection::Equate => ty::Variance::Invariant,

Diff for: compiler/rustc_trait_selection/src/solve/assembly/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
331331
.enter(|this| this.evaluate_added_goals_and_make_canonical_response(certainty))
332332
}
333333

334-
#[instrument(level = "debug", skip_all)]
334+
#[instrument(level = "trace", skip_all)]
335335
fn assemble_non_blanket_impl_candidates<G: GoalKind<'tcx>>(
336336
&mut self,
337337
goal: Goal<'tcx, G>,
@@ -447,7 +447,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
447447
}
448448
}
449449

450-
#[instrument(level = "debug", skip_all)]
450+
#[instrument(level = "trace", skip_all)]
451451
fn assemble_blanket_impl_candidates<G: GoalKind<'tcx>>(
452452
&mut self,
453453
goal: Goal<'tcx, G>,
@@ -470,7 +470,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
470470
}
471471
}
472472

473-
#[instrument(level = "debug", skip_all)]
473+
#[instrument(level = "trace", skip_all)]
474474
fn assemble_builtin_impl_candidates<G: GoalKind<'tcx>>(
475475
&mut self,
476476
goal: Goal<'tcx, G>,
@@ -544,7 +544,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
544544
}
545545
}
546546

547-
#[instrument(level = "debug", skip_all)]
547+
#[instrument(level = "trace", skip_all)]
548548
fn assemble_param_env_candidates<G: GoalKind<'tcx>>(
549549
&mut self,
550550
goal: Goal<'tcx, G>,
@@ -561,7 +561,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
561561
}
562562
}
563563

564-
#[instrument(level = "debug", skip_all)]
564+
#[instrument(level = "trace", skip_all)]
565565
fn assemble_alias_bound_candidates<G: GoalKind<'tcx>>(
566566
&mut self,
567567
goal: Goal<'tcx, G>,
@@ -665,7 +665,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
665665
}
666666
}
667667

668-
#[instrument(level = "debug", skip_all)]
668+
#[instrument(level = "trace", skip_all)]
669669
fn assemble_object_bound_candidates<G: GoalKind<'tcx>>(
670670
&mut self,
671671
goal: Goal<'tcx, G>,
@@ -756,7 +756,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
756756
///
757757
/// To do so we add an ambiguous candidate in case such an unknown impl could
758758
/// apply to the current goal.
759-
#[instrument(level = "debug", skip_all)]
759+
#[instrument(level = "trace", skip_all)]
760760
fn assemble_coherence_unknowable_candidates<G: GoalKind<'tcx>>(
761761
&mut self,
762762
goal: Goal<'tcx, G>,

Diff for: compiler/rustc_trait_selection/src/solve/assembly/structural_traits.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::solve::EvalCtxt;
1717
//
1818
// For types with an "existential" binder, i.e. coroutine witnesses, we also
1919
// instantiate the binder with placeholders eagerly.
20-
#[instrument(level = "debug", skip(ecx), ret)]
20+
#[instrument(level = "trace", skip(ecx), ret)]
2121
pub(in crate::solve) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
2222
ecx: &EvalCtxt<'_, 'tcx>,
2323
ty: Ty<'tcx>,
@@ -96,7 +96,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_auto_trait<'tcx>(
9696
}
9797
}
9898

99-
#[instrument(level = "debug", skip(ecx), ret)]
99+
#[instrument(level = "trace", skip(ecx), ret)]
100100
pub(in crate::solve) fn instantiate_constituent_tys_for_sized_trait<'tcx>(
101101
ecx: &EvalCtxt<'_, 'tcx>,
102102
ty: Ty<'tcx>,
@@ -160,7 +160,7 @@ pub(in crate::solve) fn instantiate_constituent_tys_for_sized_trait<'tcx>(
160160
}
161161
}
162162

163-
#[instrument(level = "debug", skip(ecx), ret)]
163+
#[instrument(level = "trace", skip(ecx), ret)]
164164
pub(in crate::solve) fn instantiate_constituent_tys_for_copy_clone_trait<'tcx>(
165165
ecx: &EvalCtxt<'_, 'tcx>,
166166
ty: Ty<'tcx>,

Diff for: compiler/rustc_trait_selection/src/solve/eval_ctxt/canonical.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
8383
/// the values inferred while solving the instantiated goal.
8484
/// - `external_constraints`: additional constraints which aren't expressible
8585
/// using simple unification of inference variables.
86-
#[instrument(level = "debug", skip(self), ret)]
86+
#[instrument(level = "trace", skip(self), ret)]
8787
pub(in crate::solve) fn evaluate_added_goals_and_make_canonical_response(
8888
&mut self,
8989
certainty: Certainty,
@@ -166,15 +166,15 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
166166
/// external constraints do not need to record that opaque, since if it is
167167
/// further constrained by inference, that will be passed back in the var
168168
/// values.
169-
#[instrument(level = "debug", skip(self), ret)]
169+
#[instrument(level = "trace", skip(self), ret)]
170170
fn compute_external_query_constraints(
171171
&self,
172172
normalization_nested_goals: NestedNormalizationGoals<'tcx>,
173173
) -> Result<ExternalConstraintsData<'tcx>, NoSolution> {
174174
// We only check for leaks from universes which were entered inside
175175
// of the query.
176176
self.infcx.leak_check(self.max_input_universe, None).map_err(|e| {
177-
debug!(?e, "failed the leak check");
177+
trace!(?e, "failed the leak check");
178178
NoSolution
179179
})?;
180180

@@ -334,7 +334,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
334334
/// whether an alias is rigid by using the trait solver. When instantiating a response
335335
/// from the solver we assume that the solver correctly handled aliases and therefore
336336
/// always relate them structurally here.
337-
#[instrument(level = "debug", skip(infcx))]
337+
#[instrument(level = "trace", skip(infcx))]
338338
fn unify_query_var_values(
339339
infcx: &InferCtxt<'tcx>,
340340
param_env: ty::ParamEnv<'tcx>,
@@ -407,7 +407,7 @@ pub(in crate::solve) fn make_canonical_state<'tcx, T: TypeFoldable<TyCtxt<'tcx>>
407407
/// This currently assumes that unifying the var values trivially succeeds.
408408
/// Adding any inference constraints which weren't present when originally
409409
/// computing the canonical query can result in bugs.
410-
#[instrument(level = "debug", skip(infcx, span, param_env))]
410+
#[instrument(level = "trace", skip(infcx, span, param_env))]
411411
pub(in crate::solve) fn instantiate_canonical_state<'tcx, T: TypeFoldable<TyCtxt<'tcx>>>(
412412
infcx: &InferCtxt<'tcx>,
413413
span: Span,

Diff for: compiler/rustc_trait_selection/src/solve/eval_ctxt/mod.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
458458
}
459459
}
460460

461-
#[instrument(level = "debug", skip(self))]
461+
#[instrument(level = "trace", skip(self))]
462462
pub(super) fn add_normalizes_to_goal(&mut self, goal: Goal<'tcx, ty::NormalizesTo<'tcx>>) {
463463
self.inspect.add_normalizes_to_goal(self.infcx, self.max_input_universe, goal);
464464
self.nested_goals.normalizes_to_goals.push(goal);
@@ -472,7 +472,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
472472

473473
// Recursively evaluates all the goals added to this `EvalCtxt` to completion, returning
474474
// the certainty of all the goals.
475-
#[instrument(level = "debug", skip(self))]
475+
#[instrument(level = "trace", skip(self))]
476476
pub(super) fn try_evaluate_added_goals(&mut self) -> Result<Certainty, NoSolution> {
477477
self.inspect.start_evaluate_added_goals();
478478
let mut response = Ok(Certainty::overflow(false));
@@ -526,7 +526,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
526526
unconstrained_goal,
527527
)?;
528528
// Add the nested goals from normalization to our own nested goals.
529-
debug!(?nested_goals);
529+
trace!(?nested_goals);
530530
goals.goals.extend(nested_goals);
531531

532532
// Finally, equate the goal's RHS with the unconstrained var.
@@ -622,7 +622,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
622622
///
623623
/// This is the case if the `term` does not occur in any other part of the predicate
624624
/// and is able to name all other placeholder and inference variables.
625-
#[instrument(level = "debug", skip(self), ret)]
625+
#[instrument(level = "trace", skip(self), ret)]
626626
pub(super) fn term_is_fully_unconstrained(
627627
&self,
628628
goal: Goal<'tcx, ty::NormalizesTo<'tcx>>,
@@ -718,7 +718,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
718718
&& goal.param_env.visit_with(&mut visitor).is_continue()
719719
}
720720

721-
#[instrument(level = "debug", skip(self, param_env), ret)]
721+
#[instrument(level = "trace", skip(self, param_env), ret)]
722722
pub(super) fn eq<T: ToTrace<'tcx>>(
723723
&mut self,
724724
param_env: ty::ParamEnv<'tcx>,
@@ -733,7 +733,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
733733
self.add_goals(GoalSource::Misc, obligations.into_iter().map(|o| o.into()));
734734
})
735735
.map_err(|e| {
736-
debug!(?e, "failed to equate");
736+
trace!(?e, "failed to equate");
737737
NoSolution
738738
})
739739
}
@@ -743,7 +743,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
743743
/// Normally we emit a nested `AliasRelate` when equating an inference
744744
/// variable and an alias. This causes us to instead constrain the inference
745745
/// variable to the alias without emitting a nested alias relate goals.
746-
#[instrument(level = "debug", skip(self, param_env), ret)]
746+
#[instrument(level = "trace", skip(self, param_env), ret)]
747747
pub(super) fn relate_rigid_alias_non_alias(
748748
&mut self,
749749
param_env: ty::ParamEnv<'tcx>,
@@ -781,7 +781,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
781781
/// This sohuld only be used when we're either instantiating a previously
782782
/// unconstrained "return value" or when we're sure that all aliases in
783783
/// the types are rigid.
784-
#[instrument(level = "debug", skip(self, param_env), ret)]
784+
#[instrument(level = "trace", skip(self, param_env), ret)]
785785
pub(super) fn eq_structurally_relating_aliases<T: ToTrace<'tcx>>(
786786
&mut self,
787787
param_env: ty::ParamEnv<'tcx>,
@@ -798,7 +798,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
798798
Ok(())
799799
}
800800

801-
#[instrument(level = "debug", skip(self, param_env), ret)]
801+
#[instrument(level = "trace", skip(self, param_env), ret)]
802802
pub(super) fn sub<T: ToTrace<'tcx>>(
803803
&mut self,
804804
param_env: ty::ParamEnv<'tcx>,
@@ -813,12 +813,12 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
813813
self.add_goals(GoalSource::Misc, obligations.into_iter().map(|o| o.into()));
814814
})
815815
.map_err(|e| {
816-
debug!(?e, "failed to subtype");
816+
trace!(?e, "failed to subtype");
817817
NoSolution
818818
})
819819
}
820820

821-
#[instrument(level = "debug", skip(self, param_env), ret)]
821+
#[instrument(level = "trace", skip(self, param_env), ret)]
822822
pub(super) fn relate<T: ToTrace<'tcx>>(
823823
&mut self,
824824
param_env: ty::ParamEnv<'tcx>,
@@ -834,7 +834,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
834834
self.add_goals(GoalSource::Misc, obligations.into_iter().map(|o| o.into()));
835835
})
836836
.map_err(|e| {
837-
debug!(?e, "failed to relate");
837+
trace!(?e, "failed to relate");
838838
NoSolution
839839
})
840840
}
@@ -859,7 +859,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
859859
obligations.into_iter().map(|o| o.into()).collect()
860860
})
861861
.map_err(|e| {
862-
debug!(?e, "failed to equate");
862+
trace!(?e, "failed to equate");
863863
NoSolution
864864
})
865865
}

Diff for: compiler/rustc_trait_selection/src/solve/eval_ctxt/probe.rs

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ impl<'tcx, F> TraitProbeCtxt<'_, '_, 'tcx, F>
5858
where
5959
F: FnOnce(&QueryResult<'tcx>) -> inspect::ProbeKind<'tcx>,
6060
{
61+
#[instrument(level = "debug", skip_all, fields(source = ?self.source))]
6162
pub(in crate::solve) fn enter(
6263
self,
6364
f: impl FnOnce(&mut EvalCtxt<'_, 'tcx>) -> QueryResult<'tcx>,

Diff for: compiler/rustc_trait_selection/src/solve/fulfill.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl<'tcx> FulfillmentCtxt<'tcx> {
119119
}
120120

121121
impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
122-
#[instrument(level = "debug", skip(self, infcx))]
122+
#[instrument(level = "trace", skip(self, infcx))]
123123
fn register_predicate_obligation(
124124
&mut self,
125125
infcx: &InferCtxt<'tcx>,

Diff for: compiler/rustc_trait_selection/src/solve/mod.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl<'tcx> Canonical<'tcx, Response<'tcx>> {
8282
}
8383

8484
impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
85-
#[instrument(level = "debug", skip(self))]
85+
#[instrument(level = "trace", skip(self))]
8686
fn compute_type_outlives_goal(
8787
&mut self,
8888
goal: Goal<'tcx, TypeOutlivesPredicate<'tcx>>,
@@ -92,7 +92,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
9292
self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
9393
}
9494

95-
#[instrument(level = "debug", skip(self))]
95+
#[instrument(level = "trace", skip(self))]
9696
fn compute_region_outlives_goal(
9797
&mut self,
9898
goal: Goal<'tcx, RegionOutlivesPredicate<'tcx>>,
@@ -102,7 +102,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
102102
self.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)
103103
}
104104

105-
#[instrument(level = "debug", skip(self))]
105+
#[instrument(level = "trace", skip(self))]
106106
fn compute_coerce_goal(
107107
&mut self,
108108
goal: Goal<'tcx, CoercePredicate<'tcx>>,
@@ -117,7 +117,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
117117
})
118118
}
119119

120-
#[instrument(level = "debug", skip(self))]
120+
#[instrument(level = "trace", skip(self))]
121121
fn compute_subtype_goal(
122122
&mut self,
123123
goal: Goal<'tcx, SubtypePredicate<'tcx>>,
@@ -138,7 +138,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
138138
}
139139
}
140140

141-
#[instrument(level = "debug", skip(self))]
141+
#[instrument(level = "trace", skip(self))]
142142
fn compute_well_formed_goal(
143143
&mut self,
144144
goal: Goal<'tcx, ty::GenericArg<'tcx>>,
@@ -152,7 +152,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
152152
}
153153
}
154154

155-
#[instrument(level = "debug", skip(self))]
155+
#[instrument(level = "trace", skip(self))]
156156
fn compute_const_evaluatable_goal(
157157
&mut self,
158158
Goal { param_env, predicate: ct }: Goal<'tcx, ty::Const<'tcx>>,
@@ -189,7 +189,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
189189
}
190190
}
191191

192-
#[instrument(level = "debug", skip(self), ret)]
192+
#[instrument(level = "trace", skip(self), ret)]
193193
fn compute_const_arg_has_type_goal(
194194
&mut self,
195195
goal: Goal<'tcx, (ty::Const<'tcx>, Ty<'tcx>)>,
@@ -201,7 +201,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
201201
}
202202

203203
impl<'tcx> EvalCtxt<'_, 'tcx> {
204-
#[instrument(level = "debug", skip(self, goals))]
204+
#[instrument(level = "trace", skip(self, goals))]
205205
fn add_goals(
206206
&mut self,
207207
source: GoalSource,
@@ -215,7 +215,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
215215
/// Try to merge multiple possible ways to prove a goal, if that is not possible returns `None`.
216216
///
217217
/// In this case we tend to flounder and return ambiguity by calling `[EvalCtxt::flounder]`.
218-
#[instrument(level = "debug", skip(self), ret)]
218+
#[instrument(level = "trace", skip(self), ret)]
219219
fn try_merge_responses(
220220
&mut self,
221221
responses: &[CanonicalResponse<'tcx>],
@@ -241,7 +241,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
241241
}
242242

243243
/// If we fail to merge responses we flounder and return overflow or ambiguity.
244-
#[instrument(level = "debug", skip(self), ret)]
244+
#[instrument(level = "trace", skip(self), ret)]
245245
fn flounder(&mut self, responses: &[CanonicalResponse<'tcx>]) -> QueryResult<'tcx> {
246246
if responses.is_empty() {
247247
return Err(NoSolution);
@@ -263,7 +263,7 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
263263
/// This function is necessary in nearly all cases before matching on a type.
264264
/// Not doing so is likely to be incomplete and therefore unsound during
265265
/// coherence.
266-
#[instrument(level = "debug", skip(self, param_env), ret)]
266+
#[instrument(level = "trace", skip(self, param_env), ret)]
267267
fn structurally_normalize_ty(
268268
&mut self,
269269
param_env: ty::ParamEnv<'tcx>,

0 commit comments

Comments
 (0)