about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-06-13 18:05:11 +0000
committerMichael Goulet <michael@errs.io>2025-06-24 01:42:28 +0000
commitb8ef88517d84f25fbf5adec9e6573dbfd170b2e9 (patch)
treef698432b2ac20053ec540f124ae996277a4cd265 /compiler/rustc_infer/src
parent706f244db581212cabf2e619e0113d70999b2bbe (diff)
downloadrust-b8ef88517d84f25fbf5adec9e6573dbfd170b2e9.tar.gz
rust-b8ef88517d84f25fbf5adec9e6573dbfd170b2e9.zip
Introduce trivial WF functions, use it in fast path
Diffstat (limited to 'compiler/rustc_infer/src')
-rw-r--r--compiler/rustc_infer/src/infer/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs
index e9b58eb959b..5a99b976b0d 100644
--- a/compiler/rustc_infer/src/infer/mod.rs
+++ b/compiler/rustc_infer/src/infer/mod.rs
@@ -1046,6 +1046,13 @@ impl<'tcx> InferCtxt<'tcx> {
         }
     }
 
+    pub fn shallow_resolve_term(&self, term: ty::Term<'tcx>) -> ty::Term<'tcx> {
+        match term.kind() {
+            ty::TermKind::Ty(ty) => self.shallow_resolve(ty).into(),
+            ty::TermKind::Const(ct) => self.shallow_resolve_const(ct).into(),
+        }
+    }
+
     pub fn root_var(&self, var: ty::TyVid) -> ty::TyVid {
         self.inner.borrow_mut().type_variables().root_var(var)
     }