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:
commit
6b99cf1d35
51 changed files with 128 additions and 189 deletions
|
@ -21,7 +21,7 @@ pub fn test_abi(tcx: TyCtxt<'_>) {
|
|||
DefKind::Fn | DefKind::AssocFn => {
|
||||
dump_abi_of_fn_item(tcx, id, attr);
|
||||
}
|
||||
DefKind::TyAlias { .. } => {
|
||||
DefKind::TyAlias => {
|
||||
dump_abi_of_fn_type(tcx, id, attr);
|
||||
}
|
||||
_ => {
|
||||
|
|
|
@ -96,7 +96,7 @@ impl<'tcx> MarkSymbolVisitor<'tcx> {
|
|||
|
||||
fn handle_res(&mut self, res: Res) {
|
||||
match res {
|
||||
Res::Def(DefKind::Const | DefKind::AssocConst | DefKind::TyAlias { .. }, def_id) => {
|
||||
Res::Def(DefKind::Const | DefKind::AssocConst | DefKind::TyAlias, def_id) => {
|
||||
self.check_def_id(def_id);
|
||||
}
|
||||
_ if self.in_pat => {}
|
||||
|
@ -923,7 +923,7 @@ impl<'tcx> DeadVisitor<'tcx> {
|
|||
| DefKind::Fn
|
||||
| DefKind::Static(_)
|
||||
| DefKind::Const
|
||||
| DefKind::TyAlias { .. }
|
||||
| DefKind::TyAlias
|
||||
| DefKind::Enum
|
||||
| DefKind::Union
|
||||
| DefKind::ForeignTy => self.warn_dead_code(def_id, "used"),
|
||||
|
|
|
@ -23,7 +23,7 @@ pub fn test_layout(tcx: TyCtxt<'_>) {
|
|||
for id in tcx.hir_crate_items(()).definitions() {
|
||||
for attr in tcx.get_attrs(id, sym::rustc_layout) {
|
||||
match tcx.def_kind(id) {
|
||||
DefKind::TyAlias { .. } | DefKind::Enum | DefKind::Struct | DefKind::Union => {
|
||||
DefKind::TyAlias | DefKind::Enum | DefKind::Struct | DefKind::Union => {
|
||||
dump_layout_of(tcx, id, attr);
|
||||
}
|
||||
_ => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue