Rollup merge of #112853 - GuillaumeGomez:type_alias_type, r=oli-obk

Add `lazy_type_alias` feature gate

Add the `type_alias_type` to be able to have the weak alias used without restrictions.

Part of #112792.

cc `@compiler-errors`
r? `@oli-obk`
This commit is contained in:
Guillaume Gomez 2023-06-21 15:45:16 +02:00 committed by GitHub
commit 009d72b3ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 68 additions and 5 deletions

View file

@ -896,7 +896,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
let ty = self.tcx().at(span).type_of(did);
if matches!(self.tcx().def_kind(did), DefKind::TyAlias)
&& ty.skip_binder().has_opaque_types()
&& (ty.skip_binder().has_opaque_types() || self.tcx().features().lazy_type_alias)
{
// Type aliases referring to types that contain opaque types (but aren't just directly
// referencing a single opaque type) get encoded as a type alias that normalization will