diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-02-28 16:34:41 +1100 | 
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2025-02-28 16:34:41 +1100 | 
| commit | 5f58985f5df2e7fbbef6c1acf54ece9df90ccbf3 (patch) | |
| tree | 49a2bbce20c1e540c44bb58bbfc3ec67b5c6eb34 /compiler/rustc_trait_selection | |
| parent | 00f245915b0c7839d42c26f9628220c4f1b93bf6 (diff) | |
| download | rust-5f58985f5df2e7fbbef6c1acf54ece9df90ccbf3.tar.gz rust-5f58985f5df2e7fbbef6c1acf54ece9df90ccbf3.zip | |
Remove `rustc_transmute`'s dependence on `rustc_infer`.
`TransmuteTypeEnv` only needs a `TyCtxt`, not an `InferCtxt`.
Diffstat (limited to 'compiler/rustc_trait_selection')
3 files changed, 3 insertions, 3 deletions
| diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs index 596f794568c..b2cc1804673 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs @@ -2544,7 +2544,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { let src = trait_pred.trait_ref.args.type_at(1); let err_msg = format!("`{src}` cannot be safely transmuted into `{dst}`"); - match rustc_transmute::TransmuteTypeEnv::new(self.infcx).is_transmutable( + match rustc_transmute::TransmuteTypeEnv::new(self.infcx.tcx).is_transmutable( obligation.cause, src_and_dst, assume, diff --git a/compiler/rustc_trait_selection/src/solve/delegate.rs b/compiler/rustc_trait_selection/src/solve/delegate.rs index 58d8a3a6254..550ffe8cc3b 100644 --- a/compiler/rustc_trait_selection/src/solve/delegate.rs +++ b/compiler/rustc_trait_selection/src/solve/delegate.rs @@ -236,7 +236,7 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate< }; // FIXME(transmutability): This really should be returning nested goals for `Answer::If*` - match rustc_transmute::TransmuteTypeEnv::new(&self.0).is_transmutable( + match rustc_transmute::TransmuteTypeEnv::new(self.0.tcx).is_transmutable( ObligationCause::dummy(), rustc_transmute::Types { src, dst }, assume, diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs index 32cbb97e314..53c61c15a21 100644 --- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs +++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs @@ -424,7 +424,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { let src = predicate.trait_ref.args.type_at(1); debug!(?src, ?dst); - let mut transmute_env = rustc_transmute::TransmuteTypeEnv::new(self.infcx); + let mut transmute_env = rustc_transmute::TransmuteTypeEnv::new(self.infcx.tcx); let maybe_transmutable = transmute_env.is_transmutable( obligation.cause.clone(), rustc_transmute::Types { dst, src }, | 
