1
Fork 0

Remove crashes, add comment

This commit is contained in:
Michael Goulet 2024-10-03 15:19:23 -04:00
parent 5b1a2b8712
commit bc5f9520c1
4 changed files with 2 additions and 54 deletions

View file

@ -2224,6 +2224,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
) -> GetSafeTransmuteErrorAndReason {
use rustc_transmute::Answer;
// We don't assemble a transmutability candidate for types that are generic
// and we should have ambiguity for types that still have non-region infer.
if obligation.predicate.has_non_region_param() || obligation.has_non_region_infer() {
return GetSafeTransmuteErrorAndReason::Default;
}