diff options
| author | Chayim Refael Friedman <chayimfr@gmail.com> | 2025-04-18 06:56:10 +0300 |
|---|---|---|
| committer | Chayim Refael Friedman <chayimfr@gmail.com> | 2025-04-22 15:20:07 +0300 |
| commit | 676f2121e62e813a3821b725148211182a172879 (patch) | |
| tree | 5106203bafd39937a68adc911bd829001a82b830 | |
| parent | e2d14a288297511a65c29791c8505c0558c2e2f4 (diff) | |
| download | rust-676f2121e62e813a3821b725148211182a172879.tar.gz rust-676f2121e62e813a3821b725148211182a172879.zip | |
Fix variance
This one does need fixpoint.
| -rw-r--r-- | src/tools/rust-analyzer/crates/hir-ty/src/variance.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-ty/src/variance.rs b/src/tools/rust-analyzer/crates/hir-ty/src/variance.rs index 40539827880..4e9aa5610a5 100644 --- a/src/tools/rust-analyzer/crates/hir-ty/src/variance.rs +++ b/src/tools/rust-analyzer/crates/hir-ty/src/variance.rs @@ -57,11 +57,11 @@ pub(crate) fn variances_of(db: &dyn HirDatabase, def: GenericDefId) -> Option<Ar pub(crate) fn variances_of_cycle_fn( _db: &dyn HirDatabase, - result: &Option<Arc<[Variance]>>, + _result: &Option<Arc<[Variance]>>, _count: u32, _def: GenericDefId, ) -> CycleRecoveryAction<Option<Arc<[Variance]>>> { - CycleRecoveryAction::Fallback(result.clone()) + CycleRecoveryAction::Iterate } pub(crate) fn variances_of_cycle_initial( @@ -961,16 +961,12 @@ struct S3<T>(S<T, T>); #[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<T, U, V>(&'static FixedPoint<(), T, U>, V); "#, expect![[r#" - FixedPoint[T: bivariant, U: bivariant, V: bivariant] + FixedPoint[T: covariant, U: covariant, V: covariant] "#]], ); } |
