Move various checks to typeck so them failing causes the typeck result to get tainted Fixes #69487 fixes #79047 cc `@RalfJung` this gets rid of the `Transmute` invalid program error variant
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.