You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I only discovered why I was running into that issue once I stumbled upon some section in Rust's developer book. It mentions that "traits with associated types must be invariant with respect to all of their inputs", which is exactly my case. But to learn this, I had to look through a book that should only be used by those that contribute to the Rust compiler.
It would be really nice if it was included in the Rustnomicon (or maybe in the reference, or both). Furthermore, the explanation in Rust's developer book uses compiler terminology and implementation-specific stuff that I'm not familiar with. To this day, I only know that these traits are invariant, but not really why.
Thanks in advance!
The text was updated successfully, but these errors were encountered:
I ran into an issue with variance & subtyping, so I started to investigate about the topic. I read Rustnomicon's page about it, the reference, and watched Jon Gjengset's video, and I finally understood it, more or less. However, I still couldn't tell why my specific issue was occurring, because the examples covered in these sources were quite basic.
I only discovered why I was running into that issue once I stumbled upon some section in Rust's developer book. It mentions that "traits with associated types must be invariant with respect to all of their inputs", which is exactly my case. But to learn this, I had to look through a book that should only be used by those that contribute to the Rust compiler.
It would be really nice if it was included in the Rustnomicon (or maybe in the reference, or both). Furthermore, the explanation in Rust's developer book uses compiler terminology and implementation-specific stuff that I'm not familiar with. To this day, I only know that these traits are invariant, but not really why.
Thanks in advance!
The text was updated successfully, but these errors were encountered: