]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_trait_selection/src/traits/engine.rs
Rollup merge of #105521 - tshepang:keep-heading-separate, r=nagisa
[rust.git] / compiler / rustc_trait_selection / src / traits / engine.rs
index 64d01ddb09a493bafff61f309e741d0709af66e6..c028e89e4ea2963f093b48240a8f98ca613199d3 100644 (file)
@@ -112,6 +112,24 @@ pub fn normalize<T: TypeFoldable<'tcx>>(
         self.register_infer_ok_obligations(infer_ok)
     }
 
+    /// Makes `expected <: actual`.
+    pub fn eq_exp<T>(
+        &self,
+        cause: &ObligationCause<'tcx>,
+        param_env: ty::ParamEnv<'tcx>,
+        a_is_expected: bool,
+        a: T,
+        b: T,
+    ) -> Result<(), TypeError<'tcx>>
+    where
+        T: ToTrace<'tcx>,
+    {
+        self.infcx
+            .at(cause, param_env)
+            .eq_exp(a_is_expected, a, b)
+            .map(|infer_ok| self.register_infer_ok_obligations(infer_ok))
+    }
+
     pub fn eq<T: ToTrace<'tcx>>(
         &self,
         cause: &ObligationCause<'tcx>,