about summary refs log tree commit diff
path: root/compiler/rustc_transmute
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-02-28 16:34:41 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-02-28 16:34:41 +1100
commit5f58985f5df2e7fbbef6c1acf54ece9df90ccbf3 (patch)
tree49a2bbce20c1e540c44bb58bbfc3ec67b5c6eb34 /compiler/rustc_transmute
parent00f245915b0c7839d42c26f9628220c4f1b93bf6 (diff)
downloadrust-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_transmute')
-rw-r--r--compiler/rustc_transmute/Cargo.toml2
-rw-r--r--compiler/rustc_transmute/src/lib.rs13
2 files changed, 6 insertions, 9 deletions
diff --git a/compiler/rustc_transmute/Cargo.toml b/compiler/rustc_transmute/Cargo.toml
index e9daf6b0c38..3b6bb59196e 100644
--- a/compiler/rustc_transmute/Cargo.toml
+++ b/compiler/rustc_transmute/Cargo.toml
@@ -8,7 +8,6 @@ edition = "2024"
 rustc_abi = { path = "../rustc_abi", optional = true }
 rustc_data_structures = { path = "../rustc_data_structures" }
 rustc_hir = { path = "../rustc_hir", optional = true }
-rustc_infer = { path = "../rustc_infer", optional = true }
 rustc_macros = { path = "../rustc_macros", optional = true }
 rustc_middle = { path = "../rustc_middle", optional = true }
 rustc_span = { path = "../rustc_span", optional = true }
@@ -19,7 +18,6 @@ tracing = "0.1"
 rustc = [
     "dep:rustc_abi",
     "dep:rustc_hir",
-    "dep:rustc_infer",
     "dep:rustc_macros",
     "dep:rustc_middle",
     "dep:rustc_span",
diff --git a/compiler/rustc_transmute/src/lib.rs b/compiler/rustc_transmute/src/lib.rs
index f9537f708ef..9726c9e98aa 100644
--- a/compiler/rustc_transmute/src/lib.rs
+++ b/compiler/rustc_transmute/src/lib.rs
@@ -81,7 +81,6 @@ pub enum Reason<T> {
 #[cfg(feature = "rustc")]
 mod rustc {
     use rustc_hir::lang_items::LangItem;
-    use rustc_infer::infer::InferCtxt;
     use rustc_macros::TypeVisitable;
     use rustc_middle::traits::ObligationCause;
     use rustc_middle::ty::{Const, ParamEnv, Ty, TyCtxt};
@@ -97,13 +96,13 @@ mod rustc {
         pub dst: Ty<'tcx>,
     }
 
-    pub struct TransmuteTypeEnv<'cx, 'tcx> {
-        infcx: &'cx InferCtxt<'tcx>,
+    pub struct TransmuteTypeEnv<'tcx> {
+        tcx: TyCtxt<'tcx>,
     }
 
-    impl<'cx, 'tcx> TransmuteTypeEnv<'cx, 'tcx> {
-        pub fn new(infcx: &'cx InferCtxt<'tcx>) -> Self {
-            Self { infcx }
+    impl<'tcx> TransmuteTypeEnv<'tcx> {
+        pub fn new(tcx: TyCtxt<'tcx>) -> Self {
+            Self { tcx }
         }
 
         #[allow(unused)]
@@ -117,7 +116,7 @@ mod rustc {
                 types.src,
                 types.dst,
                 assume,
-                self.infcx.tcx,
+                self.tcx,
             )
             .answer()
         }