diff options
| author | bors <bors@rust-lang.org> | 2025-02-06 06:45:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-02-06 06:45:07 +0000 |
| commit | 59588250ad973ce69bd15879314c9769e65f36b3 (patch) | |
| tree | 25e49a356546f6a242f6ea26a94071b3f1a96ad1 /compiler/rustc_trait_selection/src | |
| parent | c753cb9b42e530950204dd0367525cce12811cdd (diff) | |
| parent | c549268a4a64c0a2c2288c6eee74173cdd7ad37e (diff) | |
| download | rust-59588250ad973ce69bd15879314c9769e65f36b3.tar.gz rust-59588250ad973ce69bd15879314c9769e65f36b3.zip | |
Auto merge of #136613 - workingjubilee:rollup-ry6rw0m, r=workingjubilee
Rollup of 13 pull requests Successful merges: - #133932 (Avoid using make_direct_deprecated() in extern "ptx-kernel") - #136269 (Pass spans around new solver) - #136550 (Fix `rustc_hidden_type_of_opaques` for RPITITs with no default body) - #136558 (Document minimum supported host tooling on macOS) - #136563 (Clean up `Trivial*Impls` macros) - #136566 (Fix link in from_fn.rs) - #136573 (Document why some "type mismatches" exist) - #136583 (Only highlight unmatchable parameters at the definition site) - #136587 (Update browser-ui-test version to `0.20.2`) - #136590 (Implement RustcInternal for RawPtrKind) - #136591 (Add `rustc_hir_pretty::expr_to_string` function) - #136595 (Fix `unreachable_pub` lint for hermit target) - #136611 (cg_llvm: Remove the `mod llvm_` hack, which should no longer be necessary) Failed merges: - #136565 (compiler: Clean up weird `rustc_abi` reexports) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_trait_selection/src')
4 files changed, 22 insertions, 14 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/delegate.rs b/compiler/rustc_trait_selection/src/solve/delegate.rs index abb79493432..58d8a3a6254 100644 --- a/compiler/rustc_trait_selection/src/solve/delegate.rs +++ b/compiler/rustc_trait_selection/src/solve/delegate.rs @@ -43,8 +43,6 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate< self.0.tcx } - type Span = Span; - fn build_with_canonical<V>( interner: TyCtxt<'tcx>, canonical: &CanonicalQueryInput<'tcx, V>, @@ -147,9 +145,10 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate< fn instantiate_canonical_var_with_infer( &self, cv_info: CanonicalVarInfo<'tcx>, + span: Span, universe_map: impl Fn(ty::UniverseIndex) -> ty::UniverseIndex, ) -> ty::GenericArg<'tcx> { - self.0.instantiate_canonical_var(DUMMY_SP, cv_info, universe_map) + self.0.instantiate_canonical_var(span, cv_info, universe_map) } fn insert_hidden_type( @@ -175,11 +174,13 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate< self.0.add_item_bounds_for_hidden_type(def_id, args, param_env, hidden_ty, goals); } - fn inject_new_hidden_type_unchecked(&self, key: ty::OpaqueTypeKey<'tcx>, hidden_ty: Ty<'tcx>) { - self.0.inject_new_hidden_type_unchecked(key, ty::OpaqueHiddenType { - ty: hidden_ty, - span: DUMMY_SP, - }) + fn inject_new_hidden_type_unchecked( + &self, + key: ty::OpaqueTypeKey<'tcx>, + hidden_ty: Ty<'tcx>, + span: Span, + ) { + self.0.inject_new_hidden_type_unchecked(key, ty::OpaqueHiddenType { ty: hidden_ty, span }) } fn reset_opaque_types(&self) { diff --git a/compiler/rustc_trait_selection/src/solve/fulfill.rs b/compiler/rustc_trait_selection/src/solve/fulfill.rs index 0db44eda847..c238e708ab8 100644 --- a/compiler/rustc_trait_selection/src/solve/fulfill.rs +++ b/compiler/rustc_trait_selection/src/solve/fulfill.rs @@ -82,7 +82,7 @@ impl<'tcx> ObligationStorage<'tcx> { self.overflowed.extend(ExtractIf::new(&mut self.pending, |o| { let goal = o.clone().into(); let result = <&SolverDelegate<'tcx>>::from(infcx) - .evaluate_root_goal(goal, GenerateProofTree::No) + .evaluate_root_goal(goal, GenerateProofTree::No, o.cause.span) .0; matches!(result, Ok((HasChanged::Yes, _))) })); @@ -163,7 +163,7 @@ where for obligation in self.obligations.unstalled_for_select() { let goal = obligation.clone().into(); let result = <&SolverDelegate<'tcx>>::from(infcx) - .evaluate_root_goal(goal, GenerateProofTree::No) + .evaluate_root_goal(goal, GenerateProofTree::No, obligation.cause.span) .0; self.inspect_evaluated_obligation(infcx, &obligation, &result); let (changed, certainty) = match result { diff --git a/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs b/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs index c64bc19835b..8edd623e5d0 100644 --- a/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs +++ b/compiler/rustc_trait_selection/src/solve/fulfill/derive_errors.rs @@ -88,7 +88,11 @@ pub(super) fn fulfillment_error_for_stalled<'tcx>( ) -> FulfillmentError<'tcx> { let (code, refine_obligation) = infcx.probe(|_| { match <&SolverDelegate<'tcx>>::from(infcx) - .evaluate_root_goal(root_obligation.clone().into(), GenerateProofTree::No) + .evaluate_root_goal( + root_obligation.clone().into(), + GenerateProofTree::No, + root_obligation.cause.span, + ) .0 { Ok((_, Certainty::Maybe(MaybeCause::Ambiguity))) => { diff --git a/compiler/rustc_trait_selection/src/solve/inspect/analyse.rs b/compiler/rustc_trait_selection/src/solve/inspect/analyse.rs index 9ba48cd588f..9f4ee54bd4c 100644 --- a/compiler/rustc_trait_selection/src/solve/inspect/analyse.rs +++ b/compiler/rustc_trait_selection/src/solve/inspect/analyse.rs @@ -238,7 +238,7 @@ impl<'a, 'tcx> InspectCandidate<'a, 'tcx> { // constraints, we get an ICE if we already applied the constraints // from the chosen candidate. let proof_tree = infcx - .probe(|_| infcx.evaluate_root_goal(goal, GenerateProofTree::Yes).1) + .probe(|_| infcx.evaluate_root_goal(goal, GenerateProofTree::Yes, span).1) .unwrap(); InspectGoal::new(infcx, self.goal.depth + 1, proof_tree, None, source) } @@ -440,8 +440,11 @@ impl<'tcx> InferCtxt<'tcx> { depth: usize, visitor: &mut V, ) -> V::Result { - let (_, proof_tree) = - <&SolverDelegate<'tcx>>::from(self).evaluate_root_goal(goal, GenerateProofTree::Yes); + let (_, proof_tree) = <&SolverDelegate<'tcx>>::from(self).evaluate_root_goal( + goal, + GenerateProofTree::Yes, + visitor.span(), + ); let proof_tree = proof_tree.unwrap(); visitor.visit_goal(&InspectGoal::new(self, depth, proof_tree, None, GoalSource::Misc)) } |
