mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-04 19:28:29 +00:00

The rules were baffling when I ran in to them trying to add some impls, so I made the compiler explain them to me. The logic of the successful cases is unchanged, but I did rearrange it to reverse the order of the primitive and `Adt` cases; this makes producing the errors easier.
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.