]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_middle/src/ty/structural_impls.rs
Auto merge of #103556 - clubby789:specialize-option-partial-eq, r=scottmcm
[rust.git] / compiler / rustc_middle / src / ty / structural_impls.rs
index c8baac1ec20a7232bdacf20a2ba2056bd4c326b8..9f70b4f1ffd25291592894531cab301143c473bb 100644 (file)
@@ -601,6 +601,12 @@ fn try_fold_with<F: FallibleTypeFolder<'tcx>>(self, folder: &mut F) -> Result<Se
     }
 }
 
+impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<ty::Const<'tcx>> {
+    fn try_fold_with<F: FallibleTypeFolder<'tcx>>(self, folder: &mut F) -> Result<Self, F::Error> {
+        ty::util::fold_list(self, folder, |tcx, v| tcx.mk_const_list(v.iter()))
+    }
+}
+
 impl<'tcx> TypeFoldable<'tcx> for &'tcx ty::List<ProjectionKind> {
     fn try_fold_with<F: FallibleTypeFolder<'tcx>>(self, folder: &mut F) -> Result<Self, F::Error> {
         ty::util::fold_list(self, folder, |tcx, v| tcx.intern_projs(v))