Ensure no one constructs AliasTys themselves

This commit is contained in:
Oli Scherer 2022-12-13 11:07:42 +00:00
parent 4ffe3bdf99
commit a5cd3bde95
50 changed files with 104 additions and 106 deletions

View file

@ -205,7 +205,7 @@ impl<'cx, 'tcx> FallibleTypeFolder<'tcx> for QueryNormalizer<'cx, 'tcx> {
// This is really important. While we *can* handle this, this has
// severe performance implications for large opaque types with
// late-bound regions. See `issue-88862` benchmark.
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs })
ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs, .. })
if !substs.has_escaping_bound_vars() =>
{
// Only normalize `impl Trait` outside of type inference, usually in codegen.