From 547c124c0505778807a49dc44080ba6835721f48 Mon Sep 17 00:00:00 2001 From: Chayim Refael Friedman Date: Fri, 18 Apr 2025 06:56:10 +0300 Subject: [PATCH] Fix variance This one does need fixpoint. --- crates/hir-ty/src/variance.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/hir-ty/src/variance.rs b/crates/hir-ty/src/variance.rs index 4053982788..4e9aa5610a 100644 --- a/crates/hir-ty/src/variance.rs +++ b/crates/hir-ty/src/variance.rs @@ -57,11 +57,11 @@ pub(crate) fn variances_of(db: &dyn HirDatabase, def: GenericDefId) -> Option>, + _result: &Option>, _count: u32, _def: GenericDefId, ) -> CycleRecoveryAction>> { - CycleRecoveryAction::Fallback(result.clone()) + CycleRecoveryAction::Iterate } pub(crate) fn variances_of_cycle_initial( @@ -961,16 +961,12 @@ struct S3(S); #[test] fn prove_fixedpoint() { - // FIXME: This is wrong, this should be `FixedPoint[T: covariant, U: covariant, V: covariant]` - // This is a limitation of current salsa where a cycle may only set a fallback value to the - // query result, but we need to solve a fixpoint here. The new salsa will have this - // fortunately. check( r#" struct FixedPoint(&'static FixedPoint<(), T, U>, V); "#, expect![[r#" - FixedPoint[T: bivariant, U: bivariant, V: bivariant] + FixedPoint[T: covariant, U: covariant, V: covariant] "#]], ); }