1
Fork 0

Auto merge of #116163 - compiler-errors:lazyness, r=oli-obk

Don't store lazyness in `DefKind::TyAlias`

1. Don't store lazyness of a type alias in its `DefKind`, but instead via a query.
2. This allows us to treat type aliases as lazy if `#[feature(lazy_type_alias)]` *OR* if the alias contains a TAIT, rather than having checks for both in separate parts of the codebase.

r? `@oli-obk` cc `@fmease`
This commit is contained in:
bors 2023-09-27 01:48:53 +00:00
commit 6b99cf1d35
51 changed files with 128 additions and 189 deletions

View file

@ -580,9 +580,7 @@ pub(crate) fn report_cycle<'a>(
});
}
let alias = if stack
.iter()
.all(|entry| matches!(entry.query.def_kind, Some(DefKind::TyAlias { .. })))
let alias = if stack.iter().all(|entry| matches!(entry.query.def_kind, Some(DefKind::TyAlias)))
{
Some(crate::error::Alias::Ty)
} else if stack.iter().all(|entry| entry.query.def_kind == Some(DefKind::TraitAlias)) {