I am trying to solve this issue. https://github.com/rust-lang/rust/issues/66912. I think I've pinned down the reason. https://github.com/rust-lang/rust/blob/e5e8ba4edc435c9f87314b23a6c5d9c175bdf19c/src/librustc_typeck/check/wfcheck.rs#L1156 this function reports error when the generic parameter is bi-variant. The variance of parameter
Foo is deduced from
Bar. This information is lost. We only store the variance information of
T. How do I differentiate those two
T? What is the general way to store those kind of information?
fn crate_variances calculates the variances for all types. I suggest you try to make a function that calculates if the type have any direct usages of
T, ideally sharing code with