Stream: t-compiler

Topic: General way to store additional inference information


B YI (Mar 12 2020 at 10:33, on Zulip):

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 T in Foo is deduced from T in 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?

Zoxc (Mar 12 2020 at 11:23, on Zulip):

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 fn crate_variances.

Last update: Jun 04 2020 at 18:10UTC