Check if enum from foreign crate has any non exhaustive variants when attempting a cast Fixes #91161 As stated in the issue, this will require a crater run as it might break other people's stuff.
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.