Skip to main content

Module variance

Module variance 

Source
Expand description

Module for inferring the variance of type and lifetime parameters. See the rustc dev guide chapter for more info.

The implementation here differs from rustc. Rustc does a crate wide fixpoint resolution as the algorithm for determining variance is a fixpoint computation with potential cycles that need to be resolved. rust-analyzer does not want a crate-wide analysis though as that would hurt incrementality too much and as such our query is based on a per item basis.

This does unfortunately run into the issue that we can run into query cycles which salsa currently does not allow to be resolved via a fixpoint computation. This will likely be resolved by the next salsa version. If not, we will likely have to adapt and go with the rustc approach while installing firewall per item queries to prevent invalidation issues.

Structsยง

Context ๐Ÿ”’

Functionsยง

glb ๐Ÿ”’
variances_of ๐Ÿ”’
variances_of_cycle_fn ๐Ÿ”’
variances_of_cycle_initial ๐Ÿ”’
variances_of_query ๐Ÿ”’