rust-lang / types-team

Home of the "types team", affiliated with the compiler and lang teams.
https://rust-lang.github.io/types-team/
Apache License 2.0
95 stars 19 forks source link

Variance and Rust #45

Open nikomatsakis opened 2 years ago

nikomatsakis commented 2 years ago

Summary

My opinion is that variance, as traditionally formulated, assumes a "GC'd language", and isn't a good fit for Rust. Let's talk about variance more closely, how it works but also why it's not a great fit for Rust.

Rationale

Relevant to various bits of design work we could undertake, e.g. variance for associated types and trait matching.

Notes

Some notes to myself: