]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_trait_selection/src/infer.rs
Rollup merge of #101635 - jyn514:queries-new-derived, r=cjgillot
[rust.git] / compiler / rustc_trait_selection / src / infer.rs
index 9d30374f8b8aeac6bb0641558454f4f1c9c0bf46..ba403ab2da2bcd5e5951afbca84c795c10b11f0b 100644 (file)
@@ -24,6 +24,13 @@ fn type_is_copy_modulo_regions(
         span: Span,
     ) -> bool;
 
+    fn type_is_sized_modulo_regions(
+        &self,
+        param_env: ty::ParamEnv<'tcx>,
+        ty: Ty<'tcx>,
+        span: Span,
+    ) -> bool;
+
     fn partially_normalize_associated_types_in<T>(
         &self,
         cause: ObligationCause<'tcx>,
@@ -74,6 +81,16 @@ fn type_is_copy_modulo_regions(
         traits::type_known_to_meet_bound_modulo_regions(self, param_env, ty, copy_def_id, span)
     }
 
+    fn type_is_sized_modulo_regions(
+        &self,
+        param_env: ty::ParamEnv<'tcx>,
+        ty: Ty<'tcx>,
+        span: Span,
+    ) -> bool {
+        let lang_item = self.tcx.require_lang_item(LangItem::Sized, None);
+        traits::type_known_to_meet_bound_modulo_regions(self, param_env, ty, lang_item, span)
+    }
+
     /// Normalizes associated types in `value`, potentially returning
     /// new obligations that must further be processed.
     fn partially_normalize_associated_types_in<T>(