transmutability: only short-circuit is_transmutable for non-region infers by lapla-cogito · Pull Request #149228 · rust-lang/rust (original) (raw)

fixes #141400, fixes #148809

An ICE occurs when using std::mem::TransmuteForm for trait resolution when it contains inferred variables. This can be resolved by adding an early return condition to is_transmutable. However, since most existing type resolution appears to be handled by rustc_transmute::TransmuteTypeEnv, I've added a guard that only applies when non-regional inference variables remain.