1
Fork 0

Don't check for alias bounds in liveness when aliases have escaping bound vars

This commit is contained in:
Michael Goulet 2023-10-31 21:43:19 +00:00
parent 46455dc650
commit 4d5d763e05
4 changed files with 64 additions and 1 deletions

View file

@ -1,4 +1,6 @@
use rustc_middle::ty::{self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor};
use rustc_middle::ty::{
self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor,
};
use std::ops::ControlFlow;
@ -49,6 +51,12 @@ where
return ControlFlow::Continue(());
}
// FIXME: Don't consider alias bounds on types that have escaping bound
// vars. See #117455.
if ty.has_escaping_bound_vars() {
return ty.super_visit_with(self);
}
match ty.kind() {
// We can prove that an alias is live two ways:
// 1. All the components are live.